DVBCore
1.0
Open source DVB engine
|
00001 /******************************************************************************* 00002 * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org) 00003 * Copyright © 2013 Ocean Blue Software Ltd 00004 * 00005 * This file is part of a DTVKit Software Component 00006 * You are permitted to copy, modify or distribute this file subject to the terms 00007 * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org 00008 * 00009 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 00010 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 00011 * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. 00012 * 00013 * If you or your organisation is not a member of DTVKit then you have access 00014 * to this source code outside of the terms of the licence agreement 00015 * and you are expected to delete this and any associated files immediately. 00016 * Further information on DTVKit, membership and terms can be found at www.dtvkit.org 00017 *******************************************************************************/ 00025 /* pre-processor mechanism so multiple inclusions don't cause compilation error*/ 00026 #ifndef __CA_GLUE_H 00027 #define __CA_GLUE_H 00028 00029 /*---Constant and macro definitions for public use-----------------------------*/ 00030 00031 /*---Enumerations for public use-----------------------------------------------*/ 00032 typedef enum 00033 { 00034 CA_DECODE_STATUS_STARTING, 00035 CA_DECODE_STATUS_STARTED, 00036 CA_DECODE_STATUS_STOPPED 00037 } E_CA_DECODE_STATUS; 00038 00039 /*---Global type defs for public use-------------------------------------------*/ 00040 00041 /*---Global Function prototypes for public use---------------------------------*/ 00042 00043 /*!************************************************************************** 00044 * @brief Called once on system startup to allow initialisation of the CA systems 00045 * @return TRUE if initialisation is successful, FALSE otherwise 00046 ****************************************************************************/ 00047 BOOLEAN STB_CAInitialise(void); 00048 00049 /*!************************************************************************** 00050 * @brief This function is used by the resource manager to acquire a CA descrambler 00051 * that's able to descramble a service that uses one of the CA systems 00052 * defined by the array of CA system IDs (ca_ids). If a descrambler is 00053 * available then a handle should be returned in 'handle' which will be 00054 * used in all future calls related to this descrambler. 00055 * If the CA software needs to set the demux descrambling keys, or create 00056 * any filters to monitor SI data, the given demux handle should be used. 00057 * @param demux - demux to be used if a descrambler is acquired 00058 * @param ca_ids - array of CA system IDs for the service 00059 * @param num_ca_ids - number of CA system IDs in the array 00060 * @param handle - pointer to return a handle to identify the acquired CA descrambler 00061 * @return TRUE if a descrambler is acquired, FALSE otherwise 00062 ****************************************************************************/ 00063 BOOLEAN STB_CAAcquireDescrambler(U8BIT demux, U16BIT *ca_ids, U16BIT num_ca_ids, U32BIT *handle); 00064 00065 /*!************************************************************************** 00066 * @brief Will be called when a CA descrambler is no longer required. 00067 * @param handle - CA descrambler handle being released 00068 * @return TRUE if the descrambler is released, FALSE otherwise 00069 ****************************************************************************/ 00070 BOOLEAN STB_CAReleaseDescrambler(U32BIT handle); 00071 00072 /*!************************************************************************** 00073 * @brief This function will be called when decoding of a service is about to start 00074 * and there's an associated descrambler. 00075 * @param handle - CA descrambler handle 00076 ****************************************************************************/ 00077 void STB_CADescrambleServiceStart(U32BIT handle); 00078 00079 /*!************************************************************************** 00080 * @brief This function will be called when decoding of a service is stopped 00081 * @param handle - CA descrambler handle 00082 ****************************************************************************/ 00083 void STB_CADescrambleServiceStop(U32BIT handle); 00084 00085 /*!************************************************************************** 00086 * @brief When there's an update to the PMT for a service, the updated PMT 00087 * will be reported to the CA system using this function. 00088 * @param handle - CA descrambler handle 00089 * @param pmt_data - raw PMT section data 00090 * @param data_len - number of bytes in the PMT 00091 ****************************************************************************/ 00092 void STB_CAReportPMT(U32BIT handle, U8BIT *pmt_data, U16BIT data_len); 00093 00094 /*!************************************************************************** 00095 * @brief When there's an update to the CAT for a service, the updated CAT 00096 * will be reported to the CA system using this function. The data is 00097 * provided a section at a time, rather than as a complete table. 00098 * @param handle - CA descrambler handle 00099 * @param cat_data - raw CAT section data 00100 * @param data_len - number of bytes in the CAT section 00101 ****************************************************************************/ 00102 void STB_CAReportCAT(U32BIT handle, U8BIT *cat_data, U16BIT data_len); 00103 00104 /*!************************************************************************** 00105 * @brief When there's an update to the BAT, the updated BAT will be reported 00106 * to the CA system using this function. The data is provided a section 00107 * at a time, rather than as a complete table. 00108 * @param handle - CA descrambler handle 00109 * @param bat_data - raw BAT section data 00110 * @param data_len - number of bytes in the BAT section 00111 ****************************************************************************/ 00112 void STB_CAReportBAT(U32BIT handle, U8BIT *bat_data, U16BIT data_len); 00113 00114 /*!************************************************************************** 00115 * @brief When there's an update to the NIT, the updated NIT will be reported 00116 * to the CA system using this function. The data is provided a section 00117 * at a time, rather than as a complete table. 00118 * @param handle - CA descrambler handle 00119 * @param nit_data - raw NIT section data 00120 * @param data_len - number of bytes in the NIT section 00121 ****************************************************************************/ 00122 void STB_CAReportNIT(U32BIT handle, U8BIT *nit_data, U16BIT data_len); 00123 00124 /*!************************************************************************** 00125 * @brief Notifies the CA system of a change in the video decoding state 00126 * @param handle - CA descrambler handle 00127 * @param decode_status - decoding status 00128 ****************************************************************************/ 00129 void STB_CADecodeVideoStatus(U32BIT handle, E_CA_DECODE_STATUS decode_status); 00130 00131 /*!************************************************************************** 00132 * @brief Notifies the CA system of a change in the audio decoding state 00133 * @param handle - CA descrambler handle 00134 * @param decode_status - decoding status 00135 ****************************************************************************/ 00136 void STB_CADecodeAudioStatus(U32BIT handle, E_CA_DECODE_STATUS decode_status); 00137 00138 /*!************************************************************************** 00139 * @brief Notifies the CA system of a change in the AD decoding state 00140 * @param handle - CA descrambler handle 00141 * @param decode_status - decoding status 00142 ****************************************************************************/ 00143 void STB_CADecodeADStatus(U32BIT handle, E_CA_DECODE_STATUS decode_status); 00144 00145 /*!************************************************************************** 00146 * @brief This function will be called when there's a change to the running status 00147 * of a service being descrambled as indicated by the running_status field 00148 * in the SDT. 00149 * @param handle - CA descrambler handle 00150 * @param status - running status as defined in the SDT 00151 ****************************************************************************/ 00152 void STB_CANotifyRunningStatus(U32BIT handle, U8BIT status); 00153 00154 /*!************************************************************************** 00155 * @brief This function works out whether a CA descrambler is required to playback 00156 * a recording with one of the given CA system IDs. 00157 * @param ca_ids - array of CA system IDs 00158 * @param num_ca_ids - number of CA system IDs in the array 00159 * @return TRUE if a CA descrambler is required, FALSE otherwise 00160 ****************************************************************************/ 00161 BOOLEAN STB_CADescramblerRequiredForPlayback(U16BIT *ca_ids, U16BIT num_ca_ids); 00162 00163 /*!************************************************************************** 00164 * @brief This function works out whether a CA descrambler is required to record 00165 * a service with one of the given CA system IDs. 00166 * @param ca_ids - array of CA system IDs 00167 * @param num_ca_ids - number of CA system IDs in the array 00168 * @return TRUE if a CA descrambler is required, FALSE otherwise 00169 ****************************************************************************/ 00170 BOOLEAN STB_CADescramblerRequiredForRecording(U16BIT *ca_ids, U16BIT num_ca_ids); 00171 00172 /*!************************************************************************** 00173 * @brief This function is called to get an array of PIDs that need to be recorded 00174 * for the CA system required for the given PMT. The array must be allocated 00175 * by this function, which also returns the number of items in the array. 00176 * @param pmt_data - raw PMT section data 00177 * @param pid_array - pointer to an array allocated by this function on return, 00178 * containing the PIDs to be recorded 00179 * @return the number of PIDs in the returned array 00180 ****************************************************************************/ 00181 U16BIT STB_CAGetRecordingPids(U8BIT *pmt_data, U16BIT **pid_array); 00182 00183 /*!************************************************************************** 00184 * @brief Called to free the array of PIDs allocated by STB_CAGetRecordingPids. 00185 * @param pid_array - array of PIDs to be freed 00186 * @param num_pids - number of PIDs in the array 00187 ****************************************************************************/ 00188 void STB_CAReleaseRecordingPids(U16BIT *pid_array, U16BIT num_pids); 00189 00190 #endif /* __CA_GLUE_H */ 00191 00192 /****************************************************************************** 00193 ** End of file 00194 ******************************************************************************/