AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ancillarydata_timecode_vitc.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef AJA_ANCILLARYDATA_TIMECODE_VITC_H
9 #define AJA_ANCILLARYDATA_TIMECODE_VITC_H
10 
11 #include "ancillarydatafactory.h"
12 #include "ancillarydata.h"
13 #include "ancillarydata_timecode.h"
14 
15 
16 // comment this out to use older "NTV2" VITC Encode algorithm
17 // leave defined to use "D-VITC" parameters as defined in SMPTE-266M
18 #define USE_SMPTE_266M
19 
20 
21 // VITC ("Analog") Packet IDs
24 
25 const uint32_t AJAAncillaryData_VITC_PayloadSize = 720; // note: assumes we're only using this for SD (720 pixels/line)
26 
27 
29 {
32  AJAAncillaryData_Timecode_VITC_Type_FilmData = 2, // RP-201 Film Data (CRC == 0xFF)
33  AJAAncillaryData_Timecode_VITC_Type_ProdData = 3 // RP-201 Production Data (CRC == 0x0F)
34 };
35 
36 
37 
42 {
43 public:
48 
50 
51  virtual void Clear (void);
52 
59 
60  virtual inline AJAAncillaryData_Timecode_VITC * Clone (void) const {return new AJAAncillaryData_Timecode_VITC (this);}
61 
66  virtual AJAStatus ParsePayloadData (void);
67 
73  virtual AJAStatus GeneratePayloadData (void);
74 
75  virtual inline AJAAncillaryData_Timecode_VITC_Type GetVITCDataType (void) const {return m_vitcType;}
76 
82  virtual AJAStatus SetVITCDataType (const AJAAncillaryData_Timecode_VITC_Type inType);
83 
90  virtual std::ostream & Print (std::ostream & inOutStream, const bool inDetailed = false) const;
91 
92 
98 
103  static std::string VITCTypeToString (const AJAAncillaryData_Timecode_VITC_Type inType);
104 
105 
106 protected:
107  void Init (void); // NOT virtual - called by constructors
108 
109  // Encode methods ported/stolen from ntv2vitc.cpp
110  bool DecodeLine (const uint8_t * pInLine);
111  AJAStatus EncodeLine (uint8_t * pOutLine) const;
112 
113 #ifdef USE_SMPTE_266M
114 #else
115  void DoVITCBitPair(uint8_t *pLine, uint32_t& pixelIndex, bool bPrevBit, bool bBit0, bool bBit1, bool bDropBit);
116 #endif
117 
118  // Note: if you make a change to the local member data, be sure to ALSO make the appropriate
119  // changes in the Init() and operator= methods!
121 
122 }; // AJAAncillaryData_Timecode_VITC
123 
124 #endif // AJA_ANCILLARYDATA_TIMECODE_VITC_H
const uint8_t AJAAncData_AnalogDID
Definition: ancillarydata.h:24
AJAStatus
Definition: types.h:380
AJAAncDataType
Identifies the ancillary data types that are known to this module.
Definition: ancillarydata.h:44
virtual AJAStatus GeneratePayloadData(void)
Generate the payload data from the "local" ancillary data.
AJAAncillaryData_Timecode & operator=(const AJAAncillaryData_Timecode &inRHS)
Assignment operator – replaces my contents with the right-hand-side value.
AJAAncillaryData_Timecode_VITC_Type m_vitcType
The "type" of VITC received or to be transmitted.
AJAAncillaryData_Timecode_VITC_Type
This is the VITC-specific subclass of the AJAAncillaryData_Timecode class.
const uint8_t AJAAncillaryData_VITC_DID
static AJAAncDataType RecognizeThisAncillaryData(const AJAAncillaryData *pInAncData)
Declares the AJAAncillaryData_Timecode class.
This is the base class for the AJAAncillaryData_Timecode_ATC and AJAAncillaryData_Timecode_VITC class...
virtual AJAStatus ParsePayloadData(void)
Parses out (interprets) the "local" ancillary data from my payload data.
virtual AJAAncillaryData_Timecode_VITC_Type GetVITCDataType(void) const
Declaration of the AJAAncillaryDataFactory class.
const uint32_t AJAAncillaryData_VITC_PayloadSize
#define AJAExport
Definition: export.h:33
virtual void Clear(void)
Frees my allocated memory, if any, and resets my members to their default values. ...
const uint8_t AJAAncData_AnalogSID
Definition: ancillarydata.h:25
Declares the AJAAncillaryData class.
const uint8_t AJAAncillaryData_VITC_SID
I am the principal class that stores a single SMPTE-291 SDI ancillary data packet OR the digitized co...
static void DoVITCBitPair(uint8_t *pLine, uint32_t &pixelIndex, bool bPrevBit, bool bBit0, bool bBit1)
virtual AJAAncillaryData_Timecode_VITC * Clone(void) const
virtual std::ostream & Print(std::ostream &inOutStream, const bool inDetailed=false) const
Streams a human-readable representation of me to the given output stream.