libklvanc
 All Classes Files Functions Variables Enumerations Macros
Classes | Macros | Functions
vanc.h File Reference

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...

#include <stdint.h>
#include <stdarg.h>
#include <sys/errno.h>
#include <libklvanc/klrestricted_code_path.h>
#include <libklvanc/vanc-afd.h>
#include <libklvanc/vanc-eia_708b.h>
#include <libklvanc/vanc-eia_608.h>
#include <libklvanc/vanc-scte_104.h>
#include <libklvanc/vanc-smpte_12_2.h>
#include <libklvanc/did.h>
#include <libklvanc/pixels.h>
#include <libklvanc/vanc-checksum.h>
#include <libklvanc/smpte2038.h>
#include <libklvanc/cache.h>
#include <libklvanc/vanc-kl_u64le_counter.h>
#include <libklvanc/vanc-sdp.h>

Go to the source code of this file.

Classes

struct  klvanc_callbacks_s
 TODO - Brief description goes here. More...
 
struct  klvanc_context_s
 Application specific context, the library allocates and stores user specific instance information. More...
 

Macros

#define LIBKLVANC_LOGLEVEL_ERR   0
 
#define LIBKLVANC_LOGLEVEL_WARN   1
 
#define LIBKLVANC_LOGLEVEL_INFO   2
 
#define LIBKLVANC_LOGLEVEL_DEBUG   3
 

Functions

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, 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)
 TODO - Brief description goes here. More...
 
void klvanc_packet_free (struct klvanc_packet_header_s *src)
 TODO - Brief description goes here. More...
 

Detailed Description

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

Function Documentation

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.

Parameters
[out]structklvanc_context_s **ctx - Context.
Returns
0 - Success
< 0 - Error
int klvanc_context_destroy ( struct klvanc_context_s ctx)

Deallocate and destroy a context. See klvanc_context_create()

Parameters
[in]structklvanc_context_s *ctx - Context.
Returns
0 - Success
< 0 - Error
int klvanc_context_dump ( struct klvanc_context_s ctx)

Generate user visible context details to the console.

Parameters
[in]structklvanc_context_s *ctx - Context.
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]intlen - Number of words in array.
[in]unsignedint linenr - SDI line number the array data came from. Used for information / tracking purposes only.
[in]intonlyvalid - Brief description goes here.
const char* klvanc_lookupDescriptionByType ( enum klvanc_packet_type_e  type)

TODO - Brief description goes here.

Parameters
[in]enumpacket_type_e type
Returns
TODO.
const char* klvanc_lookupSpecificationByType ( enum klvanc_packet_type_e  type)

TODO - Brief description goes here.

Parameters
[in]enumpacket_type_e type
Returns
TODO.
int klvanc_packet_copy ( struct klvanc_packet_header_s **  dst,
struct klvanc_packet_header_s src 
)

TODO - Brief description goes here.

Parameters
[in]structpacket_header_s **dst
[in]structpacket_header_s *src
Returns
TODO.
void klvanc_packet_free ( struct klvanc_packet_header_s src)

TODO - Brief description goes here.

Parameters
[in]structpacket_header_s *src
int klvanc_packet_parse ( struct klvanc_context_s ctx,
unsigned int  lineNr,
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]structklvanc_context_s *ctx - Context.
[in]unsignedint lineNr - SDI line number the array data came from. Used for information / tracking purposes only.
[in]unsignedshort *words - Array of SDI words (10bit) that the caller wants parsed.
[in]unsignedint wordCount - Number of words in array.
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_tsdid, uint8_t did - Brief description goes here.
[in]constuint8_t *src - Brief description goes here.
[in]uint16_tsrcByteCount - Brief description goes here.
[in]uint16_t**dst - Brief description goes here.
[in]uint16_t*dstWordCount - Brief description goes here.
[in]uint32_tbitDepth - Brief description goes here.
Returns
0 - Success
< 0 - Error