Data Structures | |
struct | vbi_channel_profile |
Proxy scheduler parameters for background channel switching. More... | |
Defines | |
#define | VBIPROXY_VERSION 0x00000100 |
Proxy protocol version: major, minor and patchlevel. | |
Typedefs | |
typedef vbi_proxy_client | vbi_proxy_client |
Proxy client context. | |
typedef void | VBI_PROXY_CLIENT_CALLBACK (void *p_client_data, VBI_PROXY_EV_TYPE ev_mask) |
Function prototype for proxy client callback. | |
Enumerations | |
enum | VBI_PROXY_EV_TYPE { VBI_PROXY_EV_CHN_GRANTED = 1<<0, VBI_PROXY_EV_CHN_CHANGED = 1<<1, VBI_PROXY_EV_NORM_CHANGED = 1<<2, VBI_PROXY_EV_CHN_RECLAIMED = 1<<3, VBI_PROXY_EV_NONE = 0 } |
Bits in event mask parameter to proxy client callback function. More... | |
enum | VBI_PROXY_SUSPEND { VBI_PROXY_SUSPEND_START, VBI_PROXY_SUSPEND_STOP } |
Modes for channel suspend requests. More... | |
enum | VBI_CHN_PRIO { VBI_CHN_PRIO_BACKGROUND = 1, VBI_CHN_PRIO_INTERACTIVE = 2, VBI_CHN_PRIO_DEFAULT = VBI_CHN_PRIO_INTERACTIVE, VBI_CHN_PRIO_RECORD = 3 } |
Priority levels for channel switching (equivalent to enum v4l2_priority). More... | |
enum | VBI_CHN_SUBPRIO { VBI_CHN_SUBPRIO_MINIMAL = 0x00, VBI_CHN_SUBPRIO_CHECK = 0x10, VBI_CHN_SUBPRIO_UPDATE = 0x20, VBI_CHN_SUBPRIO_INITIAL = 0x30, VBI_CHN_SUBPRIO_VPS_PDC = 0x40 } |
Sub-priorities for channel scheduling at "background" priority. More... | |
enum | VBI_PROXY_DAEMON_FLAGS { VBI_PROXY_DAEMON_NO_TIMEOUTS = 1<<0 } |
General flags sent by the proxy daemon to clients during connect. More... | |
enum | VBI_PROXY_CLIENT_FLAGS { VBI_PROXY_CLIENT_NO_TIMEOUTS = 1<<0, VBI_PROXY_CLIENT_NO_STATUS_IND = 1<<1 } |
General flags sent by clients to the proxy daemon during connect. More... | |
enum | VBI_PROXY_CHN_FLAGS { VBI_PROXY_CHN_RELEASE = 1<<0, VBI_PROXY_CHN_TOKEN = 1<<1, VBI_PROXY_CHN_FLUSH = 1<<2, VBI_PROXY_CHN_NORM = 1<<3, VBI_PROXY_CHN_FAIL = 1<<4, VBI_PROXY_CHN_NONE = 0 } |
Channel notification flags. More... | |
enum | VBI_DRIVER_API_REV { VBI_API_UNKNOWN, VBI_API_V4L1, VBI_API_V4L2, VBI_API_BKTR } |
Identification of the VBI device driver type. More... | |
Functions | |
vbi_proxy_client * | vbi_proxy_client_create (const char *dev_name, const char *p_client_name, VBI_PROXY_CLIENT_FLAGS client_flags, char **pp_errorstr, int trace_level) |
void | vbi_proxy_client_destroy (vbi_proxy_client *vpc) |
vbi_capture * | vbi_proxy_client_get_capture_if (vbi_proxy_client *vpc) |
Returns capture interface for an initialized proxy client. | |
VBI_PROXY_CLIENT_CALLBACK * | vbi_proxy_client_set_callback (vbi_proxy_client *vpc, VBI_PROXY_CLIENT_CALLBACK *p_callback, void *p_data) |
Installs callback function for asynchronous events. | |
VBI_DRIVER_API_REV | vbi_proxy_client_get_driver_api (vbi_proxy_client *vpc) |
Returns the driver type behind the actual capture device. | |
int | vbi_proxy_client_channel_request (vbi_proxy_client *vpc, VBI_CHN_PRIO chn_prio, vbi_channel_profile *chn_profile) |
int | vbi_proxy_client_channel_notify (vbi_proxy_client *vpc, VBI_PROXY_CHN_FLAGS notify_flags, unsigned int scanning) |
int | vbi_proxy_client_channel_suspend (vbi_proxy_client *vpc, VBI_PROXY_SUSPEND cmd) |
int | vbi_proxy_client_device_ioctl (vbi_proxy_client *vpc, int request, void *p_arg) |
Wrapper for ioctl requests on the VBI device. | |
int | vbi_proxy_client_get_channel_desc (vbi_proxy_client *vpc, unsigned int *p_scanning, vbi_bool *p_granted) |
vbi_bool | vbi_proxy_client_has_channel_control (vbi_proxy_client *vpc) |
Query if the client is currently allowed to switch channels. |
Using the VBI proxy daemon instead of capturing directly from a VBI device allows multiple clients to capture concurrently, e.g. to decode multiple data services.
|
Proxy client context. A reference to this anonymous structure is returned by vbi_proxy_client_create and must be passed to the device capture interface and/or all subsequent calls to proxy client interface functions. The contents of this structure are private and must not be accessed or changed by the caller. |
|
Function prototype for proxy client callback. The first parameter is the value which the client passed when installing the callback; it's just passed through to the callback unmodified. The second parameter contains one or more bits to describe which events occured wince the last call. |
|
|
Modes for channel suspend requests.
|
|
Priority levels for channel switching (equivalent to enum v4l2_priority). These priorities are used to cooperativly resolve conflicts between channel requests of multiple capture applications. While a capture application with a higher priority has opened a device, channel change requests of applications with lower priority will fail with error "EBUSY".
|
|
Sub-priorities for channel scheduling at "background" priority. This enum describes recommended sub-priority levels for channel profiles. They're intended for channel switching through a VBI proxy at background priority level. The daemon uses this priority to decide which request to grant first if there are multiple outstanding requests. To the daemon these are just numbers (highest wins) but for successful cooperation clients need to use agree on values for similar tasks. Hence the following values are recommended:
|
|
General flags sent by the proxy daemon to clients during connect.
|
|
General flags sent by clients to the proxy daemon during connect.
|
|
Channel notification flags.
|
|
Identification of the VBI device driver type.
|
|
|
|
|
|
Returns capture interface for an initialized proxy client.
This function is for convenience only: it returns the same pointer as the previous call to vbi_capture_proxy_new(), so that the client need not store it. This pointer is required for function calls through the capture device API (e.g. reading raw or sliced data)
|
|
Installs callback function for asynchronous events.
This function installs a callback function which will be invoked upon asynchronous events (e.g. channel changes by other clients.) Since the proxy client has no "life" on it's own (i.e. it's not using an internal thread or process) callbacks will only occur from inside other proxy client function calls. The client's file description will become readable when an asynchronous message has arrived from the daemon. Typically the application then will call read to obtain sliced data and the callback will be invoked from inside the read function. Usually in this case the read call will return zero, i.e. indicate an timeout since no actual sliced data has arrived. Note for channel requests the callback to grant channel control may be invoked before the request function returns. Note you can call any interface function from inside the callback, including the destroy operator.
|
|
Returns the driver type behind the actual capture device.
This function can be used to query which driver is behind the device which is currently opened by the VBI proxy daemon. Applications which use libzvbi's capture API only need not care about this. The information is only relevant to applications which need to change channels or norms. The function will fail if the client is currently not connected to the daemon, i.e. VPI capture has to be started first.
|
|
Scheduling differs at the 3 priority levels. For an explanation of priorities see enum VBI_CHN_PRIO. At background level channel changes are coordinated by introduction of a virtual token: only the one client which holds the token is allowed to switch channels. The daemon will wait for the token to be returned before it's granted to another client. This way conflicting channel changes are avoided. At the upper level the latest request always wins. To avoid interference the application still might wait until it gets indicated that the token has been returned to the daemon. The token may be granted right away or at a later time, e.g. when it has to be reclaimed from another client first, or if there are other clients with higher priority. If a callback has been registered, it will be invoked when the token arrives; otherwise vbi_proxy_client_has_channel_control() can be used to poll for it.
Note: to set the priority level to "background" only without requesting a channel, set the is_valid member in the profile to
|
|
|
|
|
|
Wrapper for ioctl requests on the VBI device.
This function allows to manipulate parameters of the underlying VBI device. Not all ioctls are allowed here. It's mainly intended to be used for channel enumeration and channel/norm changes. The request codes and parameters are the same as for the actual device. The caller has to query the driver API first and use the respective ioctl codes, same as if the device would be used directly.
|
|
|
|
Query if the client is currently allowed to switch channels.
|