libklvanc
 All Classes Files Functions Variables Enumerations Macros
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];
89 };
90 
91 #define KLVANC_MAX_CCSVC_COUNT 16
93 {
94  uint8_t ccsvcinfo_id;
95  uint8_t svc_info_start;
96  uint8_t svc_info_change;
97  uint8_t svc_info_complete;
98  uint8_t svc_count;
99  struct klvanc_packet_eia_708b_ccsvcinfo_entry svc[KLVANC_MAX_CCSVC_COUNT];
100 };
101 
103 {
104  uint8_t cdp_footer_id;
105  uint16_t cdp_ftr_sequence_cntr;
106  uint8_t packet_checksum;
107 };
108 
113 {
114  struct klvanc_packet_header_s hdr;
115  uint8_t payload[256];
116  unsigned int payloadLengthBytes;
117  int checksum_valid;
118  struct klvanc_packet_eia_708b_cdp_header header;
122  struct klvanc_packet_eia_708b_cdp_footer footer;
123 };
124 
131 int klvanc_dump_EIA_708B(struct klvanc_context_s *ctx, void *p);
132 
140 
146 
155 int klvanc_set_framerate_EIA_708B(struct klvanc_packet_eia_708b_s *pkt, int num, int den);
156 
162 void klvanc_finalize_EIA_708B(struct klvanc_packet_eia_708b_s *pkt, uint16_t seqNum);
163 
175 int klvanc_convert_EIA_708B_to_words(struct klvanc_packet_eia_708b_s *pkt, uint16_t **words, uint16_t *wordCount);
176 
188 int klvanc_convert_EIA_708B_to_packetBytes(struct klvanc_packet_eia_708b_s *pkt, uint8_t **bytes, uint16_t *byteCount);
189 
190 
191 #ifdef __cplusplus
192 };
193 #endif
194 
195 #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:92
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:112