AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
ntv2captiontranslator608to708.h
Go to the documentation of this file.
1 
7 #ifndef __NTV2_CEA608to708_TRANSLATOR_
8 #define __NTV2_CEA608to708_TRANSLATOR_
9 
10 #include "ntv2caption608types.h"
13 #include <vector>
14 
15 
16 #ifdef MSWindows
17  #include "windows.h"
18  #include "stdio.h"
19 #endif
20 
21 
44 
46 {
47  // CLASS METHODS
48  public:
56  static bool Create (CNTV2CaptionTranslator608to708Ptr & outInstance);
57 
58 
59  // INSTANCE METHODS
60  public:
65  virtual void Reset (void);
66 
72  virtual bool SetDisplayChannel (const NTV2Line21Channel chan);
73 
82  virtual bool Set708ServiceNumber (const NTV2Line21Channel chan, const int serviceNum);
83 
84 
92  virtual int Get708ServiceNumber (const NTV2Line21Channel chan) const;
93 
101  virtual bool Set708TranslateEnable (const NTV2Line21Channel chan, bool bEnable);
102 
103 
111  virtual bool Get708TranslateEnable (const NTV2Line21Channel chan) const;
112 
122  virtual bool GetCaptionChannelPacket (UBytePtr & outDataPtr, size_t & outByteCount);
123 
134  virtual bool Translate608CCData (const CaptionData & inCC608Data);
135 
147  virtual bool CreateSMPTE334Anc (const NTV2FrameRate frameRate, const NTV2Line21Field field, UWordPtr & outAncPacketData, size_t & outSize);
148 
158  virtual bool InsertSMPTE334AncPacketInVideoFrame (void * pFrameBuffer, const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inPixelFormat, const ULWord inLineNumber) const;
159 
160 
161  // DEBUG METHODS
162  virtual NTV2CaptionLogMask SetLogMask (const NTV2CaptionLogMask inLogMask);
163  virtual void Set608TestIDMode (bool bTest);
164 
165  virtual ~CNTV2CaptionTranslator608to708 ();
166 
167 
168  // PRIVATE INSTANCE METHODS
169  private:
170  virtual bool New608FrameData (const CaptionData & inCC608Data);
171  virtual bool New608FieldData (UByte char608_1, UByte char608_2, NTV2Line21Field field);
172 
173  virtual bool ParseCaptionData (UByte charP1, UByte charP2, NTV2Line21Field field, NTV2Line21Channel currChannel);
174  virtual bool ParseXDSData (UByte charP1, UByte charP2, NTV2Line21Field field); //, NTV2Line21Channel currChannel);
175  virtual NTV2Line21Channel GetCaptionChannel (UByte charP1, UByte charP2, NTV2Line21Field field);
176 
177  virtual bool Combine708CaptionChannelData (const NTV2FrameRate frameRate);
178  virtual size_t MaxCaptionChannelDataForFrameRate (NTV2FrameRate ntv2Rate);
179  virtual bool AddChannelServiceBlockData (NTV2Line21Channel channel, UByte * pEncodeData, size_t index, size_t maxIndex, size_t & outEndIndex);
180  virtual bool MapChannelServiceNumbers (void);
181 
182  // Debug
183  virtual void DebugPrintCurrentScreen (void) const;
184 
185  // Hidden Constructors and Assignment Operator
186  explicit CNTV2CaptionTranslator608to708 ();
188  virtual CNTV2CaptionTranslator608to708 & operator = (const CNTV2CaptionTranslator608to708 & inObj);
189 
190  typedef std::vector <CNTV2CaptionTranslatorChannel608to708Ptr> TranslatorArray;
191 
192 
193  // INSTANCE DATA
194  private:
195  NTV2Line21Channel mDisplayChannel;
196  NTV2Line21Channel mCurrXmitChannel [2];
197  TranslatorArray mChannelDecoders;
198  bool mEnableEmbedded608Output;
199  CNTV2XDSDecodeChannel608Ptr mXDSDecoder;
202  unsigned short mLastControlCode [2];
203  CNTV2CaptionEncoder708Ptr m708Encoder;
204 
205 }; // CNTV2CaptionTranslator608to708
206 
207 #endif // __NTV2_CEA608to708_TRANSLATOR_
CNTV2CaptionTranslator608to708Ptr
AJARefPtr< CNTV2CaptionTranslator608to708 > CNTV2CaptionTranslator608to708Ptr
Definition: ntv2captiontranslator608to708.h:42
ntv2caption608types.h
Declares several data types used with 608/SD captioning.
AJARefPtr
I am a reference-counted pointer template class. I am intended to be a proxy for an underlying object...
Definition: ajarefptr.h:89
NTV2FrameBufferFormat
NTV2FrameBufferFormat
Identifies a particular video frame buffer format. See Device Frame Buffer Formats for details.
Definition: ntv2enums.h:207
NTV2FrameRate
NTV2FrameRate
Identifies a particular video frame rate.
Definition: ntv2enums.h:396
ntv2xdscaptiondecodechannel608.h
Declares the CNTV2XDSDecodeChannel608 class.
CNTV2CaptionTranslator608to708
Definition: ntv2captiontranslator608to708.h:45
ntv2captiontranslatorchannel608to708.h
Declares the CNTV2CaptionTranslatorChannel608to708 class.
ULWord
uint32_t ULWord
Definition: ajatypes.h:253
CNTV2CaptionLogConfig::SetLogMask
virtual NTV2CaptionLogMask SetLogMask(const NTV2CaptionLogMask inLogMask)
Specifies what, if any, debug information I will write to my log stream.
Definition: ntv2captionlogging.h:187
UBytePtr
UByte * UBytePtr
Definition: ntv2captionencoder708.h:19
UByte
uint8_t UByte
Definition: ajatypes.h:248
NTV2Line21Channel
NTV2Line21Channel
The CEA-608 caption channels: CC1 thru CC4, TX1 thru TX4, plus XDS.
Definition: ntv2caption608types.h:82
AJAExport
#define AJAExport
Definition: export.h:33
NTV2VideoFormat
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
NTV2CaptionLogMask
uint64_t NTV2CaptionLogMask
Selectors to control what information is logged.
Definition: ntv2captionlogging.h:38
CNTV2CaptionLogConfig
Definition: ntv2captionlogging.h:77
NTV2Line21Field
NTV2Line21Field
The two CEA-608 interlace fields.
Definition: ntv2caption608types.h:56
CaptionData
This structure encapsulates all possible CEA-608 caption data bytes that may be associated with a giv...
Definition: ntv2caption608types.h:655
UWordPtr
UWord * UWordPtr
Definition: ntv2captionencoder708.h:20