libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
cea608decoder.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>
16#include <promeki/cea608xds.h>
17#include <promeki/cea708cdp.h>
19#include <promeki/framenumber.h>
20#include <promeki/list.h>
21#include <promeki/namespace.h>
22#include <promeki/sharedptr.h>
23#include <promeki/string.h>
24#include <promeki/subtitle.h>
25#include <promeki/timestamp.h>
26
27PROMEKI_NAMESPACE_BEGIN
28
29struct Cea608DecoderImpl; // Pimpl — defined in cea608decoder.cpp.
30
180class Cea608Decoder : public CaptionDecoder {
181 public:
183 using Channel = Cea608Encoder::Channel;
184
186 struct Config {
192 Channel channel = Channel::CC1;
193 };
194
195 Cea608Decoder();
196 explicit Cea608Decoder(Config cfg);
197 ~Cea608Decoder() override;
198
200 CaptionCodec codec() const override { return CaptionCodec(CaptionCodec::Cea608); }
201
203 const Config &config() const;
204
220 void pushFrame(FrameNumber frame, TimeStamp ts, const Cea708Cdp::CcDataList &data) override;
221
236 String displayedText() const override;
237
256 Subtitle displayedCue() const override;
257
269 SubtitleList finalize() override;
270
278 void reset() override;
279
297 List<Cea608XdsPacket> drainXdsPackets();
298
302 size_t xdsPending() const;
303
309 uint32_t xdsChecksumFailures() const;
310
311 private:
312 SharedPtr<Cea608DecoderImpl> _d;
313};
314
315PROMEKI_NAMESPACE_END
316
317#endif // PROMEKI_ENABLE_PROAV