AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ancillarydata_cea708.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #include "ancillarydata_cea708.h"
9 #include "ajabase/system/debug.h"
10 #include <ios>
11 #include <iomanip>
12 
13 using namespace std;
14 
15 
18 {
19  Init();
20 }
21 
22 
25 {
26  Init();
27  *this = clone;
28 }
29 
30 
33 {
34  Init();
35  if (pClone != NULL_PTR)
36  *this = *pClone;
37 }
38 
39 
41  : AJAAncillaryData (pData)
42 {
43  Init();
44 }
45 
46 
48 {
49 }
50 
51 
53 {
55 }
56 
57 
59 {
60  if (this != &rhs) // ignore self-assignment
61  AJAAncillaryData::operator= (rhs); // copy the base class stuff
62  return *this;
63 }
64 
65 
67 {
69  Init();
70 }
71 
72 
74 {
75  if (IsEmpty())
76  {
77  Init(); // load default values
78  m_rcvDataValid = false;
79  return AJA_STATUS_FAIL;
80  }
81 
82  // we have some kind of payload data - try to parse it
83  m_rcvDataValid = true;
84  return AJA_STATUS_SUCCESS;
85 }
86 
87 
89 {
91 
94 
95 // status = AllocDataMemory(AJAAncillaryData_SMPTE2016_3_PayloadSize);
96 
97  if (AJA_SUCCESS(status))
98  {
99  }
100 
102  return status;
103 }
104 
105 #define LOGMYWARN(__x__) AJA_sWARNING(AJA_DebugUnit_AJAAncList, AJAFUNC << ": " << __x__)
106 
108 {
109  if (pInAncData->GetLocationVideoSpace() == AJAAncDataSpace_VANC) // Must be VANC (per SMPTE 334-2)
110  if (pInAncData->GetDID() == AJAAncillaryData_CEA708_DID) // DID == 0x61
111  if (pInAncData->GetSID() == AJAAncillaryData_CEA708_SID) // SDID == 0x01
112  if (IS_VALID_AJAAncDataChannel(pInAncData->GetLocationDataChannel())) // Valid channel?
113  {
114  if (pInAncData->GetLocationDataChannel() == AJAAncDataChannel_C) // Y OK, Y+C OK
115  LOGMYWARN("CEA708 packet on C-channel"); // Violates SMPTE 334-1 sec 4 -- bad praxis, but will allow
116  return AJAAncDataType_Cea708;
117  }
118  return AJAAncDataType_Unknown;
119 }
120 
121 
122 ostream & AJAAncillaryData_Cea708::Print (ostream & debugStream, const bool bShowDetail) const
123 {
124  debugStream << IDAsString() << "(" << ::AJAAncDataCodingToString (m_coding) << ")" << endl;
125  return AJAAncillaryData::Print (debugStream, bShowDetail);
126 }
AJAAncillaryData_Cea708()
My default constructor.
CEA708 (SMPTE 334) HD Closed Captioning.
Definition: ancillarydata.h:50
virtual uint8_t GetDID(void) const
#define AJA_SUCCESS(_status_)
Definition: types.h:372
AJAAncillaryData & operator=(const AJAAncillaryData &inRHS)
virtual uint8_t GetSID(void) const
AJAStatus
Definition: types.h:380
Ancillary data found between SAV and EAV (.
Declares the AJADebug class.
AJAAncDataType m_ancType
One of a known set of ancillary data types (or "Custom" if not identified)
AJAAncDataType
Identifies the ancillary data types that are known to this module.
Definition: ancillarydata.h:44
const uint8_t AJAAncillaryData_CEA708_SID
virtual void Clear(void)
Frees my allocated memory, if any, and resets my members to their default values. ...
Definition: json.hpp:5362
const uint8_t AJAAncillaryData_CEA708_DID
virtual void Clear(void)
Frees my allocated memory, if any, and resets my members to their default values. ...
uint8_t m_checksum
My 8-bit checksum: DID + SID + DC + payload (w/o parity) [note: NOT the same as the 9-bit checksum in...
AJAAncDataCoding m_coding
Analog or digital data.
#define LOGMYWARN(__x__)
virtual std::ostream & Print(std::ostream &inOutStream, const bool inDetailed=false) const
Streams a human-readable representation of me to the given output stream.
Includes data that is valid, but we don&#39;t recognize.
Definition: ancillarydata.h:46
The ancillary data is associated with the chrominance (C) channel of the video stream.
virtual bool IsEmpty(void) const
virtual uint8_t Calculate8BitChecksum(void) const
Generates an 8-bit checksum from the DID + SID + DC + payload data.
This class handles CEA-708 SMPTE 334 packets.
virtual std::ostream & Print(std::ostream &inOutStream, const bool inDetailed=false) const
Streams a human-readable representation of me to the given output stream.
#define NULL_PTR
Definition: types.h:327
virtual AJAStatus ParsePayloadData(void)
Parses out (interprets) the "local" ancillary data from my payload data.
uint8_t m_SID
Official SMPTE secondary ID (or DBN - w/o parity)
virtual AJAAncillaryData_Cea708 & operator=(const AJAAncillaryData_Cea708 &inRHS)
Assignment operator – replaces my contents with the right-hand-side value.
#define IS_VALID_AJAAncDataChannel(_x_)
uint8_t m_DID
Official SMPTE ancillary packet ID (w/o parity)
const std::string & AJAAncDataCodingToString(const AJAAncDataCoding inValue, const bool inCompact=true)
virtual AJAStatus GeneratePayloadData(void)
Generate the payload data from the "local" ancillary data.
virtual std::string IDAsString(void) const
I am the principal class that stores a single SMPTE-291 SDI ancillary data packet OR the digitized co...
bool m_rcvDataValid
This is set true (or not) by ParsePayloadData()
virtual AJAAncDataChannel GetLocationDataChannel(void) const
virtual ~AJAAncillaryData_Cea708()
My destructor.
Declares the AJAAncillaryData_Cea708 class.
static AJAAncDataType RecognizeThisAncillaryData(const AJAAncillaryData *pInAncData)
virtual AJAAncDataSpace GetLocationVideoSpace(void) const