DVBCore  20.3.0
DVBCore Documentation
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

Definition in file ca_glue.h.

Function Documentation

◆ STB_CAAcquireDescrambler()

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

Definition at line 87 of file ca_glue.c.

◆ STB_CADecodeADStatus()

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

Definition at line 277 of file ca_glue.c.

◆ STB_CADecodeAudioStatus()

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

Definition at line 260 of file ca_glue.c.

◆ STB_CADecodeVideoStatus()

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

Definition at line 243 of file ca_glue.c.

◆ STB_CADescramblerRequiredForPlayback()

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

Definition at line 315 of file ca_glue.c.

◆ STB_CADescramblerRequiredForRecording()

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

Definition at line 336 of file ca_glue.c.

◆ STB_CADescrambleServiceStart()

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

Definition at line 129 of file ca_glue.c.

◆ STB_CADescrambleServiceStop()

void STB_CADescrambleServiceStop ( U32BIT  handle)

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


Parameters
handle- CA descrambler handle

Definition at line 144 of file ca_glue.c.

◆ STB_CAGetRecordingPids()

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

Definition at line 359 of file ca_glue.c.

◆ STB_CAInitialise()

BOOLEAN STB_CAInitialise ( void  )

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


Returns
TRUE if initialisation is successful, FALSE otherwise

Definition at line 61 of file ca_glue.c.

◆ STB_CANotifyRecordingStatus()

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

Definition at line 399 of file ca_glue.c.

◆ STB_CANotifyRunningStatus()

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

Definition at line 296 of file ca_glue.c.

◆ STB_CAReleaseDescrambler()

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

Definition at line 111 of file ca_glue.c.

◆ STB_CAReleaseRecordingPids()

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

Definition at line 382 of file ca_glue.c.

◆ STB_CAReportBAT()

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

Definition at line 204 of file ca_glue.c.

◆ STB_CAReportCAT()

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

Definition at line 183 of file ca_glue.c.

◆ STB_CAReportNIT()

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

Definition at line 225 of file ca_glue.c.

◆ STB_CAReportPMT()

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

Definition at line 162 of file ca_glue.c.