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>
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;
290 bool doubleControls = true;
291 };
292
293 Cea608Encoder();
294 explicit Cea608Encoder(Config cfg);
295 ~Cea608Encoder() override;
296
298 const Config &config() const;
299
301 CaptionCodec codec() const override { return CaptionCodec(CaptionCodec::Cea608); }
302
304 FrameRate frameRate() const override;
305
335 Error setSubtitles(const SubtitleList &subs) override;
336
338 void reset() override;
339
356 Cea708Cdp::CcDataList nextFrame(FrameNumber frame) const override;
357
378 FrameNumber earliestStartFor(const Subtitle &cue) const;
379
405 SubtitleList encodableSubset(const SubtitleList &in,
406 SubtitleList *outDropped = nullptr) const override;
407
408 private:
409 SharedPtr<Cea608EncoderImpl> _d;
410};
411
412PROMEKI_NAMESPACE_END
413
414#endif // PROMEKI_ENABLE_PROAV