libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
captiondecoder.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_PROAV
13#include <cstdint>
14#include <promeki/cea708cdp.h>
15#include <promeki/enums.h>
16#include <promeki/framenumber.h>
17#include <promeki/list.h>
18#include <promeki/namespace.h>
19#include <promeki/string.h>
20#include <promeki/subtitle.h>
21#include <promeki/timestamp.h>
22#include <promeki/uniqueptr.h>
23
24PROMEKI_NAMESPACE_BEGIN
25
60class CaptionDecoder {
61 public:
77 using PtrList = promeki::List<UniquePtr<CaptionDecoder>>;
78
79 virtual ~CaptionDecoder() = default;
80
81 CaptionDecoder(const CaptionDecoder &) = delete;
82 CaptionDecoder &operator=(const CaptionDecoder &) = delete;
83 CaptionDecoder(CaptionDecoder &&) = delete;
84 CaptionDecoder &operator=(CaptionDecoder &&) = delete;
85
91 struct Config {
94 uint8_t serviceNumber = 1;
95 };
96
98 virtual CaptionCodec codec() const = 0;
99
119 virtual void pushFrame(FrameNumber frame, TimeStamp ts,
120 const Cea708Cdp::CcDataList &data) = 0;
121
142 virtual String displayedText() const = 0;
143
157 virtual Subtitle displayedCue() const = 0;
158
170 virtual SubtitleList finalize() = 0;
171
179 virtual void reset() = 0;
180
189 static UniquePtr<CaptionDecoder> create(CaptionCodec codec, const Config &cfg);
190
191 protected:
192 CaptionDecoder() = default;
193};
194
195PROMEKI_NAMESPACE_END
196
197#endif // PROMEKI_ENABLE_PROAV