Data Structures | |
struct | vbi_capture_buffer |
Typedefs | |
typedef struct vbi_capture | vbi_capture |
Opaque device interface handle. | |
Enumerations | |
enum | VBI_CAPTURE_FD_FLAGS { VBI_FD_HAS_SELECT = 1<<0, VBI_FD_HAS_MMAP = 1<<1, VBI_FD_IS_DEVICE = 1<<2 } |
Properties of capture file handle. More... | |
Functions | |
void | vbi_capture_sim_decode_raw (vbi_capture *cap, vbi_bool enable) |
vbi_capture * | vbi_capture_sim_new (int scanning, unsigned int *services, vbi_bool interlaced, vbi_bool synchronous) |
vbi_capture * | vbi_capture_v4l2_new (const char *dev_name, int buffers, unsigned int *services, int strict, char **errorstr, vbi_bool trace) |
vbi_capture * | vbi_capture_v4l2k_new (const char *dev_name, int fd, int buffers, unsigned int *services, int strict, char **errorstr, vbi_bool trace) |
vbi_capture * | vbi_capture_v4l_new (const char *dev_name, int scanning, unsigned int *services, int strict, char **errorstr, vbi_bool trace) |
vbi_capture * | vbi_capture_v4l_sidecar_new (const char *dev_name, int given_fd, unsigned int *services, int strict, char **errorstr, vbi_bool trace) |
vbi_capture * | vbi_capture_bktr_new (const char *dev_name, int scanning, unsigned int *services, int strict, char **errstr, vbi_bool trace) |
int | vbi_capture_dvb_filter (vbi_capture *cap, int pid) |
vbi_capture * | vbi_capture_dvb_new (char *dev, int scanning, unsigned int *services, int strict, char **errstr, vbi_bool trace) |
int64_t | vbi_capture_dvb_last_pts (const vbi_capture *cap) |
vbi_capture * | vbi_capture_dvb_new2 (const char *device_name, unsigned int pid, char **errstr, vbi_bool trace) |
vbi_capture * | vbi_capture_proxy_new (struct vbi_proxy_client *vpc, int buffers, int scanning, unsigned int *p_services, int strict, char **pp_errorstr) |
int | vbi_capture_read_raw (vbi_capture *capture, void *data, double *timestamp, struct timeval *timeout) |
int | vbi_capture_read_sliced (vbi_capture *capture, vbi_sliced *data, int *lines, double *timestamp, struct timeval *timeout) |
int | vbi_capture_read (vbi_capture *capture, void *raw_data, vbi_sliced *sliced_data, int *lines, double *timestamp, struct timeval *timeout) |
int | vbi_capture_pull_raw (vbi_capture *capture, vbi_capture_buffer **buffer, struct timeval *timeout) |
int | vbi_capture_pull_sliced (vbi_capture *capture, vbi_capture_buffer **buffer, struct timeval *timeout) |
int | vbi_capture_pull (vbi_capture *capture, vbi_capture_buffer **raw_buffer, vbi_capture_buffer **sliced_buffer, struct timeval *timeout) |
vbi_raw_decoder * | vbi_capture_parameters (vbi_capture *capture) |
int | vbi_capture_fd (vbi_capture *capture) |
unsigned int | vbi_capture_update_services (vbi_capture *capture, vbi_bool reset, vbi_bool commit, unsigned int services, int strict, char **errorstr) |
int | vbi_capture_get_scanning (vbi_capture *capture) |
Queries the capture device for the current norm. | |
void | vbi_capture_flush (vbi_capture *capture) |
void | vbi_capture_delete (vbi_capture *capture) |
vbi_bool | vbi_capture_set_video_path (vbi_capture *capture, const char *p_dev_video) |
Set path to video device for TV norm queries. | |
VBI_CAPTURE_FD_FLAGS | vbi_capture_get_fd_flags (vbi_capture *capture) |
Query properties of the capture device file handle. |
enum VBI_CAPTURE_FD_FLAGS |
Properties of capture file handle.
void vbi_capture_sim_decode_raw | ( | vbi_capture * | cap, | |
vbi_bool | enable | |||
) |
cap | Initialized vbi_capture context opened with vbi_capture_sim_new(). | |
enable | TRUE to enable decoding of the simulated raw VBI data. |
vbi_capture* vbi_capture_sim_new | ( | int | scanning, | |
unsigned int * | services, | |||
vbi_bool | interlaced, | |||
vbi_bool | synchronous | |||
) |
scanning | Whether to simulate a device receiving PAL/SECAM (value 625) or NTSC (525) video. | |
services | This parameter must point to a set of VBI_SLICED_ symbols describing the data services to be simulated. On return the services actually simulated will be stored here. Currently Teletext System B, VPS, PAL WSS and PAL/NTSC Closed Caption are supported. | |
interlaced | If TRUE the simulated raw VBI images will be interlaced like video images. Otherwise they will contain fields in sequential order, the first field at the top. Usually real devices provide sequential images. | |
synchronous | If FALSE raw VBI images will be delayed by one field (putting a bottom field first in raw VBI images), simulating defective hardware. The interlaced and synchronous parameters correspond to fields in struct vbi_raw_decoder. |
The VBI data is valid but limited. Just one Teletext page and one line of roll-up caption. The WSS and VPS data is set to defaults, the VPS contains no CNI.
NULL
on failure (out of memory).vbi_capture* vbi_capture_v4l2_new | ( | const char * | dev_name, | |
int | buffers, | |||
unsigned int * | services, | |||
int | strict, | |||
char ** | errstr, | |||
vbi_bool | trace | |||
) |
dev_name | Name of the device to open, usually one of /dev/vbi or /dev/vbi0 and up. | |
buffers | Number of device buffers for raw vbi data, when the driver supports streaming. Otherwise one bounce buffer is allocated for vbi_capture_pull(). | |
services | This must point to a set of VBI_SLICED_ symbols describing the data services to be decoded. On return the services actually decodable will be stored here. See vbi_raw_decoder_add() for details. If you want to capture raw data only, set to VBI_SLICED_VBI_525 , VBI_SLICED_VBI_625 or both. If this parameter is NULL , no services will be installed. You can do so later with vbi_capture_update_services(); note the reset parameter must be set to TRUE in this case. | |
strict | Will be passed to vbi_raw_decoder_add(). | |
errstr | If not NULL this function stores a pointer to an error description here. You must free() this string when no longer needed. | |
trace | If TRUE print progress messages on stderr. |
NULL
on failure. vbi_capture* vbi_capture_v4l2k_new | ( | const char * | dev_name, | |
int | fd, | |||
int | buffers, | |||
unsigned int * | services, | |||
int | strict, | |||
char ** | errstr, | |||
vbi_bool | trace | |||
) |
dev_name | Name of the device to open, usually one of /dev/vbi or /dev/vbi0 and up. | |
fd | File handle of VBI device if already opened by caller, else value -1. | |
buffers | Number of device buffers for raw vbi data, when the driver supports streaming. Otherwise one bounce buffer is allocated for vbi_capture_pull(). | |
services | This must point to a set of VBI_SLICED_ symbols describing the data services to be decoded. On return the services actually decodable will be stored here. See vbi_raw_decoder_add() for details. If you want to capture raw data only, set to VBI_SLICED_VBI_525 , VBI_SLICED_VBI_625 or both. If this parameter is NULL , no services will be installed. You can do so later with vbi_capture_update_services(); note the reset parameter must be set to TRUE in this case. | |
strict | Will be passed to vbi_raw_decoder_add(). | |
errstr | If not NULL this function stores a pointer to an error description here. You must free() this string when no longer needed. | |
trace | If TRUE print progress messages on stderr. |
NULL
on failure. vbi_capture* vbi_capture_v4l_new | ( | const char * | dev_name, | |
int | scanning, | |||
unsigned int * | services, | |||
int | strict, | |||
char ** | errstr, | |||
vbi_bool | trace | |||
) |
dev_name | Name of the device to open, usually one of /dev/vbi or /dev/vbi0 and up. | |
scanning | Can be used to specify the current TV norm for old drivers which don't support ioctls to query the current norm. Value is 625 (PAL/SECAM family) or 525 (NTSC family). Set to 0 if you don't know the norm. | |
services | This must point to a set of VBI_SLICED_ symbols describing the data services to be decoded. On return the services actually decodable will be stored here. See vbi_raw_decoder_add() for details. If you want to capture raw data only, set to VBI_SLICED_VBI_525 , VBI_SLICED_VBI_625 or both. If this parameter is NULL , no services will be installed. You can do so later with vbi_capture_update_services(); note the reset parameter must be set to TRUE in this case. | |
strict | Will be passed to vbi_raw_decoder_add(). | |
errstr | If not NULL this function stores a pointer to an error description here. You must free() this string when no longer needed. | |
trace | If TRUE print progress messages on stderr. |
NULL
on failure. vbi_capture* vbi_capture_v4l_sidecar_new | ( | const char * | dev_name, | |
int | given_fd, | |||
unsigned int * | services, | |||
int | strict, | |||
char ** | errstr, | |||
vbi_bool | trace | |||
) |
dev_name | Name of the device to open, usually one of /dev/vbi or /dev/vbi0 and up. | |
given_fd | File handle of an already open video device, usually one of /dev/video or /dev/video0 and up. Must be assorted with the named vbi device, i.e. refer to the same driver instance and hardware. | |
services | This must point to a set of VBI_SLICED_ symbols describing the data services to be decoded. On return the services actually decodable will be stored here. See vbi_raw_decoder_add() for details. If you want to capture raw data only, set to VBI_SLICED_VBI_525 , VBI_SLICED_VBI_625 or both. If this parameter is NULL , no services will be installed. You can do so later with vbi_capture_update_services(); note the reset parameter must be set to TRUE in this case. | |
strict | Will be passed to vbi_raw_decoder_add(). | |
errstr | If not NULL this function stores a pointer to an error description here. You must free() this string when no longer needed. | |
trace | If TRUE print progress messages on stderr. |
NULL
on failure. vbi_capture* vbi_capture_bktr_new | ( | const char * | dev_name, | |
int | scanning, | |||
unsigned int * | services, | |||
int | strict, | |||
char ** | errstr, | |||
vbi_bool | trace | |||
) |
dev_name | Name of the device to open. | |
scanning | The current video standard. Value is 625 (PAL/SECAM family) or 525 (NTSC family). | |
services | This must point to a set of VBI_SLICED_ symbols describing the data services to be decoded. On return the services actually decodable will be stored here. See vbi_raw_decoder_add() for details. If you want to capture raw data only, set to VBI_SLICED_VBI_525 , VBI_SLICED_VBI_625 or both. | |
strict | Will be passed to vbi_raw_decoder_add(). | |
errstr | If not NULL this function stores a pointer to an error description here. You must free() this string when no longer needed. | |
trace | If TRUE print progress messages on stderr. |
NULL
on failure. int vbi_capture_dvb_filter | ( | vbi_capture * | cap, | |
int | pid | |||
) |
cap | Initialized DVB vbi_capture context. | |
pid | Filter out a stream with this PID. |
vbi_capture* vbi_capture_dvb_new | ( | char * | dev, | |
int | scanning, | |||
unsigned int * | services, | |||
int | strict, | |||
char ** | errstr, | |||
vbi_bool | trace | |||
) |
dev | Name of the DVB device to open. | |
scanning | Ignored. | |
services | Ignored. | |
strict | Ignored. | |
errstr | If not NULL the function stores a pointer to an error description here. You must free() this string when no longer needed. | |
trace | If TRUE print progress and warning messages on stderr. |
NULL
on failure.int64_t vbi_capture_dvb_last_pts | ( | const vbi_capture * | cap | ) |
cap | Initialized DVB vbi_capture context. |
Note timestamps returned by vbi_capture read functions contain the sampling time of the data, that is the time at which the packet containing the first sliced line arrived.
vbi_capture* vbi_capture_dvb_new2 | ( | const char * | device_name, | |
unsigned int | pid, | |||
char ** | errstr, | |||
vbi_bool | trace | |||
) |
device_name | Name of the DVB device to open. | |
pid | Filter out a stream with this PID. You can pass 0 here and set or change the PID later with vbi_capture_dvb_filter(). | |
errstr | If not NULL the function stores a pointer to an error description here. You must free() this string when no longer needed. | |
trace | If TRUE print progress and warning messages on stderr. |
NULL
on failure.vbi_capture * vbi_capture_proxy_new | ( | struct vbi_proxy_client * | p_proxy_client, | |
int | buffers, | |||
int | scanning, | |||
unsigned int * | p_services, | |||
int | strict, | |||
char ** | pp_errorstr | |||
) |
p_proxy_client | Reference to an initialized proxy client context. | |
buffers | Number of device buffers for raw vbi data. The same number of buffers is allocated to cache sliced data in the proxy daemon. | |
scanning | This indicates the current norm: 625 for PAL and 525 for NTSC; set to 0 if you don't know (you should not attempt to query the device for the norm, as this parameter is only required for v4l1 drivers which don't support video standard query ioctls) | |
p_services | This must point to a set of VBI_SLICED_ symbols describing the data services to be decoded. On return the services actually decodable will be stored here. See vbi_raw_decoder_add() for details. If you want to capture raw data only, set to VBI_SLICED_VBI_525 , VBI_SLICED_VBI_625 or both. | |
strict | Will be passed to vbi_raw_decoder_add(). | |
pp_errorstr | If not NULL this function stores a pointer to an error description here. You must free() this string when no longer needed. |
Whenever possible the proxy should be used instead of opening the device directly, since it allows the user to start multiple VBI clients in parallel. When this function fails (usually because the user hasn't started the proxy daemon) applications should automatically fall back to opening the device directly.
NULL
on failure.int vbi_capture_read_raw | ( | vbi_capture * | capture, | |
void * | data, | |||
double * | timestamp, | |||
struct timeval * | timeout | |||
) |
capture | Initialized vbi_capture context. | |
data | Store the raw vbi data here. Use vbi_capture_parameters() to determine the buffer size. | |
timestamp | On success the capture instant in seconds and fractions since 1970-01-01 00:00 of the video frame will be stored here. | |
timeout | Wait timeout, will be read only. |
errno
for details. The function also fails if vbi data is not available in raw format. 0 on timeout, 1 on success. int vbi_capture_read_sliced | ( | vbi_capture * | capture, | |
vbi_sliced * | data, | |||
int * | lines, | |||
double * | timestamp, | |||
struct timeval * | timeout | |||
) |
capture | Initialized vbi capture context. | |
data | Stores the sliced vbi data here. Use vbi_capture_parameters() to determine the buffer size. | |
lines | Stores number of vbi lines decoded and stored in data, which can be zero, here. | |
timestamp | On success the capture instant in seconds and fractions since 1970-01-01 00:00 will be stored here. | |
timeout | Wait timeout, will be read only. |
Note: it's generally more efficient to use vbi_capture_pull_sliced() instead, as that one may avoid having to copy sliced data into the given buffer (e.g. for the VBI proxy)
errno
for details. 0 on timeout, 1 on success. int vbi_capture_read | ( | vbi_capture * | capture, | |
void * | raw_data, | |||
vbi_sliced * | sliced_data, | |||
int * | lines, | |||
double * | timestamp, | |||
struct timeval * | timeout | |||
) |
capture | Initialized vbi capture context. | |
raw_data | Stores the raw vbi data here. Use vbi_capture_parameters() to determine the buffer size. | |
sliced_data | Stores the sliced vbi data here. Use vbi_capture_parameters() to determine the buffer size. | |
lines | Stores number of vbi lines decoded and stored in data, which can be zero, here. | |
timestamp | On success the capture instant in seconds and fractions since 1970-01-01 00:00 will be stored here. | |
timeout | Wait timeout, will be read only. |
Note: depending on the driver, captured raw data may have to be copied from the capture buffer into the given buffer (e.g. for v4l2 streams which use memory mapped buffers.) It's generally more efficient to use one of the vbi_capture_pull() interfaces, especially if you don't require access to raw data at all.
errno
for details. The function also fails if vbi data is not available in raw format. 0 on timeout, 1 on success. int vbi_capture_pull_raw | ( | vbi_capture * | capture, | |
vbi_capture_buffer ** | buffer, | |||
struct timeval * | timeout | |||
) |
capture | Initialized vbi capture context. | |
buffer | Store pointer to a vbi_capture_buffer here. | |
timeout | Wait timeout, will be read only. |
errno
for details. The function also fails if vbi data is not available in raw format. 0 on timeout, 1 on success. int vbi_capture_pull_sliced | ( | vbi_capture * | capture, | |
vbi_capture_buffer ** | buffer, | |||
struct timeval * | timeout | |||
) |
capture | Initialized vbi capture context. | |
buffer | Store pointer to a vbi_capture_buffer here. | |
timeout | Wait timeout, will be read only. |
errno
for details. 0 on timeout, 1 on success. int vbi_capture_pull | ( | vbi_capture * | capture, | |
vbi_capture_buffer ** | raw_buffer, | |||
vbi_capture_buffer ** | sliced_buffer, | |||
struct timeval * | timeout | |||
) |
capture | Initialized vbi capture context. | |
raw_buffer | Store pointer to a vbi_capture_buffer here. | |
sliced_buffer | Store pointer to a vbi_capture_buffer here. | |
timeout | Wait timeout, will be read only. |
The raw and sliced data remains valid until the next vbi_capture_pull() call and must be read only.
errno
for details. The function also fails if vbi data is not available in raw format. 0 on timeout, 1 on success. vbi_raw_decoder* vbi_capture_parameters | ( | vbi_capture * | capture | ) |
capture | Initialized vbi capture context. |
int vbi_capture_fd | ( | vbi_capture * | capture | ) |
capture | Initialized vbi capture context, can be NULL . |
unsigned int vbi_capture_update_services | ( | vbi_capture * | capture, | |
vbi_bool | reset, | |||
vbi_bool | commit, | |||
unsigned int | services, | |||
int | strict, | |||
char ** | errorstr | |||
) |
capture | Initialized vbi capture context. | |
reset | TRUE to clear all previous services before adding new ones (by invoking vbi_raw_decoder_reset() at the appropriate time.) | |
commit | TRUE to apply all previously added services to the device; when doing subsequent calls of this function, commit should be set TRUE for the last call. Reading data cannot continue before changes were commited (because capturing has to be suspended to allow resizing the VBI image.) Note this flag is ignored when using the VBI proxy. | |
services | This must point to a set of VBI_SLICED_ symbols describing the data services to be decoded. On return the services actually decodable will be stored here. See vbi_raw_decoder_add() for details. If you want to capture raw data only, set to VBI_SLICED_VBI_525 , VBI_SLICED_VBI_625 or both. | |
strict | Will be passed to vbi_raw_decoder_add(). | |
errorstr | If not NULL this function stores a pointer to an error description here. You must free() this string when no longer needed. |
int vbi_capture_get_scanning | ( | vbi_capture * | capture | ) |
Queries the capture device for the current norm.
capture | Initialized vbi capture context. |
void vbi_capture_flush | ( | vbi_capture * | capture | ) |
capture | Initialized vbi capture context. |
void vbi_capture_delete | ( | vbi_capture * | capture | ) |
capture | Initialized vbi capture context, can be NULL . |
vbi_bool vbi_capture_set_video_path | ( | vbi_capture * | capture, | |
const char * | p_dev_video | |||
) |
Set path to video device for TV norm queries.
capture | Initialized vbi capture context. | |
p_dev_video | Path to a video device (e.g. /dev/video) which refers to the same hardware as the VBI device which is used for capturing. Note: only useful for old video4linux drivers which don't support norm queries through VBI devices. |
TRUE
if the configuration option and parameters are supported; else FALSE
. VBI_CAPTURE_FD_FLAGS vbi_capture_get_fd_flags | ( | vbi_capture * | capture | ) |
Query properties of the capture device file handle.
capture | Initialized vbi capture context. |