Functions | |
vbi_decoder * | vbi_decoder_new (void) |
Allocate a new data service decoder instance. | |
void | vbi_decoder_delete (vbi_decoder *vbi) |
Delete a data service decoder instance. | |
void | vbi_decode (vbi_decoder *vbi, vbi_sliced *sliced, int lines, double timestamp) |
Main function of the data service decoder. | |
void | vbi_channel_switched (vbi_decoder *vbi, vbi_nuid nuid) |
vbi_page_type | vbi_classify_page (vbi_decoder *vbi, vbi_pgno pgno, vbi_subno *subno, char **language) |
void | vbi_version (unsigned int *major, unsigned int *minor, unsigned int *micro) |
void | vbi_teletext_set_default_region (vbi_decoder *vbi, int default_region) |
void | vbi_teletext_set_level (vbi_decoder *vbi, int level) |
vbi_decoder* vbi_decoder_new | ( | void | ) |
Allocate a new data service decoder instance.
NULL
on failure, probably due to lack of memory. void vbi_decoder_delete | ( | vbi_decoder * | vbi | ) |
Delete a data service decoder instance.
vbi | Decoder structure allocated with vbi_decoder_new(). |
void vbi_decode | ( | vbi_decoder * | vbi, | |
vbi_sliced * | sliced, | |||
int | lines, | |||
double | time | |||
) |
Main function of the data service decoder.
vbi | Initialized vbi decoding context as returned by vbi_decoder_new(). | |
sliced | Array of vbi_sliced data packets to be decoded. | |
lines | Number of vbi_sliced data packets, i. e. VBI lines. | |
time | Timestamp associated with all sliced data packets. This is the time in seconds and fractions since 1970-01-01 00:00, for example from function gettimeofday(). time should only increment, the latest time entered is considered the current time for activity calculation. |
timestamp shall advance by 1/30 to 1/25 seconds whenever calling this function. Failure to do so will be interpreted as frame dropping, which starts a resynchronization cycle, eventually a channel switch may be assumed which resets even more decoder state. So even if a frame did not contain any useful data this function must be called, with lines set to zero.
void vbi_channel_switched | ( | vbi_decoder * | vbi, | |
vbi_nuid | nuid | |||
) |
vbi | VBI decoding context. | |
nuid | Set to zero for now. |
The decoder attempts to detect channel switches automatically, but this is not 100 % reliable, especially without receiving and decoding Teletext or VPS which frequently transmit network identifiers.
Note the reset is not executed until the next frame is about to be decoded, so you may still receive "old" events after calling this. You may also receive blank events (e. g. unknown network, unknown aspect ratio) revoking a previously sent event, until new information becomes available.
vbi_page_type vbi_classify_page | ( | vbi_decoder * | vbi, | |
vbi_pgno | pgno, | |||
vbi_subno * | subno, | |||
char ** | language | |||
) |
vbi | Initialized vbi decoding context. | |
pgno | Teletext or Closed Caption page to examine, see vbi_pgno. | |
subno | The highest subpage number of this page will be stored here. subno can be NULL . | |
language | If it is possible to determine the language a page is written in, a pointer to the language name (Latin-1) will be stored here, NULL if the language is unknown. language can be NULL if this information is not needed. |
For Closed Caption pages (pgno 1 ... 8) subno will always be zero, language set or NULL
. The return value will be VBI_SUBTITLE_PAGE
for page 1 ... 4 (Closed Caption channel 1 ... 4), VBI_NORMAL_PAGE
for page 5 ... 8 (Text channel 1 ... 4), or VBI_NO_PAGE
if no data is currently transmitted on the channel.
For Teletext pages (pgno 0x100 ... 0x8FF) subno returns the highest subpage number used. Note this number can be larger (but not smaller) than the number of subpages actually received and cached. Still there is no guarantee the advertised subpages will ever appear or stay in cache.
subno | meaning |
0 | single page, no subpages |
1 | never |
2 ... 0x3F7F | has subpages 1 ... subno |
0xFFFE | has unknown number (two or more) of subpages |
0xFFFF | presence of subpages unknown |
language currently returns the language of subtitle pages, NULL
if unknown or the page is not classified as VBI_SUBTITLE_PAGE
.
Other page types are:
VBI_NO_PAGE | Page is not in transmission |
VBI_NORMAL_PAGE | |
VBI_SUBTITLE_PAGE | |
VBI_SUBTITLE_INDEX | List of subtitle pages |
VBI_NONSTD_SUBPAGES | For example a world time page |
VBI_PROGR_WARNING | Program related warning (perhaps schedule change anouncements, the Teletext specification does not elaborate on this) |
VBI_CURRENT_PROGR | Information about the current program |
VBI_NOW_AND_NEXT | Brief information about the current and next program |
VBI_PROGR_INDEX | Program index page (perhaps the front page of all program related pages) |
VBI_PROGR_SCHEDULE | Program schedule page |
VBI_UNKNOWN_PAGE |
void vbi_version | ( | unsigned int * | major, | |
unsigned int * | minor, | |||
unsigned int * | micro | |||
) |
major | Store major number here, can be NULL. | |
minor | Store minor number here, can be NULL. | |
micro | Store micro number here, can be NULL. |
void vbi_teletext_set_default_region | ( | vbi_decoder * | vbi, | |
int | default_region | |||
) |
vbi | Initialized vbi decoding context. | |
default_region | A value between 0 ... 80, index into the Teletext character set table according to ETS 300 706, Section 15 (or libzvbi source file lang.c). The three last significant bits will be replaced. |
void vbi_teletext_set_level | ( | vbi_decoder * | vbi, | |
int | level | |||
) |
vbi | Initialized vbi decoding context. | |
level |