libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
captionencoder.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/error.h>
17#include <promeki/framenumber.h>
18#include <promeki/framerate.h>
19#include <promeki/namespace.h>
20#include <promeki/subtitle.h>
21#include <promeki/uniqueptr.h>
22
23PROMEKI_NAMESPACE_BEGIN
24
54class CaptionEncoder {
55 public:
56 virtual ~CaptionEncoder() = default;
57
58 CaptionEncoder(const CaptionEncoder &) = delete;
59 CaptionEncoder &operator=(const CaptionEncoder &) = delete;
60 CaptionEncoder(CaptionEncoder &&) = delete;
61 CaptionEncoder &operator=(CaptionEncoder &&) = delete;
62
68 struct Config {
71 FrameRate frameRate;
74 uint8_t serviceNumber = 1;
78 int32_t windowCols = 32;
79 };
80
82 virtual CaptionCodec codec() const = 0;
83
85 virtual FrameRate frameRate() const = 0;
86
96 virtual Error setSubtitles(const SubtitleList &subs) = 0;
97
113 virtual SubtitleList encodableSubset(const SubtitleList &in,
114 SubtitleList *outDropped = nullptr) const {
115 if (outDropped != nullptr) *outDropped = SubtitleList();
116 return in;
117 }
118
129 virtual Cea708Cdp::CcDataList nextFrame(FrameNumber frame) const = 0;
130
132 virtual void reset() = 0;
133
142 static UniquePtr<CaptionEncoder> create(CaptionCodec codec, const Config &cfg);
143
144 protected:
145 CaptionEncoder() = default;
146};
147
148PROMEKI_NAMESPACE_END
149
150#endif // PROMEKI_ENABLE_PROAV