DVB Adapter access

The dvb module provides access to the linuxdvb API via a simple adapter model that encompasses the frontend/demux/dvr device into one object. More...

Data Structures

struct  DVBAdapterPIDFilter_s
 Structure used to keep track of hardware pid filters. More...
struct  DVBAdapter_t
 Structure representing a DVB Adapter, that is a frontend, a demux and a dvr device. More...
struct  DVBDiSEqCSettings_s
 Structure used to hold the information necessary to setup DiSEqC switches to receive a specifiec satellite. More...

Defines

#define DVB_MAX_PID_FILTERS   15
 Maximum number of PID filters when running in hardware restricted mode.

Typedefs

typedef struct
DVBAdapterPIDFilter_s 
DVBAdapterPIDFilter_t
typedef struct DVBDiSEqCSettings_s DVBDiSEqCSettings_t

Enumerations

enum  Polarisation_e { POL_HORIZONTAL = 0, POL_VERTICAL }
 Enum to represent the different polarisation available for satellite transmission.

Functions

DVBAdapter_tDVBInit (int adapter, bool hwRestricted)
 Open a DVB Adapter.
void DVBDispose (DVBAdapter_t *adapter)
 Close a DVPAdapter.
int DVBFrontEndTune (DVBAdapter_t *adapter, struct dvb_frontend_parameters *frontend, DVBDiSEqCSettings_t *diseqc)
 Tune the frontend to the specified parameters.
void DVBFrontEndLNBInfoSet (DVBAdapter_t *adapter, int lowFreq, int highFreq, int switchFreq)
 Set the LNB LO frequencies.
int DVBFrontEndStatus (DVBAdapter_t *adapter, fe_status_t *status, unsigned int *ber, unsigned int *strength, unsigned int *snr, unsigned int *ucblocks)
 Retrieve the status of the frontend of the specified adapter.
int DVBDemuxSetBufferSize (DVBAdapter_t *adapter, unsigned long size)
 Set the size of the circular buffer used by the demux.
int DVBDemuxAllocateFilter (DVBAdapter_t *adapter, uint16_t pid, bool system)
 Allocate a new PID Filter, indicating whether it is a system PID or not.
int DVBDemuxReleaseFilter (DVBAdapter_t *adapter, uint16_t pid)
 Release a specific PID filter.
int DVBDemuxReleaseAllFilters (DVBAdapter_t *adapter, bool system)
 Release all application or system PID filters.
int DVBDVRRead (DVBAdapter_t *adapter, char *data, int max, int timeout)
 Read upto max bytes from the dvr device belonging to the specified adapter.

Detailed Description

The dvb module provides access to the linuxdvb API via a simple adapter model that encompasses the frontend/demux/dvr device into one object.

By default the entire transport stream is routed to the DVR device, although for hardware restricted devices it is possible to allocate PID filters that are routed to the DVR device. These PID filters are grouped into system and application filters, making it easier to release a specific set of PID filters that are being used to filter a service say.

Events Exported

DVBAdapter.Locked

This event is fired from the DVBAdapter monitor thread when it detects that the frontend has acquired a signal lock.
payload = The adapter that has locked.

DVBAdapter.Unlocked

This event is fired from the DVBAdapter monitor thread when it detects that the frontend has lost signal lock.
payload = The adapter that has lost locked.

DVBAdapter.TuneFailed

This event is fired when the frontend fails to tune, for example parameters out of range etc.
payload = The adapter that failed to tune.

Function Documentation

int DVBDemuxAllocateFilter ( DVBAdapter_t adapter,
uint16_t  pid,
bool  system 
)

Allocate a new PID Filter, indicating whether it is a system PID or not.

Parameters:
adapter The adapter to allocate the filter on,
pid The PID to filter.
system Whether this filter is a 'system' filter or not.
Returns:
0 on success, non-zero otherwise.

int DVBDemuxReleaseAllFilters ( DVBAdapter_t adapter,
bool  system 
)

Release all application or system PID filters.

Parameters:
adapter The adapter to release the filters on.
system Whether to release system or application filters.
Returns:
0 on success, non-zero otherwise.

int DVBDemuxReleaseFilter ( DVBAdapter_t adapter,
uint16_t  pid 
)

Release a specific PID filter.

Parameters:
adapter The adapter to release the filter on.
pid The PID of the filter to release.
Returns:
0 on success, non-zero otherwise.

int DVBDemuxSetBufferSize ( DVBAdapter_t adapter,
unsigned long  size 
)

Set the size of the circular buffer used by the demux.

Parameters:
adapter The adapter to set size of the buffer on.
size Size of the buffer to set.
Returns:
0 on success, non-zero otherwise.

void DVBDispose ( DVBAdapter_t adapter  ) 

Close a DVPAdapter.

Close the frontend,demux and dvr devices and free the DVBAdapter_t structure.

Parameters:
adapter The DVBAdapter_t structure to free.

int DVBDVRRead ( DVBAdapter_t adapter,
char *  data,
int  max,
int  timeout 
)

Read upto max bytes from the dvr device belonging to the specified adapter.

Parameters:
adapter The adapter to read from.
data Buffer to read into.
max Maximum number of bytes to read.
timeout Maximum amount of time to wait for data.
Returns:
0 on success, non-zero otherwise.

void DVBFrontEndLNBInfoSet ( DVBAdapter_t adapter,
int  lowFreq,
int  highFreq,
int  switchFreq 
)

Set the LNB LO frequencies.

Parameters:
adapter The adapter to set the LNB information on.
lowFreq Low LO frequency.
highFreq high LO frequency.
switchFreq switch LO frequency.
Returns:
0 on success, non-zero otherwise.

int DVBFrontEndStatus ( DVBAdapter_t adapter,
fe_status_t *  status,
unsigned int *  ber,
unsigned int *  strength,
unsigned int *  snr,
unsigned int *  ucblocks 
)

Retrieve the status of the frontend of the specified adapter.

Parameters:
adapter The adapter to check.
status Used to return the status flags (may be NULL).
ber Used to return the Bit Error Rate (may be NULL).
strength Used to return the signal strength (may be NULL).
snr Used to return the signal to noise ratio (may be NULL).
ucblocks Used to return the uncorrected block count (may be NULL).
Returns:
0 on success, non-zero otherwise.

int DVBFrontEndTune ( DVBAdapter_t adapter,
struct dvb_frontend_parameters *  frontend,
DVBDiSEqCSettings_t diseqc 
)

Tune the frontend to the specified parameters.

Parameters:
adapter The adapter to tune.
frontend The parameters to use to tune.
diseqc DiSEqC settings, may be NULL if not a satellite frontend.
Returns:
0 on success, non-zero otherwise.

DVBAdapter_t* DVBInit ( int  adapter,
bool  hwRestricted 
)

Open a DVB Adapter.

This will open the frontend, demux and dvr devices.

Parameters:
adapter The adapter number of the devices to open.
hwRestricted Whether the adapter can only stream a portion of the transport stream.
Returns:
a DVBAdapter_t structure or NULL if the adapter could not be opened.


Generated on Thu Jun 26 12:58:31 2008 for DVBStreamer by  doxygen 1.5.5