Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 1 | /** |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 2 | * \mainpage Amlogic DVR library |
| 3 | * |
| 4 | * \section Introduction |
| 5 | * "libdvr" is a library provides basic DVR functions used by Amlogic platform. |
| 6 | * It supports: |
| 7 | * \li Record |
| 8 | * \li Playback |
| 9 | * \li Index file generated |
| 10 | * \li Segment split |
| 11 | * \li Encrypt and decrypt |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 12 | * |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 13 | * \file |
Gong Ke | 497c4c2 | 2020-03-20 10:15:42 +0800 | [diff] [blame] | 14 | * \brief libdvr wrapper layer |
| 15 | * |
| 16 | * Wrapper layer is upper layer of libdvr. |
| 17 | * It is on top of dvr_record and dvr_playback. |
| 18 | * It supports: |
| 19 | * \li Separate record segments automatically. |
| 20 | * \li Load segments automatically. |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 21 | */ |
| 22 | |
| 23 | #ifndef DVR_WRAPPER_H_ |
| 24 | #define DVR_WRAPPER_H_ |
| 25 | |
| 26 | #include "dvr_types.h" |
| 27 | #include "dvr_crypto.h" |
| 28 | #include "dvr_playback.h" |
| 29 | #include "dvr_record.h" |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | extern "C" { |
| 33 | #endif |
| 34 | |
| 35 | /**Record wrapper handle.*/ |
| 36 | typedef void* DVR_WrapperRecord_t; |
| 37 | /**Playback wrapper handle.*/ |
| 38 | typedef void* DVR_WrapperPlayback_t; |
| 39 | |
Zhiqiang Han | 2d8cd82 | 2020-03-16 13:58:10 +0800 | [diff] [blame] | 40 | typedef void* Playback_DeviceHandle_t; |
| 41 | |
| 42 | typedef struct { |
| 43 | time_t time; /**< time duration, unit on ms*/ |
| 44 | loff_t size; /**< size*/ |
| 45 | uint32_t pkts; /**< number of ts packets*/ |
| 46 | } DVR_WrapperInfo_t; |
| 47 | |
| 48 | typedef struct { |
| 49 | uint32_t nb_pids; /**< Number of PIDs.*/ |
| 50 | DVR_StreamPid_t pids[DVR_MAX_RECORD_PIDS_COUNT]; /**< PIDs to be recorded.*/ |
| 51 | } DVR_WrapperPidsInfo_t; |
| 52 | |
| 53 | typedef struct { |
Zhiqiang Han | aeb0c71 | 2020-04-30 15:17:26 +0800 | [diff] [blame] | 54 | DVR_PlaybackPlayState_t state; /**< DVR playback state*/ |
| 55 | DVR_WrapperInfo_t info_cur; /**< DVR playback current information*/ |
Wentao MA | e8ba517 | 2022-08-09 11:18:17 +0800 | [diff] [blame] | 56 | DVR_WrapperInfo_t info_full; /**< DVR playback total(non-obsolete) information*/ |
Zhiqiang Han | aeb0c71 | 2020-04-30 15:17:26 +0800 | [diff] [blame] | 57 | DVR_PlaybackPids_t pids; /**< DVR playback pids information*/ |
| 58 | float speed; /**< DVR playback current speed*/ |
| 59 | DVR_PlaybackSegmentFlag_t flags; /**< DVR playback flags*/ |
| 60 | DVR_WrapperInfo_t info_obsolete; /**< DVR playback obsolete information, take into account for timeshift*/ |
hualing chen | 56c0a16 | 2022-01-27 17:01:50 +0800 | [diff] [blame] | 61 | DVR_WrapperInfo_t disguised_info_obsolete; /**< DVR playback disguised obsolete information, take into account for timeshift*/ |
Zhiqiang Han | 2d8cd82 | 2020-03-16 13:58:10 +0800 | [diff] [blame] | 62 | } DVR_WrapperPlaybackStatus_t; |
| 63 | |
| 64 | typedef struct { |
| 65 | DVR_RecordState_t state; /**< DVR record state*/ |
| 66 | DVR_WrapperInfo_t info; /**< DVR record information*/ |
| 67 | DVR_WrapperPidsInfo_t pids; /**< DVR record pids info*/ |
Zhiqiang Han | aeb0c71 | 2020-04-30 15:17:26 +0800 | [diff] [blame] | 68 | DVR_WrapperInfo_t info_obsolete; /**< DVR record obsolete information, take into account for timeshift*/ |
Zhiqiang Han | 2d8cd82 | 2020-03-16 13:58:10 +0800 | [diff] [blame] | 69 | } DVR_WrapperRecordStatus_t; |
| 70 | |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 71 | /**Record wrapper open parameters.*/ |
| 72 | typedef struct { |
Yahui Han | ce15e9c | 2020-12-08 18:08:32 +0800 | [diff] [blame] | 73 | int fend_dev_id; /**< Frontend device's index.*/ |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 74 | int dmx_dev_id; /**< Demux device's index.*/ |
| 75 | char location[DVR_MAX_LOCATION_SIZE]; /**< Location of the record file.*/ |
| 76 | DVR_Bool_t is_timeshift; /**< The record file is used by timeshift.*/ |
| 77 | loff_t segment_size; /**< Segment file's size.*/ |
Zhiqiang Han | aeb0c71 | 2020-04-30 15:17:26 +0800 | [diff] [blame] | 78 | loff_t max_size; /**< Maximum record file size in bytes(for timeshift).*/ |
| 79 | time_t max_time; /**< Maximum record time in milliseconds(for timeshift).*/ |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 80 | DVR_RecordFlag_t flags; /**< Flags.*/ |
| 81 | DVR_CryptoPeriod_t crypto_period; /**< Crypto period.*/ |
| 82 | DVR_CryptoFunction_t crypto_fn; /**< Crypto callback function.*/ |
Yahui Han | 1fbf329 | 2021-11-08 18:17:19 +0800 | [diff] [blame] | 83 | void *crypto_data; /**< User data of crypto function.*/ |
| 84 | uint8_t *clearkey; /**< key for encrypted PVR on FTA.*/ |
Wentao MA | e8ba517 | 2022-08-09 11:18:17 +0800 | [diff] [blame] | 85 | uint8_t *cleariv; /**< iv for encrypted PVR on FTA.*/ |
Yahui Han | 1fbf329 | 2021-11-08 18:17:19 +0800 | [diff] [blame] | 86 | uint32_t keylen; /**< key/iv length.*/ |
| 87 | DVR_RecordEventFunction_t event_fn; /**< DVR record event callback function.*/ |
| 88 | void *event_userdata; /**< DVR event userdata.*/ |
| 89 | int flush_size; /**< DVR flush size.*/ |
| 90 | int ringbuf_size; /**< DVR ringbuf size.*/ |
wentao.ma | 35a69d4 | 2022-03-10 18:08:40 +0800 | [diff] [blame] | 91 | 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*/ |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 92 | } DVR_WrapperRecordOpenParams_t; |
| 93 | |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 94 | typedef struct { |
Zhiqiang Han | 2d8cd82 | 2020-03-16 13:58:10 +0800 | [diff] [blame] | 95 | DVR_WrapperPidsInfo_t pids_info; |
Wentao MA | e8ba517 | 2022-08-09 11:18:17 +0800 | [diff] [blame] | 96 | int save_rec_file; /**< save rec file with same location,default is 0.*/ |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 97 | } DVR_WrapperRecordStartParams_t; |
| 98 | |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 99 | typedef struct { |
| 100 | uint32_t nb_pids; /**< Number of PID actions.*/ |
| 101 | DVR_StreamPid_t pids[DVR_MAX_RECORD_PIDS_COUNT]; /**< PIDs.*/ |
| 102 | DVR_RecordPidAction_t pid_action[DVR_MAX_RECORD_PIDS_COUNT]; /**< Actions.*/ |
| 103 | } DVR_WrapperUpdatePidsParams_t; |
| 104 | |
| 105 | /**Playback wrapper open parameters.*/ |
| 106 | typedef struct { |
| 107 | int dmx_dev_id; /**< playback used dmx device index*/ |
| 108 | char location[DVR_MAX_LOCATION_SIZE]; /**< Location of the record file.*/ |
| 109 | int block_size; /**< playback inject block size*/ |
| 110 | DVR_Bool_t is_timeshift; /**< 0:playback mode, 1 : is timeshift mode*/ |
| 111 | Playback_DeviceHandle_t playback_handle; /**< Playback device handle.*/ |
| 112 | DVR_CryptoFunction_t crypto_fn; /**< Crypto function.*/ |
Yahui Han | 1fbf329 | 2021-11-08 18:17:19 +0800 | [diff] [blame] | 113 | void *crypto_data; /**< Crypto function's user data.*/ |
| 114 | uint8_t *clearkey; /**< key for encrypted PVR on FTA.*/ |
Wentao MA | e8ba517 | 2022-08-09 11:18:17 +0800 | [diff] [blame] | 115 | uint8_t *cleariv; /**< iv for encrypted PVR on FTA.*/ |
Yahui Han | 1fbf329 | 2021-11-08 18:17:19 +0800 | [diff] [blame] | 116 | uint32_t keylen; /**< key/iv length.*/ |
Zhiqiang Han | 2d8cd82 | 2020-03-16 13:58:10 +0800 | [diff] [blame] | 117 | DVR_PlaybackEventFunction_t event_fn; /**< playback event callback function*/ |
| 118 | void *event_userdata; /**< event userdata*/ |
hualing chen | 90b3ae6 | 2021-03-30 10:49:28 +0800 | [diff] [blame] | 119 | DVR_Bool_t is_notify_time; /**< 0:not notify time, 1 : notify*/ |
| 120 | DVR_PlaybackVendor_t vendor; /**< vendor type*/ |
shenghui.geng | bec6a46 | 2023-01-12 15:21:02 +0800 | [diff] [blame] | 121 | DVR_Bool_t control_speed_enable; /**< 1: system clock, 0: libdvr can determine index time source based on actual situation*/ |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 122 | } DVR_WrapperPlaybackOpenParams_t; |
| 123 | |
| 124 | /** |
| 125 | * Open a new record wrapper. |
| 126 | * \param[out] rec Return the new record handle. |
| 127 | * \param params Record open parameters. |
| 128 | * \retval DVR_SUCCESS On success. |
| 129 | * \return Error code. |
| 130 | */ |
| 131 | int dvr_wrapper_open_record (DVR_WrapperRecord_t *rec, DVR_WrapperRecordOpenParams_t *params); |
| 132 | |
| 133 | /** |
| 134 | * Close an unused record wrapper. |
| 135 | * \param rec The record handle. |
| 136 | * \retval DVR_SUCCESS On success. |
| 137 | * \return Error code. |
| 138 | */ |
| 139 | int dvr_wrapper_close_record (DVR_WrapperRecord_t rec); |
| 140 | |
| 141 | /** |
| 142 | * Start recording. |
| 143 | * \param rec The record handle. |
| 144 | * \param params Record start parameters. |
| 145 | * \retval DVR_SUCCESS On success. |
| 146 | * \return Error code. |
| 147 | */ |
| 148 | int dvr_wrapper_start_record (DVR_WrapperRecord_t rec, DVR_WrapperRecordStartParams_t *params); |
| 149 | |
| 150 | /** |
| 151 | * Stop recording.. |
| 152 | * \param rec The record handle. |
| 153 | * \retval DVR_SUCCESS On success. |
| 154 | * \return Error code. |
| 155 | */ |
| 156 | int dvr_wrapper_stop_record (DVR_WrapperRecord_t rec); |
| 157 | |
| 158 | /** |
hualing chen | 03fd494 | 2021-07-15 15:56:41 +0800 | [diff] [blame] | 159 | * Pause recording.. |
| 160 | * \param rec The record handle. |
| 161 | * \retval DVR_SUCCESS On success. |
| 162 | * \return Error code. |
| 163 | */ |
| 164 | int dvr_wrapper_pause_record (DVR_WrapperRecord_t rec); |
| 165 | |
| 166 | /** |
| 167 | * Resume recording.. |
| 168 | * \param rec The record handle. |
| 169 | * \retval DVR_SUCCESS On success. |
| 170 | * \return Error code. |
| 171 | */ |
| 172 | int dvr_wrapper_resume_record (DVR_WrapperRecord_t rec); |
| 173 | |
| 174 | /** |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 175 | * Update the recording PIDs. |
| 176 | * \param rec The record handle. |
| 177 | * \param params The new PIDs. |
| 178 | * \retval DVR_SUCCESS On success. |
| 179 | * \return Error code. |
| 180 | */ |
| 181 | int dvr_wrapper_update_record_pids (DVR_WrapperRecord_t rec, DVR_WrapperUpdatePidsParams_t *params); |
| 182 | |
| 183 | /** |
Zhiqiang Han | 2d8cd82 | 2020-03-16 13:58:10 +0800 | [diff] [blame] | 184 | * Get the current recording status. |
| 185 | * \param rec The record handle. |
| 186 | * \param status The recording status returned. |
| 187 | * \retval DVR_SUCCESS On success. |
| 188 | * \return Error code. |
| 189 | */ |
| 190 | int dvr_wrapper_get_record_status (DVR_WrapperRecord_t rec, DVR_WrapperRecordStatus_t *status); |
| 191 | |
| 192 | /** |
hualing chen | 4fe3bee | 2020-10-23 13:58:52 +0800 | [diff] [blame] | 193 | * check record mode is secure or free. |
| 194 | * \param rec The record handle. |
| 195 | * \retval 1:secure 0: free mode. |
| 196 | * \return secure or free. |
| 197 | */ |
| 198 | int dvr_wrapper_record_is_secure_mode(DVR_WrapperRecord_t rec); |
| 199 | |
| 200 | /** |
hualing chen | 266b950 | 2020-04-04 17:39:39 +0800 | [diff] [blame] | 201 | * Set record secure buffer. |
| 202 | * \param rec The record handle. |
| 203 | * \param p_secure_buf record p_secure_buf addr. |
| 204 | * \param len record p_secure_buf len. |
| 205 | * \retval DVR_SUCCESS On success. |
| 206 | * \return Error code. |
| 207 | */ |
| 208 | int dvr_wrapper_set_record_secure_buffer (DVR_WrapperRecord_t rec, uint8_t *p_secure_buf, uint32_t len); |
| 209 | |
| 210 | /** |
| 211 | * Set record decrypt callback. |
| 212 | * \param rec The record handle. |
| 213 | * \param func record dec cb. |
| 214 | * \param userdata cb user data. |
| 215 | * \retval DVR_SUCCESS On success. |
| 216 | * \return Error code. |
| 217 | */ |
| 218 | int dvr_wrapper_set_record_decrypt_callback (DVR_WrapperRecord_t rec, DVR_CryptoFunction_t func, void *userdata); |
| 219 | |
| 220 | /** |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 221 | * Open a new playback wrapper handle. |
| 222 | * \param[out] playback Return the new playback handle. |
| 223 | * \param params Playback handle open parameters. |
| 224 | * \retval DVR_SUCCESS On success. |
| 225 | * \return Error code. |
| 226 | */ |
| 227 | int dvr_wrapper_open_playback (DVR_WrapperPlayback_t *playback, DVR_WrapperPlaybackOpenParams_t *params); |
| 228 | |
| 229 | /** |
| 230 | * Close a unused playback handle. |
| 231 | * \param playback The playback handle to be closed. |
| 232 | * \retval DVR_SUCCESS On success. |
| 233 | * \return Error code. |
| 234 | */ |
| 235 | int dvr_wrapper_close_playback (DVR_WrapperPlayback_t playback); |
| 236 | |
| 237 | /** |
| 238 | * Start playback. |
| 239 | * \param playback The playback handle. |
| 240 | * \param flags Playback flags. |
| 241 | * \retval DVR_SUCCESS On success. |
| 242 | * \return Error code. |
| 243 | */ |
Zhiqiang Han | 2d8cd82 | 2020-03-16 13:58:10 +0800 | [diff] [blame] | 244 | int dvr_wrapper_start_playback (DVR_WrapperPlayback_t playback, DVR_PlaybackFlag_t flags, DVR_PlaybackPids_t *p_pids); |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 245 | |
| 246 | /** |
| 247 | * Stop playback. |
| 248 | * \param playback The playback handle. |
| 249 | * \retval DVR_SUCCESS On success. |
| 250 | * \return Error code. |
| 251 | */ |
| 252 | int dvr_wrapper_stop_playback (DVR_WrapperPlayback_t playback); |
| 253 | |
| 254 | /** |
| 255 | * Pause the playback. |
| 256 | * \param playback The playback handle. |
| 257 | * \retval DVR_SUCCESS On success. |
| 258 | * \return Error code. |
| 259 | */ |
| 260 | int dvr_wrapper_pause_playback (DVR_WrapperPlayback_t playback); |
| 261 | |
| 262 | /** |
Zhiqiang Han | 2d8cd82 | 2020-03-16 13:58:10 +0800 | [diff] [blame] | 263 | * resume the playback. |
| 264 | * \param playback The playback handle. |
| 265 | * \retval DVR_SUCCESS On success. |
| 266 | * \return Error code. |
| 267 | */ |
| 268 | int dvr_wrapper_resume_playback (DVR_WrapperPlayback_t playback); |
| 269 | |
| 270 | /** |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 271 | * Set the playback speed. |
| 272 | * \param playback The playback handle. |
| 273 | * \param speed The new speed. |
| 274 | * \retval DVR_SUCCESS On success. |
| 275 | * \return Error code. |
| 276 | */ |
Zhiqiang Han | 2d8cd82 | 2020-03-16 13:58:10 +0800 | [diff] [blame] | 277 | int dvr_wrapper_set_playback_speed (DVR_WrapperPlayback_t playback, float speed); |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 278 | |
| 279 | /** |
hualing chen | 03fd494 | 2021-07-15 15:56:41 +0800 | [diff] [blame] | 280 | * set the current playback limit info. |
| 281 | * \param playback The playback handle. |
| 282 | * \param time The rec time in milliseconds. |
| 283 | * \param limit The rec limit time in milliseconds. |
| 284 | * \retval DVR_SUCCESS On success. |
| 285 | * \return Error code. |
| 286 | */ |
| 287 | int dvr_wrapper_setlimit_playback (DVR_WrapperPlayback_t playback, uint64_t time, int32_t limit); |
| 288 | |
| 289 | /** |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 290 | * Seek the current playback position. |
| 291 | * \param playback The playback handle. |
| 292 | * \param time_offset The current time in milliseconds. |
| 293 | * \retval DVR_SUCCESS On success. |
| 294 | * \return Error code. |
| 295 | */ |
Zhiqiang Han | 2d8cd82 | 2020-03-16 13:58:10 +0800 | [diff] [blame] | 296 | int dvr_wrapper_seek_playback (DVR_WrapperPlayback_t playback, uint32_t time_offset); |
| 297 | |
| 298 | /** |
| 299 | * Get the current playback status. |
| 300 | * \param playback The playback handle. |
| 301 | * \param status The playback status returned. |
| 302 | * \retval DVR_SUCCESS On success. |
| 303 | * \return Error code. |
| 304 | */ |
| 305 | int dvr_wrapper_get_playback_status (DVR_WrapperPlayback_t playback, DVR_WrapperPlaybackStatus_t *status); |
| 306 | |
| 307 | /** |
| 308 | * Update playback. |
| 309 | * \param playback The playback handle. |
| 310 | * \param flags Playback flags. |
| 311 | * \retval DVR_SUCCESS On success. |
| 312 | * \return Error code. |
| 313 | */ |
| 314 | int dvr_wrapper_update_playback (DVR_WrapperPlayback_t playback, DVR_PlaybackPids_t *p_pids); |
| 315 | |
hualing chen | 266b950 | 2020-04-04 17:39:39 +0800 | [diff] [blame] | 316 | /** |
hualing chen | a5f0322 | 2021-12-02 11:22:35 +0800 | [diff] [blame] | 317 | * only Update playback info. |
| 318 | * \param playback The playback handle. |
| 319 | * \param flags Playback flags. |
| 320 | * \retval DVR_SUCCESS On success. |
| 321 | * \return Error code. |
| 322 | */ |
| 323 | int dvr_wrapper_only_update_playback (DVR_WrapperPlayback_t playback, DVR_PlaybackPids_t *p_pids); |
| 324 | |
| 325 | /** |
hualing chen | 266b950 | 2020-04-04 17:39:39 +0800 | [diff] [blame] | 326 | * Set playback secure buffer. |
| 327 | * \param playback The playback handle. |
| 328 | * \param p_secure_buf Playback p_secure_buf addr. |
| 329 | * \param len Playback p_secure_buf len. |
| 330 | * \retval DVR_SUCCESS On success. |
| 331 | * \return Error code. |
| 332 | */ |
| 333 | int dvr_wrapper_set_secure_buffer (DVR_WrapperPlayback_t playback, uint8_t *p_secure_buf, uint32_t len); |
| 334 | |
| 335 | /** |
| 336 | * Set playback decrypt callback. |
| 337 | * \param playback The playback handle. |
| 338 | * \param func Playback dec cb. |
| 339 | * \param userdata cb user data. |
| 340 | * \retval DVR_SUCCESS On success. |
| 341 | * \return Error code. |
| 342 | */ |
| 343 | int dvr_wrapper_set_decrypt_callback (DVR_WrapperPlayback_t playback, DVR_CryptoFunction_t func, void *userdata); |
| 344 | |
Zhiqiang Han | 620b925 | 2021-11-09 14:23:20 +0800 | [diff] [blame] | 345 | /** |
| 346 | * Delete all info of segment whose location is "*location" |
| 347 | * \param[in] location The record of need del file's location |
| 348 | * \retval DVR_SUCCESS On success. |
| 349 | * \return Error code. |
| 350 | */ |
| 351 | int dvr_wrapper_segment_del_by_location (const char *location); |
| 352 | |
| 353 | /** |
| 354 | * Get the info of segment whose location is "*location" |
| 355 | * \param[in] location The record file's location |
| 356 | * \retval DVR_SUCCESS On success. |
| 357 | * \return Error code. |
| 358 | */ |
| 359 | int dvr_wrapper_segment_get_info_by_location (const char *location, DVR_WrapperInfo_t *p_info); |
| 360 | |
hualing chen | 002e5b9 | 2022-02-23 17:51:21 +0800 | [diff] [blame] | 361 | /** |
Wentao MA | e8ba517 | 2022-08-09 11:18:17 +0800 | [diff] [blame] | 362 | * Stop timeshift. |
hualing chen | 002e5b9 | 2022-02-23 17:51:21 +0800 | [diff] [blame] | 363 | * \param playback The playback handle. |
| 364 | * \retval DVR_SUCCESS On success. |
| 365 | * \return Error code. |
| 366 | */ |
| 367 | int dvr_wrapper_stop_timeshift (DVR_WrapperPlayback_t playback); |
| 368 | /** |
| 369 | * reStart timeshift. |
| 370 | * \param playback The playback handle. |
| 371 | * \param flags Playback flags. |
| 372 | * \param p_pids playback pids info |
| 373 | * \retval DVR_SUCCESS On success. |
| 374 | * \return Error code. |
| 375 | */ |
| 376 | int dvr_wrapper_restart_timeshift(DVR_WrapperPlayback_t playback, DVR_PlaybackFlag_t flags, DVR_PlaybackPids_t *p_pids); |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 377 | |
Wentao MA | 96f6896 | 2022-06-15 19:45:35 +0800 | [diff] [blame] | 378 | /** |
| 379 | * Set log level |
| 380 | * \param level Log level, 0: UNKNOWN, 1: DEFAULT, 2:VERBOSE, 3:DEBUG. |
| 381 | * 4: INFO, 5: WARN, 6: ERROR, 7: FATAL |
| 382 | * \retval DVR_SUCCESS On success. |
| 383 | * \return Error code. |
| 384 | */ |
| 385 | int dvr_wrapper_set_log_level (int level); |
| 386 | |
Wentao MA | 5629ad8 | 2022-08-24 10:03:02 +0800 | [diff] [blame] | 387 | /** |
| 388 | * Set AC4 audio preselection id for playback |
| 389 | * \param playback The playback handle. |
| 390 | * \param presel_id AC4 audio preselection id |
| 391 | * \retval DVR_SUCCESS On success. |
| 392 | * \return Error code. |
| 393 | */ |
| 394 | int dvr_wrapper_set_ac4_preselection_id(DVR_WrapperPlayback_t playback, int presel_id); |
| 395 | |
wentao ma | 7d64278 | 2022-10-23 18:26:16 -0700 | [diff] [blame] | 396 | /** |
| 397 | * Set various libdvr properties |
| 398 | * \param[in] prop_name property name |
| 399 | * \param[in] prop_value property value |
| 400 | * \retval DVR_SUCCESS On success. |
| 401 | * \return DVR_FAILURE On failure. |
| 402 | */ |
| 403 | int dvr_wrapper_property_set(const char* prop_name, const char* prop_value); |
| 404 | |
| 405 | /** |
| 406 | * Get various libdvr properties |
| 407 | * \param[in] prop_name property name |
| 408 | * \param[out] prop_value property value. Buffer lifecycle is managed by caller. |
| 409 | * \param[in] length buffer length of prop_value |
| 410 | * \retval DVR_SUCCESS On success. |
| 411 | * \return DVR_FAILURE On failure. |
| 412 | */ |
| 413 | int dvr_wrapper_property_get(const char* prop_name, char* prop_value, int length); |
| 414 | |
Zhiqiang Han | 2f019af | 2023-08-31 11:12:02 +0800 | [diff] [blame] | 415 | /** |
| 416 | * Control the internal recording logic |
| 417 | * \param rec The record handle. |
| 418 | * \param cmd control command |
| 419 | * \param data control data |
| 420 | * \param size size of the control data |
| 421 | * \retval DVR_SUCCESS On success. |
| 422 | * \return Error code. |
| 423 | */ |
| 424 | int dvr_wrapper_ioctl_record(DVR_WrapperRecord_t rec, unsigned int cmd, void *data, size_t size); |
| 425 | |
Gong Ke | 80b8d2a | 2020-02-04 18:34:35 +0800 | [diff] [blame] | 426 | #ifdef __cplusplus |
| 427 | } |
| 428 | #endif |
| 429 | |
| 430 | #endif /*DVR_WRAPPER_H_*/ |
| 431 | |