8.5. TS Feed API

A TS feed is typically mapped to a hardware PID filter on the demux chip. Using this API, the client can set the filtering properties to start/stop filtering TS packets on a particular TS feed. The API is defined as an abstract interface of the type dmx_ts_feed_t.

The functions that implement the interface should be defined static or module private. The client can get the handle of a TS feed API by calling the function allocate_ts_feed() in the demux API.

8.5.1. set()

DESCRIPTION

This function sets the parameters of a TS feed. Any filtering in progress on the TS feed must be stopped before calling this function.

SYNOPSIS

int set ( dmx_ts_feed_t⋆ feed, __u16 pid, size_t callback_length, size_t circular_buffer_size, int descramble, struct timespec timeout);

PARAMETERS

dmx_ts_feed_t* feed

Pointer to the TS feed API and instance data.

__u16 pid

PID value to filter. Only the TS packets carrying the specified PID will be passed to the API client.

size_t callback_length

Number of bytes to deliver with each call to the dmx_ts_cb() callback function. The value of this parameter should be a multiple of 188.

size_t circular_buffer_size

Size of the circular buffer for the filtered TS packets.

int descramble

If non-zero, descramble the filtered TS packets.

struct timespec timeout

Maximum time to wait before delivering received TS packets to the client.

RETURNS

0

The function was completed without errors.

-ENOMEM

Not enough memory for the requested buffer size.

-ENOSYS

No descrambling facility available for TS.

-EINVAL

Bad parameter.

8.5.2. start_filtering()

DESCRIPTION

Starts filtering TS packets on this TS feed, according to its settings. The PID value to filter can be set by the API client. All matching TS packets are delivered asynchronously to the client, using the callback function registered with allocate_ts_feed().

SYNOPSIS

int start_filtering(dmx_ts_feed_t⋆ feed);

PARAMETERS

dmx_ts_feed_t* feed

Pointer to the TS feed API and instance data.

RETURNS

0

The function was completed without errors.

-EINVAL

Bad parameter.

8.5.3. stop_filtering()

DESCRIPTION

Stops filtering TS packets on this TS feed.

SYNOPSIS

int stop_filtering(dmx_ts_feed_t⋆ feed);

PARAMETERS

dmx_ts_feed_t* feed

Pointer to the TS feed API and instance data.

RETURNS

0

The function was completed without errors.

-EINVAL

Bad parameter.