libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
cea608encoder.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>
15#include <promeki/cea708cdp.h>
16#include <promeki/enums.h>
17#include <promeki/error.h>
18#include <promeki/framenumber.h>
19#include <promeki/framerate.h>
20#include <promeki/namespace.h>
21#include <promeki/result.h>
22#include <promeki/sharedptr.h>
23#include <promeki/string.h>
24#include <promeki/subtitle.h>
25
26PROMEKI_NAMESPACE_BEGIN
27
28struct Cea608EncoderImpl; // Pimpl — defined in cea608encoder.cpp.
29
178class Cea608Encoder : public CaptionEncoder {
179 public:
191 enum class Mode {
192 PopOn = 0,
193 PaintOn = 1,
194 RollUp = 2,
195 };
196
208 enum class Channel {
209 CC1 = 0,
210 CC2 = 1,
211 CC3 = 2,
212 CC4 = 3,
213 };
214
216 struct Config {
218 FrameRate frameRate;
225 Mode mode = Mode::PopOn;
231 Channel channel = Channel::CC1;
240 int32_t rollUpRows = 2;
248 int32_t maxCols = 32;
255 int32_t maxRows = 3;
256 };
257
258 Cea608Encoder();
259 explicit Cea608Encoder(Config cfg);
260 ~Cea608Encoder() override;
261
263 const Config &config() const;
264
266 CaptionCodec codec() const override { return CaptionCodec(CaptionCodec::Cea608); }
267
269 FrameRate frameRate() const override;
270
300 Error setSubtitles(const SubtitleList &subs) override;
301
303 void reset() override;
304
321 Cea708Cdp::CcDataList nextFrame(FrameNumber frame) const override;
322
333 FrameNumber earliestStartFor(const Subtitle &cue) const;
334
360 SubtitleList encodableSubset(const SubtitleList &in,
361 SubtitleList *outDropped = nullptr) const override;
362
363 private:
364 SharedPtr<Cea608EncoderImpl> _d;
365};
366
367PROMEKI_NAMESPACE_END
368
369#endif // PROMEKI_ENABLE_PROAV