DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
Enumerations | Functions
ca_glue.h File Reference

Glue layer between DVB and conditional access systems. More...

#include "techtype.h"

Go to the source code of this file.

Enumerations

enum  E_CA_DECODE_STATUS { CA_DECODE_STATUS_STARTING, CA_DECODE_STATUS_STARTED, CA_DECODE_STATUS_STOPPED }
 

Functions

BOOLEAN STB_CAInitialise (void)
 Called once on system startup to allow initialisation of the CA systems. More...
 
BOOLEAN STB_CAAcquireDescrambler (U8BIT demux, U16BIT serv_id, U16BIT *ca_ids, U16BIT num_ca_ids, U32BIT *handle)
 This function is used by the resource manager to acquire a CA descrambler that's able to descramble a service that uses one of the CA systems defined by the array of CA system IDs (ca_ids). If a descrambler is available then a handle should be returned in 'handle' which will be used in all future calls related to this descrambler. If the CA software needs to set the demux descrambling keys, or create any filters to monitor SI data, the given demux handle should be used. More...
 
BOOLEAN STB_CAReleaseDescrambler (U32BIT handle)
 Will be called when a CA descrambler is no longer required. More...
 
void STB_CADescrambleServiceStart (U32BIT handle)
 This function will be called when decoding of a service is about to start and there's an associated descrambler. More...
 
void STB_CADescrambleServiceStop (U32BIT handle)
 This function will be called when decoding of a service is stopped. More...
 
void STB_CAReportPMT (U32BIT handle, U8BIT *pmt_data, U16BIT data_len)
 When there's an update to the PMT for a service, the updated PMT will be reported to the CA system using this function. More...
 
void STB_CAReportCAT (U32BIT handle, U8BIT *cat_data, U16BIT data_len)
 When there's an update to the CAT for a service, the updated CAT will be reported to the CA system using this function. The data is provided a section at a time, rather than as a complete table. More...
 
void STB_CAReportBAT (U32BIT handle, U8BIT *bat_data, U16BIT data_len)
 When there's an update to the BAT, the updated BAT will be reported to the CA system using this function. The data is provided a section at a time, rather than as a complete table. More...
 
void STB_CAReportNIT (U32BIT handle, U8BIT *nit_data, U16BIT data_len)
 When there's an update to the NIT, the updated NIT will be reported to the CA system using this function. The data is provided a section at a time, rather than as a complete table. More...
 
void STB_CADecodeVideoStatus (U32BIT handle, E_CA_DECODE_STATUS decode_status)
 Notifies the CA system of a change in the video decoding state. More...
 
void STB_CADecodeAudioStatus (U32BIT handle, E_CA_DECODE_STATUS decode_status)
 Notifies the CA system of a change in the audio decoding state. More...
 
void STB_CADecodeADStatus (U32BIT handle, E_CA_DECODE_STATUS decode_status)
 Notifies the CA system of a change in the AD decoding state. More...
 
void STB_CANotifyRunningStatus (U32BIT handle, U8BIT status)
 This function will be called when there's a change to the running status of a service being descrambled as indicated by the running_status field in the SDT. More...
 
BOOLEAN STB_CADescramblerRequiredForPlayback (U16BIT *ca_ids, U16BIT num_ca_ids)
 This function works out whether a CA descrambler is required to playback a recording with one of the given CA system IDs. More...
 
BOOLEAN STB_CADescramblerRequiredForRecording (U16BIT *ca_ids, U16BIT num_ca_ids)
 This function works out whether a CA descrambler is required to record a service with one of the given CA system IDs. More...
 
U16BIT STB_CAGetRecordingPids (U8BIT *pmt_data, U16BIT **pid_array)
 This function is called to get an array of PIDs that need to be recorded for the CA system required for the given PMT. The array must be allocated by this function, which also returns the number of items in the array. More...
 
void STB_CAReleaseRecordingPids (U16BIT *pid_array, U16BIT num_pids)
 Called to free the array of PIDs allocated by STB_CAGetRecordingPids. More...
 
void STB_CANotifyRecordingStatus (U32BIT handle, BOOLEAN status)
 This function is called when a recording starts and when it stops. More...
 

Detailed Description

Glue layer between DVB and conditional access systems.

Date
10/09/2013
Author
Steve Ford

Function Documentation

BOOLEAN STB_CAAcquireDescrambler ( U8BIT  demux,
U16BIT  serv_id,
U16BIT *  ca_ids,
U16BIT  num_ca_ids,
U32BIT *  handle 
)

This function is used by the resource manager to acquire a CA descrambler that's able to descramble a service that uses one of the CA systems defined by the array of CA system IDs (ca_ids). If a descrambler is available then a handle should be returned in 'handle' which will be used in all future calls related to this descrambler. If the CA software needs to set the demux descrambling keys, or create any filters to monitor SI data, the given demux handle should be used.


Parameters
demux- demux to be used if a descrambler is acquired
serv_id- ID of the service the descrambler is being acquired for
ca_ids- array of CA system IDs for the service
num_ca_ids- number of CA system IDs in the array
handle- pointer to return a handle to identify the acquired CA descrambler
Returns
TRUE if a descrambler is acquired, FALSE otherwise
void STB_CADecodeADStatus ( U32BIT  handle,
E_CA_DECODE_STATUS  decode_status 
)

