ZVBI Library  0.2.33
Data Structures | Macros | Typedefs | Enumerations | Functions
Extended Data Service (XDS) demultiplexer
Low Level Decoding

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_demuxvbi_xds_demux_new (vbi_xds_demux_cb *callback, void *user_data) _vbi_alloc

Detailed Description

Separating XDS data from a Closed Caption stream (EIA 608).

Typedef Documentation

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)
Parameters
xdXDS demultiplexer context allocated with vbi_xds_demux_new().
user_dataUser data pointer given to vbi_xds_demux_new().
xpPointer 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.

Returns
FALSE on error, will be returned by vbi_xds_demux_feed().

Enumeration Type Documentation

VBI_XDS_CLASS_CURRENT and VBI_XDS_CLASS_FUTURE subclass.

Enumerator:
VBI_XDS_PROGRAM_DATA 
Since
0.2.17
VBI_XDS_PROGRAM_MISC_DATA 
Since
0.2.17

VBI_XDS_CLASS_CHANNEL subclass.

Enumerator:
VBI_XDS_CHANNEL_TSID 
Since
0.2.17

VBI_XDS_CLASS_MISC subclass.

Enumerator:
VBI_XDS_OUT_OF_BAND_CHANNEL 
Since
0.2.17
VBI_XDS_CHANNEL_MAP_POINTER 
Since
0.2.17
VBI_XDS_CHANNEL_MAP_HEADER 
Since
0.2.17
VBI_XDS_CHANNEL_MAP 
Since
0.2.17

VBI_XDS_CLASS_PUBLIC_SERVICE subclass.

Since
0.2.17

Function Documentation

void vbi_xds_demux_reset ( vbi_xds_demux xd)
Parameters
xdXDS demultiplexer context allocated with vbi_xds_demux_new().

Resets the XDS demux, useful for example after a channel change.

Since
0.2.16
vbi_bool vbi_xds_demux_feed ( vbi_xds_demux xd,
const uint8_t  buffer[2] 
)
Parameters
xdXDS demultiplexer context allocated with vbi_xds_demux_new().
bufferClosed 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.

Returns
FALSE if the buffer contained parity errors.
Since
0.2.16
vbi_bool vbi_xds_demux_feed_frame ( vbi_xds_demux xd,
const vbi_sliced sliced,
unsigned int  n_lines 
)
Parameters
xdXDS demultiplexer context allocated with vbi_xds_demux_new().
slicedSliced VBI data.
n_linesNumber 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.

Returns
FALSE if any of the Caption lines contained parity errors.
Since
0.2.26
void vbi_xds_demux_delete ( vbi_xds_demux xd)
Parameters
xdXDS demultiplexer context allocated with vbi_xds_demux_new(), can be NULL.

Frees all resources associated with xd.

Since
0.2.16
vbi_xds_demux* vbi_xds_demux_new ( vbi_xds_demux_cb callback,
void *  user_data 
)
Parameters
callbackFunction to be called by vbi_xds_demux_feed() when a new packet is available.
user_dataUser pointer passed through to callback function.

Allocates a new Extended Data Service (EIA 608) demultiplexer.

Returns
Pointer to newly allocated XDS demux context which must be freed with vbi_xds_demux_delete() when done. NULL on failure (out of memory).
Since
0.2.16