123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- #ifndef _CIPLUS_RECORD_H_
- #define _CIPLUS_RECORD_H_
- #include "types.h"
- #include "middleware/dtv/dtvci/mid_dtvci.h"
- /*****************************************************************************
- ***************************functions for record******************************
- *****************************************************************************/
- /*****************************************************************************
- * Function Name: ciplus_record_event
- * Description: Used to update current event if any event had been arrived.
- * The new-arrived events are stored in local memory, and need
- * to be stored elsewhere in some moment
- * Parameters: none
- * Returns: 0 if no new event, 1 if new event arrived, -1 if error happened
- *****************************************************************************/
- int ciplus_record_event(int next_file_index);
- /*****************************************************************************
- * Function Name: ciplus_record_register_blankAV_callback
- * Description: Register callback function which will be call when live AV blanking
- * is required.
- * Parameters: callback funcion to be registered
- * Returns: 0 if success, -1 if error happened
- *****************************************************************************/
- int ciplus_record_register_blankAV_callback(void* callback);
- /*****************************************************************************
- * Function Name: ciplus_is_record_start_send
- * Description: Check whether record_start has been send or not
- * Parameters: none
- * Returns: TRUE if record start had been send in this recording,
- * FALSE otherwise
- *****************************************************************************/
- BOOL ciplus_is_record_start_send(void);
- /*****************************************************************************
- * Function Name: ciplus_reset_record_start_flag
- * Description: Reset record start flag, need to be called before recording
- * Parameters: none
- * Returns: 0 if success, -1 otherwise
- *****************************************************************************/
- int ciplus_reset_record_start_flag(void);
- /*****************************************************************************
- * Function Name: ciplus_record_send_record_start
- * Description: Send record start to CAM to signal CI+ protected content recording.
- * Need to be called once when CI+ protected contetn is to be recorded.
- * Parameters: mode - record mode: PVR, timeshift, unattended mode etc.
- * program_number - program number to be recorded
- * pin_data - pin code to be cached which may be used during recording
- * file_index - file index to record ciplus default URI
- * status - return by CAM to notice validation of recording
- * Returns: TRUE if success, FALSE otherwise
- *****************************************************************************/
- BOOL ciplus_record_send_record_start(E_STB_CI_OPERATING_MODE mode, U16BIT program_number,
- U8BIT *pin_data, int file_index, U8BIT *status);
- /*****************************************************************************
- * Function Name: ciplus_record_send_record_stop
- * Description: Send record stop to CAM to signal CI+ protected content recording.
- * Need to be called, if ciplus_record_send_record_start had been called,
- * in order to release previously allocated resource
- * Parameters: program_number - program number currently recording
- * status - return by CAM to notice status of record stop
- * Returns: TRUE if success, FALSE otherwise
- *****************************************************************************/
- BOOL ciplus_record_send_record_stop(U16BIT program_number, U8BIT *status);
- /*****************************************************************************
- * Function Name: ciplus_record_mode_change
- * Description: Send record stop to CAM to info that record mode had been changed
- * Parameters: mode - PVR, timeshift, unattended mode etc.
- * program_number - program number currently recording
- * Returns: TRUE if success, FALSE otherwise
- *****************************************************************************/
- BOOL ciplus_record_mode_change(E_STB_CI_OPERATING_MODE mode,U16BIT program_number);
- /*****************************************************************************
- * Function Name: ciplus_record_create_event_data
- * Description: Construct ciplus record event, which should be used when playback.
- * Parameter *data need to be freed by caller after used.
- * Parameters: data - returned value, pointer of data buffer start position
- * length - returned value, length of data
- * Returns: 0 if success, -1 otherwise
- *****************************************************************************/
- int ciplus_record_create_event_data(char** data, int* length);
- /*****************************************************************************
- * Function Name: print_record_event
- * Description: Print out total record event currently stored
- * Parameters: none
- * Returns: 0 if success, -1 if error happened
- *****************************************************************************/
- int print_record_events(void);
- /*****************************************************************************
- ***************************functions for playback****************************
- *****************************************************************************/
- /*****************************************************************************
- * Function Name: unblankAV_callback
- * Description: Callback function which will be called if AV blanking is not
- * required anymore.
- * Parameters: unblank - TRUE if AV blanking is required , FALSE otherwise
- * Returns: None
- *****************************************************************************/
- typedef void (*unblankAV_callback)(BOOL unblank);
- /*****************************************************************************
- * Function Name: data_update_callback
- * Description: Callback function which will be called if previous stored CI+
- * record event need to be updated.
- * Parameters: data - data buffer start position
- * length - length of data
- * Returns: None
- *****************************************************************************/
- typedef void (*data_update_callback)(void* data, int length);
- /*****************************************************************************
- * Function Name: ciplus_playback_initialize
- * Description: Initial function used to allocate resource
- * This function should be called before whenver ci+ protect
- * content is to be playbacked
- * Parameters: data - pointer to the start of event list data
- * length - length of data
- * unblankAV - callback function used to notice host to unblank AV
- * data_update - callback function used to notice host to update stored event list data
- * Returns: 0 if success, -1 if failed
- *****************************************************************************/
- int ciplus_playback_initialize(char* data, int length, unblankAV_callback unblankAV, data_update_callback data_update);
- /*****************************************************************************
- * Function Name: ciplus_playback_stop
- * Description: Function used to release resources which have been allocated
- * This function should be called whenver playback is terminate
- * if ciplus_playback_initialize has bee called.
- * Parameters: none
- * Returns: 0 if success, -1 if failed
- *****************************************************************************/
- int ciplus_playback_stop(void);
- /*****************************************************************************
- * Function Name: ciplus_playback_control_trick_mode
- * Description: Used to check whether this file portion need to control trick mode or not
- * Parameters: file_index - index of file to be check
- * Returns: TREU if control trick mode is enabled, FALSE otherwise
- *****************************************************************************/
- BOOL ciplus_playback_control_trick_mode(int file_index);
- /*****************************************************************************
- * Function Name: ciplus_playback_need_blankAV
- * Description: Used to check whether this file portion need to blank AV or not
- * Parameters: file_index - index of file to be check
- * Returns: TREU if AV blanking is needed, FALSE otherwise
- *****************************************************************************/
- BOOL ciplus_playback_need_blankAV(int file_index);
- /*****************************************************************************
- * Function Name: ciplus_playback_retention_limit
- * Description: Used to check whether this file portion has retension limit or not
- * Parameters: file_index - index of file to be check
- * days - returned value, number of days to live for this file
- * from the moment it was recorded
- * half_hours - returned value, number of half_hours(30mins) to live
- * for this file from the moment it was recorded
- * Returns: TREU if retension limit exist, FALSE otherwise
- *****************************************************************************/
- BOOL ciplus_playback_retention_limit(int file_index, int* days, int* half_hours);
- /*****************************************************************************
- * Function Name: print_playback_event
- * Description: Print out total playback event
- * Parameters: none
- * Returns: 0 if success, -1 if error happened
- *****************************************************************************/
- int print_playback_event(void);
- /*****************************************************************************
- * Function Name: ciplus_playback_have_event
- * Description: Detemine whether this file is ci plus protected content or not
- * Parameters: file_index
- * Returns: TRUE if CI plus protected content, FALSE if FTA file
- *****************************************************************************/
- BOOL ciplus_playback_have_event(int file_index);
- /*****************************************************************************
- * Function Name: ciplus_playback_get_license_playcount
- * Description: Obtain number of play count of a particular license specified
- * by file index.
- * Parameters: file_index - file index
- * play_count - pointer to license play count to be got
- * Returns: TRUE if play count got, FALSE otherwise
- *****************************************************************************/
- BOOL ciplus_playback_get_license_playcount(int file_index, int* play_count);
- #endif
|