AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
ntv2caption708serviceinfo.h
Go to the documentation of this file.
1 
7 #ifndef __NTV2_CEA708_SERVICEINFO_
8 #define __NTV2_CEA708_SERVICEINFO_
9 
10 #include "ntv2captionlogging.h"
11 #ifdef MSWindows
12  #include "windows.h"
13  #include "stdio.h"
14 #endif
15 
16 
17 // CEA-708 Services
18 const int NTV2_CC708PrimaryCaptionServiceNum = 1; // service number for standard caption service
19 
20 const int NTV2_CC708MaxCDPServices = 15; // the max number of services that can be updated in a single CDP (by CEA-708 law)
21 const int NTV2_CC708MaxNumServices = 64; // the max number of services that can be addressed
22 
23 
25 {
26  char langID[3]; // caption language (e.g. 'ENG')
27 
28  explicit NTV2_CC708ServiceLanguage (const char inChar1 = 'e', const char inChar2 = 'n', const char inChar3 = 'g');
29  bool IsEqual (const NTV2_CC708ServiceLanguage & inServiceLanguage) const;
30  std::ostream & Print (std::ostream & inOutStream) const;
31 
33 
34 inline std::ostream & operator << (std::ostream & inOutStream, const NTV2_CC708ServiceLanguage & inLanguage) {return inLanguage.Print (inOutStream);}
35 
36 
37 // common language codes (see ISO 639.2: www.loc.gov/standards/iso639-2/php/English_list.php
41 
42 
43 // CEA-708B CDP Service Info flags (see CEA-708B, pp 76)
44 // NOTE: these bit positions are NOT the same as the svc_info_start/change/complete bits in the CDP Header!
45 enum
46 {
50 };
51 
52 // CEA-708B CDP Service Info flags (see ATSC A/65C, pg 71)
53 enum
54 {
56  NTV2_CC708CDPSvcInfo_Line21Field = (1 << 0) // note: obsolete
57 };
58 
59 // CEA-708B CDP Service Info flags (see ATSC A/65C, pg 71)
60 enum
61 {
64 };
65 
66 
67 typedef struct NTV2_CC708ServiceInfo
68 {
69  bool bSvcActive;
71 
72  // From caption service descriptor: ATSC A/65 pg 71...
74  bool digitalCC;
76  bool easyReader;
77  bool wideAspect;
78 
79  explicit inline NTV2_CC708ServiceInfo () {Zero();}
80  void Zero (void);
81  bool IsEqual (const NTV2_CC708ServiceInfo & inCompareInfo) const;
82  std::ostream & Print (std::ostream & inOutStream) const;
83 
85 
86 
87 inline std::ostream & operator << (std::ostream & inOutStream, const NTV2_CC708ServiceInfo & inInfo) {return inInfo.Print (inOutStream);}
88 
89 
90 typedef struct NTV2_CC708ServiceData
91 {
92  bool bChange;
94 
95  std::ostream & Print (std::ostream & inOutStream) const;
96 
98 
99 
100 inline std::ostream & operator << (std::ostream & inOutStream, const NTV2_CC708ServiceData & inData) {return inData.Print (inOutStream);}
101 
102 
116 {
117  // INSTANCE METHODS
118  public:
120  virtual ~CNTV2Caption708ServiceInfo ();
121 
122  virtual bool InitAllServiceInfo (void);
123  virtual bool InitCCServiceInfo (const int inServiceIndex);
124 
125  virtual bool CopyAllServiceInfo (const NTV2_CC708ServiceData & inSrcSvcInfo);
126  virtual inline const NTV2_CC708ServiceData & GetAllServiceInfoPtr (void) const {return m_serviceData;}
127  virtual bool CompareAllServiceInfo (const NTV2_CC708ServiceData & inSrcSvcData) const;
128 
129  virtual bool CopyOneServiceInfo (const int inServiceIndex, const NTV2_CC708ServiceInfo & inSrcSvcInfo);
130  virtual const NTV2_CC708ServiceInfo & GetOneServiceInfoPtr (const int inServiceIndex) const;
131  virtual bool CompareOneServiceInfo (const int inServiceIndex, const NTV2_CC708ServiceInfo & inSrcSvcInfo) const;
132 
133  virtual int NumActiveCDPServiceInfo (const int startIndex = 0);
134  virtual bool ResetStartIndex (void);
135 
136  virtual inline int GetStartIndex (void) const {return m_startIndex;}
137 
138  virtual int AdvanceToNextStartIndex (const bool bIncludeCurrentIndex);
139 
140  virtual bool SetServiceInfoActive (const int inServiceIndex, const bool inIsActive);
141 
142  virtual inline bool GetServiceInfoActive (const int inServiceIndex) const
143  {
144  return (inServiceIndex >= 0 && inServiceIndex < NTV2_CC708MaxNumServices) ? m_serviceData.serviceInfo [inServiceIndex].bSvcActive : false;
145  }
146 
147  virtual inline int GetCaptionServiceNumber (const int inServiceIndex) const
148  {
149  return (inServiceIndex >= 0 && inServiceIndex < NTV2_CC708MaxNumServices) ? m_serviceData.serviceInfo [inServiceIndex].captionSvcNumber : 0;
150  }
151 
152  virtual bool SetServiceInfoLanguage (const int inServiceIndex, const NTV2_CC708ServiceLanguage & inNewLang);
153 
154  virtual bool GetServiceInfoLanguage (const int inServiceIndex, NTV2_CC708ServiceLanguage & outNewLang) const;
155 
156  virtual bool SetServiceInfoEasyReader (const int inServiceIndex, const bool inIsEasyReader);
157 
158  virtual inline bool GetServiceInfoEasyReader (const int inServiceIndex)
159  {
160  return (inServiceIndex >= 0 && inServiceIndex < NTV2_CC708MaxNumServices) ? m_serviceData.serviceInfo [inServiceIndex].easyReader : false;
161  }
162 
163  virtual bool SetServiceInfoWideAspect (const int inServiceIndex, const bool inIsWideAspect);
164 
165  virtual inline bool GetServiceInfoWideAspect (const int inServiceIndex) const
166  {
167  return (inServiceIndex >= 0 && inServiceIndex < NTV2_CC708MaxNumServices) ? m_serviceData.serviceInfo [inServiceIndex].wideAspect : false;
168  }
169 
170  virtual bool SetServiceInfoDigitalCC (const int inServiceIndex, const bool inIsDigitalCC);
171 
172  virtual inline bool GetServiceInfoDigitalCC (const int inServiceIndex) const
173  {
174  return (inServiceIndex >= 0 && inServiceIndex < NTV2_CC708MaxNumServices) ? m_serviceData.serviceInfo [inServiceIndex].digitalCC : false;
175  }
176 
177  virtual bool SetServiceInfoChangeFlag (const bool inChangeFlag);
178 
179  virtual inline bool GetServiceInfoChangeFlag (void) const
180  {
181  return m_serviceData.bChange;
182  }
183 
184  // Debug
185  virtual std::ostream & Print (std::ostream & inOutStream) const;
186 
187 
188  // INSTANCE DATA
189  private:
190  int m_startIndex;
191  NTV2_CC708ServiceData m_serviceData;
192 
193 }; // CNTV2Caption708ServiceInfo
194 
195 
196 std::ostream & operator << (std::ostream & inOutStream, const CNTV2Caption708ServiceInfo & inInfo);
197 
198 
199 #endif // __NTV2_CEA708_SERVICEINFO_
NTV2_CC708ServiceInfo::easyReader
bool easyReader
Definition: ntv2caption708serviceinfo.h:76
NTV2_CC708ServiceLanguage::Print
std::ostream & Print(std::ostream &inOutStream) const
CNTV2Caption708ServiceInfo::GetServiceInfoEasyReader
virtual bool GetServiceInfoEasyReader(const int inServiceIndex)
Definition: ntv2caption708serviceinfo.h:158
NTV2_CC708ServiceInfo
struct NTV2_CC708ServiceInfo NTV2_CC708ServiceInfo
NTV2_CC708ServiceInfo::bSvcActive
bool bSvcActive
True if service is active and should be included in ccsvcinfo_section.
Definition: ntv2caption708serviceinfo.h:69
NTV2_CC708MaxNumServices
const int NTV2_CC708MaxNumServices
Definition: ntv2caption708serviceinfo.h:21
NTV2_CC708ServiceData
struct NTV2_CC708ServiceData NTV2_CC708ServiceData
NTV2_CC708CDPSvcInfo_SvcInfoComplete
@ NTV2_CC708CDPSvcInfo_SvcInfoComplete
Definition: ntv2caption708serviceinfo.h:49
CNTV2Caption708ServiceInfo::GetServiceInfoWideAspect
virtual bool GetServiceInfoWideAspect(const int inServiceIndex) const
Definition: ntv2caption708serviceinfo.h:165
NTV2_CC708CDPSvcInfo_Line21Field
@ NTV2_CC708CDPSvcInfo_Line21Field
Definition: ntv2caption708serviceinfo.h:56
NTV2_CC708CDPSvcInfo_EasyReader
@ NTV2_CC708CDPSvcInfo_EasyReader
Definition: ntv2caption708serviceinfo.h:62
NTV2_CC708SvcLang_Spanish
const NTV2_CC708ServiceLanguage NTV2_CC708SvcLang_Spanish(NTV2_CC708ServiceLanguage('s', 'p', 'a'))
NTV2_CC708ServiceInfo::captionSvcNumber
int captionSvcNumber
Service number (Line 21 data = 0; 708 data = 1 - 16)
Definition: ntv2caption708serviceinfo.h:70
NTV2_CC708CDPSvcInfo_DigitalCC
@ NTV2_CC708CDPSvcInfo_DigitalCC
Definition: ntv2caption708serviceinfo.h:55
CNTV2Caption708ServiceInfo
I am a container for all of the CEA-708 "Service Information" that a decoder or encoder needs to keep...
Definition: ntv2caption708serviceinfo.h:115
NTV2_CC708SvcLang_English
const NTV2_CC708ServiceLanguage NTV2_CC708SvcLang_English(NTV2_CC708ServiceLanguage('e', 'n', 'g'))
NTV2_CC708ServiceInfo::digitalCC
bool digitalCC
True if 708 captions, false if Line 21 (608)
Definition: ntv2caption708serviceinfo.h:74
NTV2_CC708ServiceLanguage
Definition: ntv2caption708serviceinfo.h:24
CNTV2Caption708ServiceInfo::GetServiceInfoChangeFlag
virtual bool GetServiceInfoChangeFlag(void) const
Definition: ntv2caption708serviceinfo.h:179
NTV2_CC708ServiceInfo::wideAspect
bool wideAspect
Definition: ntv2caption708serviceinfo.h:77
CNTV2Caption708ServiceInfo::GetStartIndex
virtual int GetStartIndex(void) const
Definition: ntv2caption708serviceinfo.h:136
NTV2_CC708ServiceInfo::Print
std::ostream & Print(std::ostream &inOutStream) const
NTV2_CC708ServiceInfo::NTV2_CC708ServiceInfo
NTV2_CC708ServiceInfo()
Definition: ntv2caption708serviceinfo.h:79
CNTV2Caption708ServiceInfo::GetCaptionServiceNumber
virtual int GetCaptionServiceNumber(const int inServiceIndex) const
Definition: ntv2caption708serviceinfo.h:147
NTV2_CC708ServiceData::Print
std::ostream & Print(std::ostream &inOutStream) const
CNTV2Caption708ServiceInfo::GetServiceInfoDigitalCC
virtual bool GetServiceInfoDigitalCC(const int inServiceIndex) const
Definition: ntv2caption708serviceinfo.h:172
NTV2_CC708CDPSvcInfo_SvcInfoStart
@ NTV2_CC708CDPSvcInfo_SvcInfoStart
Definition: ntv2caption708serviceinfo.h:47
NTV2_CC708ServiceInfo::IsEqual
bool IsEqual(const NTV2_CC708ServiceInfo &inCompareInfo) const
NTV2_CC708ServiceInfo::csn_line21field
UByte csn_line21field
The remainder of that byte.
Definition: ntv2caption708serviceinfo.h:75
NTV2_CC708ServiceData::bChange
bool bChange
Definition: ntv2caption708serviceinfo.h:92
NTV2_CC708CDPSvcInfo_SvcInfoChange
@ NTV2_CC708CDPSvcInfo_SvcInfoChange
Definition: ntv2caption708serviceinfo.h:48
NTV2_CC708ServiceData::serviceInfo
NTV2_CC708ServiceInfo serviceInfo[NTV2_CC708MaxNumServices]
Definition: ntv2caption708serviceinfo.h:93
NTV2_CC708ServiceData
Definition: ntv2caption708serviceinfo.h:90
NTV2_CC708ServiceLanguage
struct NTV2_CC708ServiceLanguage NTV2_CC708ServiceLanguage
NTV2_CC708CDPSvcInfo_WideAspectRatio
@ NTV2_CC708CDPSvcInfo_WideAspectRatio
Definition: ntv2caption708serviceinfo.h:63
NTV2_CC708MaxCDPServices
const int NTV2_CC708MaxCDPServices
Definition: ntv2caption708serviceinfo.h:20
NTV2_CC708ServiceInfo::Zero
void Zero(void)
UByte
uint8_t UByte
Definition: ajatypes.h:241
CNTV2Caption708ServiceInfo::GetAllServiceInfoPtr
virtual const NTV2_CC708ServiceData & GetAllServiceInfoPtr(void) const
Definition: ntv2caption708serviceinfo.h:126
NTV2_CC708SvcLang_French
const NTV2_CC708ServiceLanguage NTV2_CC708SvcLang_French(NTV2_CC708ServiceLanguage('f', 'r', 'e'))
AJAExport
#define AJAExport
Definition: export.h:33
NTV2_CC708ServiceInfo::language
NTV2_CC708ServiceLanguage language
Caption language (e.g. 'ENG')
Definition: ntv2caption708serviceinfo.h:73
NTV2_CC708PrimaryCaptionServiceNum
const int NTV2_CC708PrimaryCaptionServiceNum
Definition: ntv2caption708serviceinfo.h:18
CNTV2Caption708ServiceInfo::GetServiceInfoActive
virtual bool GetServiceInfoActive(const int inServiceIndex) const
Definition: ntv2caption708serviceinfo.h:142
CNTV2CaptionLogConfig
Definition: ntv2captionlogging.h:77
operator<<
std::ostream & operator<<(std::ostream &inOutStream, const NTV2_CC708ServiceLanguage &inLanguage)
Definition: ntv2caption708serviceinfo.h:34
ntv2captionlogging.h
Declares the NTV2CaptionLogMask, and the CNTV2CaptionLogConfig class.
NTV2_CC708ServiceInfo
Definition: ntv2caption708serviceinfo.h:67