Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 1 | /** |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 2 | * \file |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 3 | * \brief Record module |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 4 | */ |
| 5 | |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 6 | #ifndef _DVR_RECORD_H_ |
| 7 | #define _DVR_RECORD_H_ |
| 8 | |
| 9 | #ifdef __cplusplus |
| 10 | extern "C" { |
| 11 | #endif |
| 12 | |
Pengfei Liu | b038b6a | 2020-01-14 15:57:01 +0800 | [diff] [blame] | 13 | #include "dvr_types.h" |
Pengfei Liu | 47ed6c9 | 2020-01-17 11:23:41 +0800 | [diff] [blame] | 14 | #include "dvr_crypto.h" |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 15 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 16 | /**\brief DVR record handle*/ |
Gong Ke | 3489c0f | 2020-01-16 18:11:44 +0800 | [diff] [blame] | 17 | typedef void* DVR_RecordHandle_t; |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 18 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 19 | /**\brief DVR record state*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 20 | typedef enum { |
Pengfei Liu | 47ed6c9 | 2020-01-17 11:23:41 +0800 | [diff] [blame] | 21 | DVR_RECORD_STATE_OPENED, /**< Record state is opened*/ |
| 22 | DVR_RECORD_STATE_STARTED, /**< Record state is started*/ |
| 23 | DVR_RECORD_STATE_STOPPED, /**< Record state is stopped*/ |
| 24 | DVR_RECORD_STATE_CLOSED, /**< Record state is closed*/ |
hualing chen | 03fd494 | 2021-07-15 15:56:41 +0800 | [diff] [blame] | 25 | DVR_RECORD_STATE_PAUSE, /**< Record state is pause*/ |
Pengfei Liu | 47ed6c9 | 2020-01-17 11:23:41 +0800 | [diff] [blame] | 26 | } DVR_RecordState_t; |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 27 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 28 | /**\brief DVR record pid action*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 29 | typedef enum |
| 30 | { |
Pengfei Liu | 47ed6c9 | 2020-01-17 11:23:41 +0800 | [diff] [blame] | 31 | DVR_RECORD_PID_CREATE, /**< Create a new pid used to record*/ |
| 32 | DVR_RECORD_PID_KEEP, /**< Indicate this pid keep last state*/ |
| 33 | DVR_RECORD_PID_CLOSE /**< Close this pid record*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 34 | } DVR_RecordPidAction_t; |
| 35 | |
Yahui Han | 1fbf329 | 2021-11-08 18:17:19 +0800 | [diff] [blame] | 36 | /**\brief DVR record flag*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 37 | typedef enum { |
| 38 | DVR_RECORD_FLAG_SCRAMBLED = (1 << 0), |
| 39 | DVR_RECORD_FLAG_ACCURATE = (1 << 1), |
Zhiqiang Han | 2f019af | 2023-08-31 11:12:02 +0800 | [diff] [blame^] | 40 | DVR_RECORD_FLAG_DATAOUT = (1 << 2), |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 41 | } DVR_RecordFlag_t; |
| 42 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 43 | /**\brief DVR crypto parity flag*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 44 | typedef enum { |
Pengfei Liu | 47ed6c9 | 2020-01-17 11:23:41 +0800 | [diff] [blame] | 45 | DVR_CRYPTO_PARITY_CLEAR, /**< Current period is clear*/ |
| 46 | DVR_CRYPTO_PARITY_ODD, /**< Current period is ODD*/ |
| 47 | DVR_CRYPTO_PARITY_EVEN, /**< Current period is EVEN*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 48 | } DVR_CryptoParity_t; |
| 49 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 50 | /**\brief DVR crypto filter type*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 51 | typedef enum { |
Pengfei Liu | 47ed6c9 | 2020-01-17 11:23:41 +0800 | [diff] [blame] | 52 | DVR_CRYPTO_FILTER_TYPE_AUDIO, /**< Indicate current notification concerns audio packets*/ |
| 53 | DVR_CRYPTO_FILTER_TYPE_VIDEO, /**< Indicate current notification concerns video packets*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 54 | } DVR_CryptoFilterType_t; |
| 55 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 56 | /**\brief DVR record event*/ |
| 57 | typedef enum { |
| 58 | DVR_RECORD_EVENT_ERROR = 0x1000, /**< Signal a critical DVR error*/ |
| 59 | DVR_RECORD_EVENT_STATUS = 0x1001, /**< Signal the current record status which reach a certain size*/ |
| 60 | DVR_RECORD_EVENT_SYNC_END = 0x1002, /**< Signal that data sync has ended*/ |
| 61 | DVR_RECORD_EVENT_CRYPTO_STATUS = 0x2001, /**< Signal the current crypto status*/ |
hualing chen | 626204e | 2020-04-07 11:55:08 +0800 | [diff] [blame] | 62 | DVR_RECORD_EVENT_WRITE_ERROR = 0x9001, /**< Signal the current crypto status*/ |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 63 | } DVR_RecordEvent_t; |
| 64 | |
| 65 | /**\brief DVR crypto period information*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 66 | typedef struct |
| 67 | { |
Pengfei Liu | 47ed6c9 | 2020-01-17 11:23:41 +0800 | [diff] [blame] | 68 | DVR_Bool_t transition; /**< DVR_TRUE is transition, DVR_FALSE is not transition. At the start of a recording this shall be set to DVR_TRUE*/ |
| 69 | DVR_CryptoParity_t parity; /**< The crypto parity at the ts_offset*/ |
Wentao MA | e8ba517 | 2022-08-09 11:18:17 +0800 | [diff] [blame] | 70 | loff_t ts_offset; /**< TS packet offset corresponding to this crypto period*/ |
Pengfei Liu | 47ed6c9 | 2020-01-17 11:23:41 +0800 | [diff] [blame] | 71 | DVR_CryptoFilterType_t filter_type; /**< Indicate this notification concerns audio or video*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 72 | } DVR_CryptoPeriodInfo_t; |
| 73 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 74 | /**\brief DVR crypto period information*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 75 | typedef struct { |
Wentao MA | e8ba517 | 2022-08-09 11:18:17 +0800 | [diff] [blame] | 76 | uint64_t interval_bytes; /**< The interval between two regular notification of crypto period. For example, if the current segment is always ODD for a long time, record module would notify the current crypto period status when segment size reached the interval_bytes*/ |
| 77 | DVR_Bool_t notify_clear_periods; /**< Indicate whether it shall track the transition to clear period. DVR_TRUE means it shall not notify clear periods, but only transition between ODD and EVEN. DVR_FALSE means it shall notify transition between ODD, EVEN and clear periods*/ |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 78 | } DVR_CryptoPeriod_t; |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 79 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 80 | /**\brief DVR record event notify function*/ |
| 81 | typedef DVR_Result_t (*DVR_RecordEventFunction_t) (DVR_RecordEvent_t event, void *params, void *userdata); |
| 82 | |
| 83 | /**\brief DVR record open parameters*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 84 | typedef struct { |
Yahui Han | ce15e9c | 2020-12-08 18:08:32 +0800 | [diff] [blame] | 85 | int fend_dev_id; /**< Frontend device id */ |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 86 | int dmx_dev_id; /**< Demux device id*/ |
pengfei.liu | ab5a226 | 2020-02-14 17:33:40 +0800 | [diff] [blame] | 87 | int data_from_memory; /**< Indicate record data from demux or memory*/ |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 88 | DVR_RecordFlag_t flags; /**< DVR record flag*/ |
pengfei.liu | 07ddc8a | 2020-03-24 23:36:53 +0800 | [diff] [blame] | 89 | int flush_size; /**< DVR record interrupt flush size*/ |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 90 | DVR_RecordEventFunction_t event_fn; /**< DVR record event callback function*/ |
| 91 | void *event_userdata; /**< DVR event userdata*/ |
Wentao MA | e8ba517 | 2022-08-09 11:18:17 +0800 | [diff] [blame] | 92 | size_t notification_size; /**< DVR record notification size, record module would send a notification when the size of current segment is multiple of this value. Put 0 in this argument if you don't want to receive the notification*/ |
Yahui Han | 1fbf329 | 2021-11-08 18:17:19 +0800 | [diff] [blame] | 93 | uint8_t *clearkey; /**< key for encrypted PVR on FTA.*/ |
Wentao MA | e8ba517 | 2022-08-09 11:18:17 +0800 | [diff] [blame] | 94 | uint8_t *cleariv; /**< iv for encrypted PVR on FTA.*/ |
Yahui Han | 1fbf329 | 2021-11-08 18:17:19 +0800 | [diff] [blame] | 95 | uint32_t keylen; /**< key/iv length.*/ |
hualing chen | 03fd494 | 2021-07-15 15:56:41 +0800 | [diff] [blame] | 96 | int ringbuf_size; /**< DVR record ring buf size*/ |
Wentao MA | e8ba517 | 2022-08-09 11:18:17 +0800 | [diff] [blame] | 97 | int notification_time; /**< DVR record notification time, record module would send a notification when the size of current segment is multiple of this value. Put 0 in this argument if you don't want to receive the notification*/ |
wentao.ma | 35a69d4 | 2022-03-10 18:08:40 +0800 | [diff] [blame] | 98 | DVR_Bool_t force_sysclock; /**< If ture, force to use system clock as PVR index time source. If false, libdvr can determine index time source based on actual situation*/ |
Wentao MA | eeffdb0 | 2022-06-27 16:34:35 +0800 | [diff] [blame] | 99 | loff_t guarded_segment_size; /**< Guarded segment size in bytes. Libdvr will be forcely stopped to write anymore if current segment reaches this size*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 100 | } DVR_RecordOpenParams_t; |
| 101 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 102 | /**\brief DVR record segment start parameters*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 103 | typedef struct { |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 104 | uint64_t segment_id; /**< Segment id*/ |
| 105 | uint32_t nb_pids; /**< Number of pids*/ |
| 106 | DVR_StreamPid_t pids[DVR_MAX_RECORD_PIDS_COUNT]; /**< Pids information*/ |
| 107 | DVR_RecordPidAction_t pid_action[DVR_MAX_RECORD_PIDS_COUNT]; /**< Pids action*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 108 | } DVR_RecordSegmentStartParams_t; |
| 109 | |
pengfei.liu | 07ddc8a | 2020-03-24 23:36:53 +0800 | [diff] [blame] | 110 | /**\brief DVR record encrypt function*/ |
| 111 | typedef DVR_Result_t (*DVR_RecordEncryptFunction_t) (uint8_t *p_in, |
| 112 | uint32_t in_len, |
| 113 | uint8_t *p_out, |
| 114 | uint32_t *p_out_len, |
| 115 | void *userdata); |
| 116 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 117 | /**\brief DVR record current status*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 118 | typedef struct { |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 119 | DVR_RecordState_t state; /**< DVR record state*/ |
| 120 | DVR_RecordSegmentInfo_t info; /**< DVR record segment information*/ |
| 121 | } DVR_RecordStatus_t; |
| 122 | |
| 123 | /**\brief DVR record start parameters*/ |
| 124 | typedef struct { |
| 125 | char location[DVR_MAX_LOCATION_SIZE]; /**< DVR record file location*/ |
| 126 | DVR_RecordSegmentStartParams_t segment; /**< DVR record segment start parameters*/ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 127 | } DVR_RecordStartParams_t; |
| 128 | |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 129 | /**\brief Open a recording session for a target giving some open parameters |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 130 | * \param[out] p_handle Return the handle of the newly created dvr session |
| 131 | * \param[in] params Open parameters |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 132 | * \return DVR_SUCCESS on success |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 133 | * \return error code on failure |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 134 | */ |
| 135 | int dvr_record_open(DVR_RecordHandle_t *p_handle, DVR_RecordOpenParams_t *params); |
| 136 | |
| 137 | /**\brief Close a recording session |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 138 | * \param[in] handle DVR recording session handle |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 139 | * \return DVR_SUCCESS on success |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 140 | * \return error code on failure |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 141 | */ |
| 142 | int dvr_record_close(DVR_RecordHandle_t handle); |
| 143 | |
hualing chen | 03fd494 | 2021-07-15 15:56:41 +0800 | [diff] [blame] | 144 | /**\brief pause recording on a segment |
| 145 | * \param[in] handle DVR recording session handle |
| 146 | * \return DVR_SUCCESS on success |
| 147 | * \return error code on failure |
| 148 | */ |
| 149 | int dvr_record_pause(DVR_RecordHandle_t handle); |
| 150 | |
| 151 | /**\brief resume recording on a segment |
| 152 | * \param[in] handle DVR recording session handle |
| 153 | * \return DVR_SUCCESS on success |
| 154 | * \return error code on failure |
| 155 | */ |
| 156 | int dvr_record_resume(DVR_RecordHandle_t handle); |
| 157 | |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 158 | /**\brief Start recording on a segment |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 159 | * \param[in] handle DVR recording session handle |
| 160 | * \param[in] params DVR start parameters |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 161 | * \return DVR_SUCCESS on success |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 162 | * \return error code on failure |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 163 | */ |
| 164 | int dvr_record_start_segment(DVR_RecordHandle_t handle, DVR_RecordStartParams_t *params); |
| 165 | |
| 166 | /**\brief Stop the ongoing segment and start recording a new segment |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 167 | * \param[in] handle DVR recording session handle |
| 168 | * \param[in] params DVR start parameters |
| 169 | * \param[out] p_info DVR record segment information |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 170 | * \return DVR_SUCCESS on success |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 171 | * \return error code on failure |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 172 | */ |
| 173 | int dvr_record_next_segment(DVR_RecordHandle_t handle, DVR_RecordStartParams_t *params, DVR_RecordSegmentInfo_t *p_info); |
| 174 | |
| 175 | /**\brief Stop the ongoing segment |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 176 | * \param[in] handle DVR recording session handle |
| 177 | * \param[out] p_info DVR record segment information |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 178 | * \return DVR_SUCCESS on success |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 179 | * \return error code on failure |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 180 | */ |
| 181 | int dvr_record_stop_segment(DVR_RecordHandle_t handle, DVR_RecordSegmentInfo_t *p_info); |
| 182 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 183 | /**\brief Resume the recording on a segment |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 184 | * \param[in] handle DVR recording session handle |
| 185 | * \param[in] params DVR start parameters |
| 186 | * \param[inout] p_resume_size HAL propose a resume size as a input parameter and output is the real resume size |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 187 | * \return DVR_SUCCESS on success |
| 188 | * \return error code on failure |
| 189 | */ |
| 190 | int dvr_record_resume_segment(DVR_RecordHandle_t handle, DVR_RecordStartParams_t *params, uint64_t *p_resume_size); |
| 191 | |
pengfei.liu | ab5a226 | 2020-02-14 17:33:40 +0800 | [diff] [blame] | 192 | /**\brief DVR record write data, used for VOD mode |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 193 | * \param[in] handle DVR recording session handle |
Wentao MA | e8ba517 | 2022-08-09 11:18:17 +0800 | [diff] [blame] | 194 | * \param[in] buffer The record data buffer |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 195 | * \param[in] len The record data length |
pengfei.liu | ab5a226 | 2020-02-14 17:33:40 +0800 | [diff] [blame] | 196 | * \return DVR_SUCCESS on success |
| 197 | * \return error code on failure |
| 198 | */ |
| 199 | int dvr_record_write(DVR_RecordHandle_t handle, void *buffer, uint32_t len); |
| 200 | |
| 201 | /**\brief DVR record get status |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 202 | * \param[in] handle DVR recording session handle |
| 203 | * \param[out] p_status Return current DVR record status |
pengfei.liu | ab5a226 | 2020-02-14 17:33:40 +0800 | [diff] [blame] | 204 | * \return DVR_SUCCESS on success |
| 205 | * \return error code on failure |
| 206 | */ |
| 207 | int dvr_record_get_status(DVR_RecordHandle_t handle, DVR_RecordStatus_t *p_status); |
| 208 | |
pengfei.liu | 07ddc8a | 2020-03-24 23:36:53 +0800 | [diff] [blame] | 209 | /**\brief Set DVR record encrypt function |
| 210 | * \param[in] handle, DVR recording session handle |
| 211 | * \param[in] func, DVR recording encrypt function |
| 212 | * \param[in] userdata, DVR record userdata from the caller |
| 213 | * \return DVR_SUCCESS on success |
| 214 | * \return error code on failure |
| 215 | */ |
pengfei.liu | 27cc4ec | 2020-04-03 16:28:16 +0800 | [diff] [blame] | 216 | int dvr_record_set_encrypt_callback(DVR_RecordHandle_t handle, DVR_CryptoFunction_t func, void *userdata); |
pengfei.liu | 07ddc8a | 2020-03-24 23:36:53 +0800 | [diff] [blame] | 217 | |
| 218 | /**\brief Set DVR record secure buffer used for protect the secure content |
| 219 | * \param[in] handle, DVR recording session handle |
| 220 | * \param[in] p_secure_buf, Secure buffer address which can NOT access by ACPU |
| 221 | * \param[in] len, Secure buffer length |
| 222 | * \return DVR_SUCCESS on success |
| 223 | * \return error code on failure |
| 224 | */ |
| 225 | int dvr_record_set_secure_buffer(DVR_RecordHandle_t handle, uint8_t *p_secure_buf, uint32_t len); |
| 226 | |
hualing chen | 4fe3bee | 2020-10-23 13:58:52 +0800 | [diff] [blame] | 227 | /** |
| 228 | * check record mode is secure or free. |
| 229 | * \param handle The record session handle. |
| 230 | * \retval 1:secure 0: free mode. |
| 231 | * \return secure or free. |
| 232 | */ |
| 233 | int dvr_record_is_secure_mode(DVR_RecordHandle_t handle); |
Wentao MA | f407203 | 2022-06-30 13:50:45 +0800 | [diff] [blame] | 234 | |
| 235 | /**\brief Turn on/off recording data discarding |
| 236 | * \param[in] handle, DVR recording session handle |
| 237 | * \param[in] discard, 0: normal processing, 1: discard coming recording data |
| 238 | * \return DVR_SUCCESS on success |
| 239 | * \return error code on failure |
| 240 | */ |
| 241 | int dvr_record_discard_coming_data(DVR_RecordHandle_t handle, DVR_Bool_t discard); |
| 242 | |
Zhiqiang Han | 2f019af | 2023-08-31 11:12:02 +0800 | [diff] [blame^] | 243 | /**\brief control the recording logic |
| 244 | * \param[in] handle, DVR recording session handle |
| 245 | * \param[in] cmd, command |
| 246 | * \param[in/out] data, parameters |
| 247 | * \param[in/out] size, size of parameters |
| 248 | * \return DVR_SUCCESS on success |
| 249 | * \return error code on failure |
| 250 | */ |
| 251 | int dvr_record_ioctl(DVR_RecordHandle_t handle, unsigned int cmd, void *data, size_t size); |
| 252 | |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 253 | #ifdef __cplusplus |
| 254 | } |
| 255 | #endif |
| 256 | |
| 257 | #endif /*END _DVR_RECORD_H_*/ |