ZVBI Library
0.2.33
|
Separating XDS data from a Closed Caption stream (EIA 608). More...
Data Structures | |
struct | vbi_xds_packet |
XDS Packet. A pointer to this structure is passed to the XDS demux callback. More... |
Macros | |
#define | VBI_XDS_MAX_CLASSES (VBI_XDS_CLASS_UNDEFINED + 1) |
#define | VBI_XDS_MAX_SUBCLASSES (0x18) |
Typedefs | |
typedef unsigned int | vbi_xds_subclass |
Generic XDS subclass. You must cast to the appropriate subclass type depending on the XDS class. | |
typedef struct _vbi_xds_demux | vbi_xds_demux |
XDS demultiplexer. | |
typedef vbi_bool | vbi_xds_demux_cb (vbi_xds_demux *xd, const vbi_xds_packet *xp, void *user_data) |
Enumerations | |
enum | vbi_xds_class { VBI_XDS_CLASS_CURRENT = 0x00, VBI_XDS_CLASS_FUTURE, VBI_XDS_CLASS_CHANNEL, VBI_XDS_CLASS_MISC, VBI_XDS_CLASS_PUBLIC_SERVICE, VBI_XDS_CLASS_RESERVED, VBI_XDS_CLASS_UNDEFINED } |
XDS packet class. XDS data is transmitted in packets. Each packet belongs to one of seven classes. | |
enum | vbi_xds_subclass_program { VBI_XDS_PROGRAM_ID = 0x01, VBI_XDS_PROGRAM_LENGTH, VBI_XDS_PROGRAM_NAME, VBI_XDS_PROGRAM_TYPE, VBI_XDS_PROGRAM_RATING, VBI_XDS_PROGRAM_AUDIO_SERVICES, VBI_XDS_PROGRAM_CAPTION_SERVICES, VBI_XDS_PROGRAM_CGMS, VBI_XDS_PROGRAM_ASPECT_RATIO, VBI_XDS_PROGRAM_DATA = 0x0C, VBI_XDS_PROGRAM_MISC_DATA, VBI_XDS_PROGRAM_DESCRIPTION_BEGIN = 0x10, VBI_XDS_PROGRAM_DESCRIPTION_END = 0x18 } |
VBI_XDS_CLASS_CURRENT and VBI_XDS_CLASS_FUTURE subclass. More... | |
enum | vbi_xds_subclass_channel { VBI_XDS_CHANNEL_NAME = 0x01, VBI_XDS_CHANNEL_CALL_LETTERS, VBI_XDS_CHANNEL_TAPE_DELAY, VBI_XDS_CHANNEL_TSID } |
VBI_XDS_CLASS_CHANNEL subclass. More... | |
enum | vbi_xds_subclass_misc { VBI_XDS_TIME_OF_DAY = 0x01, VBI_XDS_IMPULSE_CAPTURE_ID, VBI_XDS_SUPPLEMENTAL_DATA_LOCATION, VBI_XDS_LOCAL_TIME_ZONE, VBI_XDS_OUT_OF_BAND_CHANNEL = 0x40, VBI_XDS_CHANNEL_MAP_POINTER, VBI_XDS_CHANNEL_MAP_HEADER, VBI_XDS_CHANNEL_MAP } |
VBI_XDS_CLASS_MISC subclass. More... | |
enum | vbi_xds_subclass_public_service { VBI_XDS_WEATHER_BULLETIN = 0x01, VBI_XDS_WEATHER_MESSAGE } |
VBI_XDS_CLASS_PUBLIC_SERVICE subclass. More... |
Functions | |
void | vbi_xds_demux_reset (vbi_xds_demux *xd) |
vbi_bool | vbi_xds_demux_feed (vbi_xds_demux *xd, const uint8_t buffer[2]) |
vbi_bool | vbi_xds_demux_feed_frame (vbi_xds_demux *xd, const vbi_sliced *sliced, unsigned int n_lines) |
void | vbi_xds_demux_delete (vbi_xds_demux *xd) |
vbi_xds_demux * | vbi_xds_demux_new (vbi_xds_demux_cb *callback, void *user_data) _vbi_alloc |
Separating XDS data from a Closed Caption stream (EIA 608).
typedef struct _vbi_xds_demux vbi_xds_demux |
XDS demultiplexer.
The contents of this structure are private. Call vbi_xds_demux_new() to allocate a XDS demultiplexer.
typedef vbi_bool vbi_xds_demux_cb(vbi_xds_demux *xd, const vbi_xds_packet *xp, void *user_data) |
xd | XDS demultiplexer context allocated with vbi_xds_demux_new(). |
user_data | User data pointer given to vbi_xds_demux_new(). |
xp | Pointer to the received XDS data packet. |
The XDS demux calls a function of this type when an XDS packet has been completely received, all bytes have correct parity and the packet checksum is correct. Other packets are discarded.
VBI_XDS_CLASS_PUBLIC_SERVICE
subclass.
void vbi_xds_demux_reset | ( | vbi_xds_demux * | xd | ) |
xd | XDS demultiplexer context allocated with vbi_xds_demux_new(). |
Resets the XDS demux, useful for example after a channel change.
vbi_bool vbi_xds_demux_feed | ( | vbi_xds_demux * | xd, |
const uint8_t | buffer[2] | ||
) |
xd | XDS demultiplexer context allocated with vbi_xds_demux_new(). |
buffer | Closed Caption character pair, as in struct vbi_sliced. |
This function takes two successive bytes of a raw Closed Caption stream, filters out XDS data and calls the output function given to vbi_xds_demux_new() when a new packet is complete.
You should feed only data from NTSC line 284.
FALSE
if the buffer contained parity errors.vbi_bool vbi_xds_demux_feed_frame | ( | vbi_xds_demux * | xd, |
const vbi_sliced * | sliced, | ||
unsigned int | n_lines | ||
) |
xd | XDS demultiplexer context allocated with vbi_xds_demux_new(). |
sliced | Sliced VBI data. |
n_lines | Number of lines in the sliced array. |
This function works like vbi_xds_demux_feed() but operates on sliced VBI data and filters out VBI_SLICED_CAPTION_525
on NTSC line 284.
FALSE
if any of the Caption lines contained parity errors.void vbi_xds_demux_delete | ( | vbi_xds_demux * | xd | ) |
xd | XDS demultiplexer context allocated with vbi_xds_demux_new(), can be NULL . |
Frees all resources associated with xd.
vbi_xds_demux* vbi_xds_demux_new | ( | vbi_xds_demux_cb * | callback, |
void * | user_data | ||
) |
callback | Function to be called by vbi_xds_demux_feed() when a new packet is available. |
user_data | User pointer passed through to callback function. |
Allocates a new Extended Data Service (EIA 608) demultiplexer.
NULL
on failure (out of memory).