Parse VANC lines, interpret data, call user callbacks with populated structures.
Callers allocate a usage context, assign callbacks to this context and then feed
VANC data into the library. VANC messages that are understood are parse, converted
into structs and if the user has registered a callback for that specific message type
then the structure is passed via the callback.
Callbacks should not attempt to modify or release the callback structs, releasing of
memory allocats is automatically taken care of by this library.
More...
Go to the source code of this file.
|
#define | LIBKLVANC_SCTE104_MAX_FRAGMENTS (10) |
|
#define | LIBKLVANC_LOGLEVEL_ERR 0 |
|
#define | LIBKLVANC_LOGLEVEL_WARN 1 |
|
#define | LIBKLVANC_LOGLEVEL_INFO 2 |
|
#define | LIBKLVANC_LOGLEVEL_DEBUG 3 |
|
|
int | klvanc_context_create (struct klvanc_context_s **ctx) |
| Create or destroy some basic application/library context.
The context is considered private and is likely to change. More...
|
|
int | klvanc_context_destroy (struct klvanc_context_s *ctx) |
| Deallocate and destroy a context. See klvanc_context_create() More...
|
|
int | klvanc_context_dump (struct klvanc_context_s *ctx) |
| Generate user visible context details to the console. More...
|
|
int | klvanc_packet_parse (struct klvanc_context_s *ctx, unsigned int lineNr, const unsigned short *words, unsigned int wordCount) |
| Parse a line of payload, trigger callbacks as necessary. lineNr is passed around and only
used for reporting purposes, so we can figure out which line this came from in different
callbacks and various parts of the reporting stack. More...
|
|
void | klvanc_dump_words_console (struct klvanc_context_s *ctx, uint16_t *vanc, int maxlen, unsigned int linenr, int onlyvalid) |
| TODO - Brief description goes here. More...
|
|
int | klvanc_sdi_create_payload (uint8_t sdid, uint8_t did, const uint8_t *src, uint16_t srcByteCount, uint16_t **dst, uint16_t *dstWordCount, uint32_t bitDepth) |
| Take an array of payload, create a fully formed VANC message. bitDepth of 10 is the only valid input value. did: 0x41, sdid: 0x07 = SCTE104 generateParity = 1/0. More...
|
|
const char * | klvanc_lookupDescriptionByType (enum klvanc_packet_type_e type) |
| TODO - Brief description goes here. More...
|
|
const char * | klvanc_lookupSpecificationByType (enum klvanc_packet_type_e type) |
| TODO - Brief description goes here. More...
|
|
int | klvanc_packet_copy (struct klvanc_packet_header_s **dst, struct klvanc_packet_header_s *src) |
| Create a copy of a packet header. More...
|
|
int | klvanc_packet_save (const char *dir, const struct klvanc_packet_header_s *pkt, int lineNr, int did) |
| Write the packet to disk, in a debug friendly format that can be used by other offline tools. The output filename is library generated while the directory prefix may be user specified. The output filename is: uniqueid–klvanc-packet–line-%04d–did-%02x–sdid-%02x–name-s.bin %08d–klvanc-packet–line-%04d–did-%02x–sdid-%02x–name-s.bin The contents of the file are the original caller supplied 16bit raw payload words which includes original parity, checksum, payload. More...
|
|
void | klvanc_packet_free (struct klvanc_packet_header_s *src) |
| TODO - Brief description goes here. More...
|
|
int | klvanc_packet_payload_append (struct klvanc_packet_header_s *dst, struct klvanc_packet_header_s *src, int srcOffset) |
| Append the payload words from srd to dst. Start copying from srcOffset position. More...
|
|
Parse VANC lines, interpret data, call user callbacks with populated structures.
Callers allocate a usage context, assign callbacks to this context and then feed
VANC data into the library. VANC messages that are understood are parse, converted
into structs and if the user has registered a callback for that specific message type
then the structure is passed via the callback.
Callbacks should not attempt to modify or release the callback structs, releasing of
memory allocats is automatically taken care of by this library.
- Author
- Steven Toth stoth.nosp@m.@ker.nosp@m.nella.nosp@m.bs.c.nosp@m.om
- Copyright
- Copyright (c) 2016 Kernel Labs Inc. All Rights Reserved.
Create or destroy some basic application/library context.
The context is considered private and is likely to change.
- Parameters
-
- Returns
- 0 - Success
-
< 0 - Error
Generate user visible context details to the console.
- Parameters
-
- Returns
- 0 - Success
-
< 0 - Error
void klvanc_dump_words_console |
( |
struct klvanc_context_s * |
ctx, |
|
|
uint16_t * |
vanc, |
|
|
int |
maxlen, |
|
|
unsigned int |
linenr, |
|
|
int |
onlyvalid |
|
) |
| |
TODO - Brief description goes here.
- Parameters
-
[in] | uint16_t | *array - Array of SDI words (10bit) that the caller wants parsed. |
[in] | int | len - Number of words in array. |
[in] | unsigned | int linenr - SDI line number the array data came from. Used for information / tracking purposes only. |
[in] | int | onlyvalid - Brief description goes here. |
TODO - Brief description goes here.
- Parameters
-
[in] | enum | packet_type_e type |
- Returns
- TODO.
TODO - Brief description goes here.
- Parameters
-
[in] | enum | packet_type_e type |
- Returns
- TODO.
Create a copy of a packet header.
- Parameters
-
[in] | struct | packet_header_s **dst |
[in] | struct | packet_header_s *src |
- Returns
- 0 - Success
-
< 0 - Error
TODO - Brief description goes here.
- Parameters
-
[in] | struct | packet_header_s *src |
int klvanc_packet_parse |
( |
struct klvanc_context_s * |
ctx, |
|
|
unsigned int |
lineNr, |
|
|
const unsigned short * |
words, |
|
|
unsigned int |
wordCount |
|
) |
| |
Parse a line of payload, trigger callbacks as necessary. lineNr is passed around and only
used for reporting purposes, so we can figure out which line this came from in different
callbacks and various parts of the reporting stack.
- Parameters
-
[in] | struct | klvanc_context_s *ctx - Context. |
[in] | unsigned | int lineNr - SDI line number the array data came from. Used for information / tracking purposes only. |
[in] | unsigned | short *words - Array of SDI words (10bit) that the caller wants parsed. |
[in] | unsigned | int wordCount - Number of words in array. |
- Returns
- The number of VANC frames found and parsing was attempted.
-
< 0 - Error
Append the payload words from srd to dst. Start copying from srcOffset position.
- Returns
- 0 on success, else < 0.
Write the packet to disk, in a debug friendly format that can be used by other offline tools. The output filename is library generated while the directory prefix may be user specified. The output filename is: uniqueid–klvanc-packet–line-%04d–did-%02x–sdid-%02x–name-s.bin %08d–klvanc-packet–line-%04d–did-%02x–sdid-%02x–name-s.bin The contents of the file are the original caller supplied 16bit raw payload words which includes original parity, checksum, payload.
- Parameters
-
[in] | const | char *dir |
[in] | const | struct packet_header_s *pkt |
[in] | int | lineNr - Only save pkt if the line number matches this filter, caller should pass -1 if all packets are to be saved. |
[in] | int | did - Only save pkt if the did number in the packet matches this filter, caller should pass -1 if all packets are to be saved. |
- Returns
- 0 - Success
-
< 0 - Error
int klvanc_sdi_create_payload |
( |
uint8_t |
sdid, |
|
|
uint8_t |
did, |
|
|
const uint8_t * |
src, |
|
|
uint16_t |
srcByteCount, |
|
|
uint16_t ** |
dst, |
|
|
uint16_t * |
dstWordCount, |
|
|
uint32_t |
bitDepth |
|
) |
| |
Take an array of payload, create a fully formed VANC message. bitDepth of 10 is the only valid input value. did: 0x41, sdid: 0x07 = SCTE104 generateParity = 1/0.
- Parameters
-
[in] | uint8_t | sdid, uint8_t did - Brief description goes here. |
[in] | const | uint8_t *src - Brief description goes here. |
[in] | uint16_t | srcByteCount - Brief description goes here. |
[in] | uint16_t | **dst - Brief description goes here. |
[in] | uint16_t | *dstWordCount - Brief description goes here. |
[in] | uint32_t | bitDepth - Brief description goes here. |
- Returns
- 0 - Success
-
< 0 - Error