libklvanc
vanc-eia_708b.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Kernel Labs Inc. All Rights Reserved
3  *
4  * Address: Kernel Labs Inc., PO Box 745, St James, NY. 11780
5  * Contact: sales@kernellabs.com
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
29 #ifndef _VANC_EIA_708B_H
30 #define _VANC_EIA_708B_H
31 
32 #include <libklvanc/vanc-packets.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 
40 {
41  uint16_t cdp_identifier;
42  uint8_t cdp_length;
43  uint8_t cdp_frame_rate;
44  uint8_t time_code_present;
45  uint8_t ccdata_present;
46  uint8_t svcinfo_present;
47  uint8_t svc_info_start;
48  uint8_t svc_info_change;
49  uint8_t svc_info_complete;
50  uint8_t caption_service_active;
51  uint16_t cdp_hdr_sequence_cntr;;
52 };
53 
55 {
56  uint8_t time_code_section_id;
57  uint8_t tc_10hrs;
58  uint8_t tc_1hrs;
59  uint8_t tc_10min;
60  uint8_t tc_1min;
61  uint8_t tc_field_flag;
62  uint8_t tc_10sec;
63  uint8_t tc_1sec;
64  uint8_t drop_frame_flag;
65  uint8_t tc_10fr;
66  uint8_t tc_1fr;
67 };
68 
70 {
71  uint8_t cc_valid;
72  uint8_t cc_type;
73  uint8_t cc_data[2];
74 };
75 
76 #define KLVANC_MAX_CC_COUNT 30
78 {
79  uint8_t ccdata_id;
80  uint8_t cc_count;
81  struct klvanc_packet_eia_708b_ccdata_entry cc[KLVANC_MAX_CC_COUNT];
82 };
83 
84 
86 {
87  uint8_t caption_service_number;
88  uint8_t svc_data_byte[6]; /* Raw bytes */
89  /* Decoding of svc_data_bytes defined in ATSC A/65 Sec 6.9.2 */
90  uint8_t language[4]; /* includes NULL termination for easy printing */
91  uint8_t digital_cc;
92  uint8_t csn;
93  uint8_t line21_field;
94  uint8_t easy_reader;
95  uint8_t wide_aspect_ratio;
96 
97 };
98 
99 #define KLVANC_MAX_CCSVC_COUNT 16
101 {
102  uint8_t ccsvcinfo_id;
103  uint8_t svc_info_start;
104  uint8_t svc_info_change;
105  uint8_t svc_info_complete;
106  uint8_t svc_count;
107  struct klvanc_packet_eia_708b_ccsvcinfo_entry svc[KLVANC_MAX_CCSVC_COUNT];
108 };
109 
111 {
112  uint8_t cdp_footer_id;
113  uint16_t cdp_ftr_sequence_cntr;
114  uint8_t packet_checksum;
115 };
116 
121 {
122  struct klvanc_packet_header_s hdr;
123  uint8_t payload[256];
124  unsigned int payloadLengthBytes;
125  int checksum_valid;
126  struct klvanc_packet_eia_708b_cdp_header header;
130  struct klvanc_packet_eia_708b_cdp_footer footer;
131 };
132 
139 int klvanc_dump_EIA_708B(struct klvanc_context_s *ctx, void *p);
140 
148 
154 
163 int klvanc_set_framerate_EIA_708B(struct klvanc_packet_eia_708b_s *pkt, int num, int den);
164 
170 void klvanc_finalize_EIA_708B(struct klvanc_packet_eia_708b_s *pkt, uint16_t seqNum);
171 
183 int klvanc_convert_EIA_708B_to_words(struct klvanc_packet_eia_708b_s *pkt, uint16_t **words, uint16_t *wordCount);
184 
196 int klvanc_convert_EIA_708B_to_packetBytes(struct klvanc_packet_eia_708b_s *pkt, uint8_t **bytes, uint16_t *byteCount);
197 
198 
199 #ifdef __cplusplus
200 };
201 #endif
202 
203 #endif /* _VANC_EIA_708B_H */
int klvanc_dump_EIA_708B(struct klvanc_context_s *ctx, void *p)
TODO - Brief description goes here.
Definition: vanc-eia_708b.h:54
TODO - Brief description goes here.
Definition: vanc-packets.h:57
Definition: vanc-eia_708b.h:69
Definition: vanc-eia_708b.h:85
Definition: vanc-eia_708b.h:100
void klvanc_destroy_eia708_cdp(struct klvanc_packet_eia_708b_s *pkt)
Destroy an EIA-708 VANC packet.
int klvanc_create_eia708_cdp(struct klvanc_packet_eia_708b_s **pkt)
Create an EIA-708 VANC packet.
void klvanc_finalize_EIA_708B(struct klvanc_packet_eia_708b_s *pkt, uint16_t seqNum)
Finalize a packet and prepare to serialize to output.
Application specific context, the library allocates and stores user specific instance information...
Definition: vanc.h:118
int klvanc_convert_EIA_708B_to_packetBytes(struct klvanc_packet_eia_708b_s *pkt, uint8_t **bytes, uint16_t *byteCount)
Convert type struct klvanc_packet_eia_708b_s into a block of bytes which represents an EIA-708 packe...
Definition: vanc-eia_708b.h:77
int klvanc_convert_EIA_708B_to_words(struct klvanc_packet_eia_708b_s *pkt, uint16_t **words, uint16_t *wordCount)
Convert type struct klvanc_packet_eia_708b_s into a more traditional line of vanc words...
int klvanc_set_framerate_EIA_708B(struct klvanc_packet_eia_708b_s *pkt, int num, int den)
Set the framerate on an EIA-708 packet.
Definition: vanc-eia_708b.h:39
VANC Headers and packet structure.
TODO - Brief description goes here.
Definition: vanc-eia_708b.h:120