Notifies the CA system of a change in the AD decoding state.


Parameters
handle- CA descrambler handle
decode_status- decoding status
void STB_CADecodeAudioStatus ( U32BIT  handle,
E_CA_DECODE_STATUS  decode_status 
)

Notifies the CA system of a change in the audio decoding state.


Parameters
handle- CA descrambler handle
decode_status- decoding status
void STB_CADecodeVideoStatus ( U32BIT  handle,
E_CA_DECODE_STATUS  decode_status 
)

Notifies the CA system of a change in the video decoding state.


Parameters
handle- CA descrambler handle
decode_status- decoding status
BOOLEAN STB_CADescramblerRequiredForPlayback ( U16BIT *  ca_ids,
U16BIT  num_ca_ids 
)

This function works out whether a CA descrambler is required to playback a recording with one of the given CA system IDs.


Parameters
ca_ids- array of CA system IDs
num_ca_ids- number of CA system IDs in the array
Returns
TRUE if a CA descrambler is required, FALSE otherwise

This function works out whether a CA descrambler is required to playback a recording with one of the given CA system IDs.


Parameters
ca_ids- array of CA system IDs
num_ca_ids- number of CA system IDs in the array
Returns
TRUE if a CA descrambler is required, FALSE otherwise
BOOLEAN STB_CADescramblerRequiredForRecording ( U16BIT *  ca_ids,
U16BIT  num_ca_ids 
)

This function works out whether a CA descrambler is required to record a service with one of the given CA system IDs.


Parameters
ca_ids- array of CA system IDs
num_ca_ids- number of CA system IDs in the array
Returns
TRUE if a CA descrambler is required, FALSE otherwise

This function works out whether a CA descrambler is required to record a service with one of the given CA system IDs.


Parameters
ca_ids- array of CA system IDs
num_ca_ids- number of CA system IDs in the array
Returns
TRUE if a CA descrambler is required, FALSE otherwise
void STB_CADescrambleServiceStart ( U32BIT  handle)

This function will be called when decoding of a service is about to start and there's an associated descrambler.


Parameters
handle- CA descrambler handle
void STB_CADescrambleServiceStop ( U32BIT  handle)

This function will be called when decoding of a service is stopped.


Parameters
handle- CA descrambler handle
U16BIT STB_CAGetRecordingPids ( U8BIT *  pmt_data,
U16BIT **  pid_array 
)

This function is called to get an array of PIDs that need to be recorded for the CA system required for the given PMT. The array must be allocated by this function, which also returns the number of items in the array.


Parameters
pmt_data- raw PMT section data
pid_array- pointer to an array allocated by this function on return, containing the PIDs to be recorded
Returns
the number of PIDs in the returned array
BOOLEAN STB_CAInitialise ( void  )

Called once on system startup to allow initialisation of the CA systems.


Returns
TRUE if initialisation is successful, FALSE otherwise
void STB_CANotifyRecordingStatus ( U32BIT  handle,
BOOLEAN  status 
)

This function is called when a recording starts and when it stops.


Parameters
handle- CA descrambler handle
status- TRUE when a recording starts, FALSE when it stops
void STB_CANotifyRunningStatus ( U32BIT  handle,
U8BIT  status 
)

This function will be called when there's a change to the running status of a service being descrambled as indicated by the running_status field in the SDT.


Parameters
handle- CA descrambler handle
status- running status as defined in the SDT
BOOLEAN STB_CAReleaseDescrambler ( U32BIT  handle)

Will be called when a CA descrambler is no longer required.


Parameters
handle- CA descrambler handle being released
Returns
TRUE if the descrambler is released, FALSE otherwise
void STB_CAReleaseRecordingPids ( U16BIT *  pid_array,
U16BIT  num_pids 
)

Called to free the array of PIDs allocated by STB_CAGetRecordingPids.


Parameters
pid_array- array of PIDs to be freed
num_pids- number of PIDs in the array
void STB_CAReportBAT ( U32BIT  handle,
U8BIT *  bat_data,
U16BIT  data_len 
)

When there's an update to the BAT, the updated BAT will be reported to the CA system using this function. The data is provided a section at a time, rather than as a complete table.


Parameters
handle- CA descrambler handle
bat_data- raw BAT section data
data_len- number of bytes in the BAT section
void STB_CAReportCAT ( U32BIT  handle,
U8BIT *  cat_data,
U16BIT  data_len 
)

When there's an update to the CAT for a service, the updated CAT will be reported to the CA system using this function. The data is provided a section at a time, rather than as a complete table.


Parameters
handle- CA descrambler handle
cat_data- raw CAT section data
data_len- number of bytes in the CAT section
void STB_CAReportNIT ( U32BIT  handle,
U8BIT *  nit_data,
U16BIT  data_len 
)

When there's an update to the NIT, the updated NIT will be reported to the CA system using this function. The data is provided a section at a time, rather than as a complete table.


Parameters
handle- CA descrambler handle
nit_data- raw NIT section data
data_len- number of bytes in the NIT section
void STB_CAReportPMT ( U32BIT  handle,
U8BIT *  pmt_data,
U16BIT  data_len 
)

When there's an update to the PMT for a service, the updated PMT will be reported to the CA system using this function.


Parameters
handle- CA descrambler handle
pmt_data- raw PMT section data
data_len- number of bytes in the PMT