blob: f2374cf791f8020f308921dc7cd8bee5d84c35fb [file] [log] [blame]
Gong Ke3489c0f2020-01-16 18:11:44 +08001/**
2 * \file
3 * Playback module.
4 */
5
hualing chenb31a6c62020-01-13 17:27:00 +08006#ifndef DVR_PLAYBACK_H_
7#define DVR_PLAYBACK_H_
hualing chenb31a6c62020-01-13 17:27:00 +08008#include "list.h"
Gong Ke3489c0f2020-01-16 18:11:44 +08009#include "dvr_types.h"
hualing chen86e7d482020-01-16 15:13:33 +080010#include "segment.h"
hualing chenb31a6c62020-01-13 17:27:00 +080011#include "playback_device.h"
hualing chen040df222020-01-17 13:35:02 +080012#include "dvr_types.h"
13#include "dvr_crypto.h"
14
hualing chenb31a6c62020-01-13 17:27:00 +080015#ifdef __cplusplus
16extern "C" {
17#endif
Gong Ke3489c0f2020-01-16 18:11:44 +080018
hualing chen040df222020-01-17 13:35:02 +080019/**\brief dvr play segment flag */
hualing chenb31a6c62020-01-13 17:27:00 +080020typedef enum
21{
Gong Ke3489c0f2020-01-16 18:11:44 +080022 DVR_PLAYBACK_SEGMENT_ENCRYPTED = (1 << 0), /**< encrypted stream */
23 DVR_PLAYBACK_SEGMENT_DISPLAYABLE = (1 << 1), /**< displayable stream */
hualing chen5cbe1a62020-02-10 16:36:36 +080024 DVR_PLAYBACK_SEGMENT_CONTINUOUS = (1 << 2)/**< continuous stream with pre one */
Gong Ke3489c0f2020-01-16 18:11:44 +080025} DVR_PlaybackSegmentFlag_t;
hualing chenb31a6c62020-01-13 17:27:00 +080026
27/**\brief dvr pid type*/
28typedef enum
29{
Gong Ke3489c0f2020-01-16 18:11:44 +080030 DVR_PLAYBACK_SYNC, /**< sync play mode */
31 DVR_PLAYBACK_ASYNC /**< out of sync play mode */
32} DVR_PlaybackSyncMode_t;
hualing chenb31a6c62020-01-13 17:27:00 +080033
34
35/**\brief dvr play pids */
36typedef struct
37{
Gong Ke3489c0f2020-01-16 18:11:44 +080038 DVR_StreamInfo_t video; /**< Video.*/
39 DVR_StreamInfo_t audio; /**< Audio.*/
40 DVR_StreamInfo_t ad; /**< AD.*/
41 DVR_StreamInfo_t subtitle; /**< Subtitle.*/
42 DVR_StreamInfo_t pcr; /**< PCR.*/
43} DVR_PlaybackPids_t;
hualing chenb31a6c62020-01-13 17:27:00 +080044
Gong Ke3489c0f2020-01-16 18:11:44 +080045/**\brief dvr segments info */
hualing chenb31a6c62020-01-13 17:27:00 +080046typedef struct
47{
Gong Ke3489c0f2020-01-16 18:11:44 +080048 struct list_head head; /**< Segment node.*/
hualing chen5cbe1a62020-02-10 16:36:36 +080049 uint64_t segment_id; /**< Segment's index.*/
50 char location[DVR_MAX_LOCATION_SIZE]; /**< chunk location */
Gong Ke3489c0f2020-01-16 18:11:44 +080051 DVR_PlaybackPids_t pids; /**< Streams' PIDs.*/
hualing chen040df222020-01-17 13:35:02 +080052 DVR_PlaybackSegmentFlag_t flags; /**< Segment's flag */
Gong Ke3489c0f2020-01-16 18:11:44 +080053 int key_data_id; /**< ??? */
54} DVR_PlaybackSegmentInfo_t;
hualing chenb31a6c62020-01-13 17:27:00 +080055
56/**\brief play flag, if set this flag, player need pause when decode first frame */
57typedef enum
58{
Gong Ke3489c0f2020-01-16 18:11:44 +080059 DVR_PLAYBACK_STARTED_PAUSEDLIVE = (1 << 0) /**< dvr play stat,need change to pause state if set */
60} DVR_PlaybackFlag_t;
hualing chen86e7d482020-01-16 15:13:33 +080061
62/**\brief playback speed mode*/
hualing chenb31a6c62020-01-13 17:27:00 +080063typedef enum
64{
Gong Ke3489c0f2020-01-16 18:11:44 +080065 DVR_PLAYBACK_FAST_FORWARD = 0, /**< fast forward */
66 DVR_PLAYBACK_FAST_BACKWARD = 1, /**< fast backward */
67} DVR_PlaybackSpeedMode_t;
hualing chenb31a6c62020-01-13 17:27:00 +080068
69
Gong Ke3489c0f2020-01-16 18:11:44 +080070/**\brief playback play speed*/
hualing chenb31a6c62020-01-13 17:27:00 +080071typedef struct
72{
Gong Ke3489c0f2020-01-16 18:11:44 +080073 Playback_DeviceSpeeds_t speed; /**< playback speed */
74 DVR_PlaybackSpeedMode_t mode; /**< playback 0: fast forword or 1: fast backword*/
75} DVR_PlaybackSpeed_t;
hualing chenb31a6c62020-01-13 17:27:00 +080076
Gong Ke3489c0f2020-01-16 18:11:44 +080077/**Maximum supported speed modes.*/
hualing chenb31a6c62020-01-13 17:27:00 +080078#define DVR_MAX_SUPPORTED_SPEEDS 32
Gong Ke3489c0f2020-01-16 18:11:44 +080079
hualing chenb31a6c62020-01-13 17:27:00 +080080/**\brief playback capability*/
81typedef struct
82{
hualing chen86e7d482020-01-16 15:13:33 +080083 int nb_supported_speeds; /**< support playback speed count*/
84 int supported_speeds[DVR_MAX_SUPPORTED_SPEEDS]; /**< support playback speed*/
Gong Ke3489c0f2020-01-16 18:11:44 +080085} DVR_PlaybackCapability_t;
hualing chenb31a6c62020-01-13 17:27:00 +080086
Gong Ke3489c0f2020-01-16 18:11:44 +080087/**Playback handle.*/
88typedef void* DVR_PlaybackHandle_t;
hualing chenb31a6c62020-01-13 17:27:00 +080089
hualing chencc91e1c2020-02-28 13:26:17 +080090
91/**\brief playback error reason*/
92typedef enum
93{
94 DVR_PLAYBACK_PID_ERROR, /**< uninit state */
95 DVR_PLAYBACK_FMT_ERROR /**< fmt not surport backword */
96} DVR_PlaybackError_t;
97
98
hualing chenb31a6c62020-01-13 17:27:00 +080099/**\brief playback play state*/
100typedef enum
101{
Gong Ke3489c0f2020-01-16 18:11:44 +0800102 DVR_PLAYBACK_STATE_UNINIT, /**< uninit state */
103 DVR_PLAYBACK_STATE_INIT, /**< init state, open device */
104 DVR_PLAYBACK_STATE_START, /**< start play */
105 DVR_PLAYBACK_STATE_STOP, /**< stop */
106 DVR_PLAYBACK_STATE_PAUSE, /**< pause */
107 DVR_PLAYBACK_STATE_FF, /**< fast forward */
108 DVR_PLAYBACK_STATE_FB /**< fast backword */
109} DVR_PlaybackPlayState_t;
hualing chenb31a6c62020-01-13 17:27:00 +0800110
111/**\brief playback play status*/
112typedef struct
113{
Gong Ke3489c0f2020-01-16 18:11:44 +0800114 DVR_PlaybackPlayState_t state; /**< playback play state */
hualing chen5cbe1a62020-02-10 16:36:36 +0800115 uint64_t segment_id; /**< playback ongoing segment index */
hualing chencc91e1c2020-02-28 13:26:17 +0800116 uint32_t time_cur; /**< playback cur time,0 <--> time_end Ms*/
117 uint32_t time_end; /**< playback ongoing segment dur,Ms */
Gong Ke3489c0f2020-01-16 18:11:44 +0800118 DVR_PlaybackPids_t pids; /**< playback played pids */
hualing chen5cbe1a62020-02-10 16:36:36 +0800119 int speed; /**< playback speed */
120 DVR_PlaybackSegmentFlag_t flags; /**< playback played segment flag */
Gong Ke3489c0f2020-01-16 18:11:44 +0800121} DVR_PlaybackStatus_t;
hualing chenb31a6c62020-01-13 17:27:00 +0800122
hualing chencc91e1c2020-02-28 13:26:17 +0800123/**\brief DVR playback event*/
124typedef enum {
125 DVR_PLAYBACK_EVENT_ERROR = 0x1000, /**< Signal a critical playback error*/
126 DVR_PLAYBACK_EVENT_TRANSITION_OK , /**< transition ok*/
127 DVR_PLAYBACK_EVENT_TRANSITION_FAILED, /**< transition failed*/
128 DVR_PLAYBACK_EVENT_KEY_FAILURE, /**< key failure*/
129 DVR_PLAYBACK_EVENT_NO_KEY, /**< no key*/
130 DVR_PLAYBACK_EVENT_REACHED_BEGIN , /**< reached begin*/
131 DVR_PLAYBACK_EVENT_REACHED_END /**< reached end*/
132} DVR_PlaybackEvent_t;
133
134/**\brief DVR playback event notify function*/
135typedef struct
136{
137 DVR_PlaybackEvent_t event; /**< event type*/
138 DVR_PlaybackStatus_t play_status; /**< play status*/
139 union
140 {
141 uint8_t unused;
142 uint8_t error_reason; /**< error reason*/
143 struct
144 {
145 uint64_t segment_id; /**< error segment id*/
146 uint32_t key_data_id; /**< key data id*/
147 uint8_t error; /**< error*/
148 } transition_failed_data;
149 } info;
150} DVR_Play_Notify_t;
151
152/**\brief DVR playback event notify function*/
153typedef DVR_Result_t (*DVR_PlaybackEventFunction_t) (DVR_PlaybackEvent_t event, void *params, void *userdata);
154
155
hualing chenb31a6c62020-01-13 17:27:00 +0800156/**\brief playback open params*/
157typedef struct
158{
Gong Ke3489c0f2020-01-16 18:11:44 +0800159 int dmx_dev_id; /**< playback used dmx device index*/
160 int block_size; /**< playback inject block size*/
161 DVR_Bool_t is_timeshift; /**< 0:playback mode, 1 : is timeshift mode*/
hualing chen040df222020-01-17 13:35:02 +0800162 Playback_DeviceHandle_t playback_handle; /**< Playback device handle.*/
Gong Ke3489c0f2020-01-16 18:11:44 +0800163 DVR_CryptoFunction_t crypto_fn; /**< Crypto function.*/
164 void *crypto_data; /**< Crypto function's user data.*/
hualing chen5cbe1a62020-02-10 16:36:36 +0800165 DVR_Bool_t has_pids; /**< has video audo pid fmt info*/
hualing chencc91e1c2020-02-28 13:26:17 +0800166 DVR_PlaybackEventFunction_t event_fn; /**< playback event callback function*/
167 void *event_userdata; /**< event userdata*/
168 size_t notification_size; /**< playback notification size, playback moudle would send a notifaction 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*/
Gong Ke3489c0f2020-01-16 18:11:44 +0800169} DVR_PlaybackOpenParams_t;
hualing chenb31a6c62020-01-13 17:27:00 +0800170
171/**\brief playback play state*/
172typedef enum
173{
hualing chen040df222020-01-17 13:35:02 +0800174 DVR_PLAYBACK_CMD_START, /**< start av */
175 DVR_PLAYBACK_CMD_STOP, /**< stop av */
176 DVR_PLAYBACK_CMD_VSTART, /**< v start */
177 DVR_PLAYBACK_CMD_ASTART , /**< a start */
178 DVR_PLAYBACK_CMD_VSTOP , /**< v stop */
179 DVR_PLAYBACK_CMD_ASTOP, /**< a stop */
180 DVR_PLAYBACK_CMD_VRESTART, /**< v restart */
181 DVR_PLAYBACK_CMD_ARESTART, /**< a restart */
hualing chen5cbe1a62020-02-10 16:36:36 +0800182 DVR_PLAYBACK_CMD_AVRESTART, /**< av restart */
hualing chen040df222020-01-17 13:35:02 +0800183 DVR_PLAYBACK_CMD_VSTOPASTART, /**< v stop a start*/
184 DVR_PLAYBACK_CMD_ASTOPVSTART, /**< a stop vstart */
185 DVR_PLAYBACK_CMD_VSTOPARESTART, /**<v stop a restart*/
186 DVR_PLAYBACK_CMD_ASTOPVRESTART, /**<a stop v restart*/
hualing chen5cbe1a62020-02-10 16:36:36 +0800187 DVR_PLAYBACK_CMD_VSTARTARESTART, /**<v start a restart*/
188 DVR_PLAYBACK_CMD_ASTARTVRESTART, /**<a start v restart*/
hualing chen040df222020-01-17 13:35:02 +0800189 DVR_PLAYBACK_CMD_PAUSE, /**< pause */
190 DVR_PLAYBACK_CMD_RESUME, /**< resume */
191 DVR_PLAYBACK_CMD_SEEK, /**< seek */
192 DVR_PLAYBACK_CMD_FF, /**< fast forward */
193 DVR_PLAYBACK_CMD_FB, /**< fast backword */
hualing chen5cbe1a62020-02-10 16:36:36 +0800194 DVR_PLAYBACK_CMD_NONE, /**< none */
hualing chen040df222020-01-17 13:35:02 +0800195} DVR_PlaybackCmd_t;
hualing chenb31a6c62020-01-13 17:27:00 +0800196
197
198/**\brief playback struct*/
199typedef struct
200{
hualing chen5cbe1a62020-02-10 16:36:36 +0800201 DVR_PlaybackSpeed_t speed; /**< play speed */
202 DVR_PlaybackPlayState_t state; /**< play state */
hualing chen040df222020-01-17 13:35:02 +0800203 DVR_PlaybackCmd_t cur_cmd; /**< cur send cmd */
204 DVR_PlaybackCmd_t last_cmd; /**< last cmd */
205 int pos; /**< seek pos at cur segment*/
206} DVR_PlaybackCmdInfo_t;
hualing chenb31a6c62020-01-13 17:27:00 +0800207
208
209/**\brief playback struct*/
210typedef struct
211{
hualing chen040df222020-01-17 13:35:02 +0800212 Playback_DeviceHandle_t handle; /**< device handle */
hualing chencc91e1c2020-02-28 13:26:17 +0800213 DVR_Bool_t segment_is_open; /**<segment is opend*/
hualing chen5cbe1a62020-02-10 16:36:36 +0800214 uint64_t cur_segment_id; /**< Current segment id*/
hualing chen040df222020-01-17 13:35:02 +0800215 DVR_PlaybackSegmentInfo_t cur_segment; /**< Current playing segment*/
hualing chencc91e1c2020-02-28 13:26:17 +0800216 uint64_t last_segment_id; /**< last segment id*/
217 DVR_PlaybackSegmentInfo_t last_segment; /**< last playing segment*/
hualing chen040df222020-01-17 13:35:02 +0800218 struct list_head segment_list; /**< segment list head*/
219 pthread_t playback_thread; /**< playback thread*/
220 pthread_mutex_t lock; /**< playback lock*/
221 pthread_cond_t cond; /**< playback cond*/
222 void *user_data; /**< playback userdata, used to send event*/
hualing chen5cbe1a62020-02-10 16:36:36 +0800223 int speed; /**< playback speed*/
hualing chen040df222020-01-17 13:35:02 +0800224 DVR_PlaybackPlayState_t state; /**< playback state*/
225 DVR_PlaybackFlag_t play_flag; /**< playback play flag*/
hualing chen86e7d482020-01-16 15:13:33 +0800226 int is_running; /**< playback htread is runing*/
hualing chen040df222020-01-17 13:35:02 +0800227 DVR_PlaybackCmdInfo_t cmd; /**< playback cmd*/
228 int offset; /**< segment read offset*/
hualing chencc91e1c2020-02-28 13:26:17 +0800229 uint32_t dur; /**< segment dur*/
hualing chen86e7d482020-01-16 15:13:33 +0800230 Segment_Handle_t r_handle; /**< playback current segment handle*/
hualing chen040df222020-01-17 13:35:02 +0800231 DVR_PlaybackOpenParams_t openParams; /**< playback openParams*/
hualing chen86e7d482020-01-16 15:13:33 +0800232 DVR_Bool_t has_video; /**< has video playing*/
233 DVR_Bool_t has_audio; /**< has audio playing*/
hualing chen5cbe1a62020-02-10 16:36:36 +0800234 DVR_Bool_t has_pids; /**< has video audo pid fmt info*/
235 int fffb_start; /**< fffb start time ms*/
236 int fffb_current; /**< fffb current time*/
237 int fffb_start_pcr; /**< fffb start pcr time*/
238 int seek_time;
hualing chen040df222020-01-17 13:35:02 +0800239} DVR_Playback_t;
hualing chenb31a6c62020-01-13 17:27:00 +0800240
241/**\brief Open an dvr palyback
242 * \param[out] p_handle dvr playback addr
243 * \param[in] params dvr playback open parameters
244 * \retval DVR_SUCCESS On success
245 * \return Error code
246 */
Gong Ke3489c0f2020-01-16 18:11:44 +0800247int dvr_playback_open(DVR_PlaybackHandle_t *p_handle, DVR_PlaybackOpenParams_t *params);
hualing chenb31a6c62020-01-13 17:27:00 +0800248
249/**\brief Close an dvr palyback
250 * \param[in] handle playback handle
251 * \retval DVR_SUCCESS On success
252 * \return Error code
253 */
Gong Ke3489c0f2020-01-16 18:11:44 +0800254int dvr_playback_close(DVR_PlaybackHandle_t handle);
hualing chenb31a6c62020-01-13 17:27:00 +0800255
256
257/**\brief Start play audio and video, used start auido api and start video api
258 * \param[in] handle playback handle
259 * \param[in] params audio playback params,contains fmt and pid...
260 * \retval DVR_SUCCESS On success
261 * \return Error code
262 */
Gong Ke3489c0f2020-01-16 18:11:44 +0800263int dvr_playback_start(DVR_PlaybackHandle_t handle, DVR_PlaybackFlag_t flag);
hualing chenb31a6c62020-01-13 17:27:00 +0800264
hualing chen040df222020-01-17 13:35:02 +0800265/**\brief dvr play back add segment info to segment list
hualing chenb31a6c62020-01-13 17:27:00 +0800266 * \param[in] handle playback handle
hualing chen040df222020-01-17 13:35:02 +0800267 * \param[in] info added segment info,con vpid fmt apid fmt.....
hualing chenb31a6c62020-01-13 17:27:00 +0800268 * \retval DVR_SUCCESS On success
269 * \return Error code
270 */
hualing chen040df222020-01-17 13:35:02 +0800271int dvr_playback_add_segment(DVR_PlaybackHandle_t handle, DVR_PlaybackSegmentInfo_t *info);
hualing chenb31a6c62020-01-13 17:27:00 +0800272
hualing chen040df222020-01-17 13:35:02 +0800273/**\brief dvr play back remove segment info by segmentkid
hualing chenb31a6c62020-01-13 17:27:00 +0800274 * \param[in] handle playback handle
hualing chen040df222020-01-17 13:35:02 +0800275 * \param[in] segmentid need removed segment id
hualing chenb31a6c62020-01-13 17:27:00 +0800276 * \retval DVR_SUCCESS On success
277 * \return Error code
278 */
hualing chen5cbe1a62020-02-10 16:36:36 +0800279int dvr_playback_remove_segment(DVR_PlaybackHandle_t handle, uint64_t segmentid);
hualing chenb31a6c62020-01-13 17:27:00 +0800280
hualing chen040df222020-01-17 13:35:02 +0800281/**\brief dvr play back add segment info
hualing chenb31a6c62020-01-13 17:27:00 +0800282 * \param[in] handle playback handle
hualing chen040df222020-01-17 13:35:02 +0800283 * \param[in] info added segment info,con vpid fmt apid fmt.....
hualing chenb31a6c62020-01-13 17:27:00 +0800284 * \retval DVR_SUCCESS On success
285 * \return Error code
286 */
hualing chen040df222020-01-17 13:35:02 +0800287int dvr_playback_update_segment_flags(DVR_PlaybackHandle_t handle,
hualing chen5cbe1a62020-02-10 16:36:36 +0800288 uint64_t segment_id,
hualing chen040df222020-01-17 13:35:02 +0800289 DVR_PlaybackSegmentFlag_t flags);
290/**\brief dvr play back up1date segment pids
291 * if updated segment is ongoing segment, we need start new
hualing chenb31a6c62020-01-13 17:27:00 +0800292 * add pid stream and stop remove pid stream.
293 * \param[in] handle playback handle
hualing chen040df222020-01-17 13:35:02 +0800294 * \param[in] segment_id need updated pids segment id
hualing chenb31a6c62020-01-13 17:27:00 +0800295 * \retval DVR_SUCCESS On success
296 * \return Error code
297 */
hualing chen5cbe1a62020-02-10 16:36:36 +0800298int dvr_playback_update_segment_pids(DVR_PlaybackHandle_t handle, uint64_t segmentid,
hualing chen040df222020-01-17 13:35:02 +0800299DVR_PlaybackPids_t *p_pids);
hualing chenb31a6c62020-01-13 17:27:00 +0800300
301/**\brief Stop play, will stop video and audio
302 * \param[in] handle playback handle
303 * \param[in] clear is clear last frame
304 * \retval DVR_SUCCESS On success
305 * \return Error code
306 */
hualing chen040df222020-01-17 13:35:02 +0800307int dvr_playback_stop(DVR_PlaybackHandle_t handle, DVR_Bool_t clear);
hualing chenb31a6c62020-01-13 17:27:00 +0800308
309/**\brief Start play audio
310 * \param[in] handle playback handle
311 * \param[in] params audio playback params,contains fmt and pid...
312 * \retval DVR_SUCCESS On success
313 * \return Error code
314 */
hualing chen040df222020-01-17 13:35:02 +0800315int dvr_playback_audio_start(DVR_PlaybackHandle_t handle, Playback_DeviceAudioParams_t *param);
hualing chenb31a6c62020-01-13 17:27:00 +0800316
317/**\brief Stop play audio
318 * \param[in] handle playback handle
319 * \retval DVR_SUCCESS On success
320 * \return Error code
321 */
hualing chen040df222020-01-17 13:35:02 +0800322int dvr_playback_audio_stop(DVR_PlaybackHandle_t handle);
hualing chenb31a6c62020-01-13 17:27:00 +0800323
324/**\brief Start play video
325 * \param[in] handle playback handle
326 * \param[in] params video playback params,contains fmt and pid...
327 * \retval DVR_SUCCESS On success
328 * \return Error code
329 */
hualing chen040df222020-01-17 13:35:02 +0800330int dvr_playback_video_start(DVR_PlaybackHandle_t handle, Playback_DeviceVideoParams_t *param);
hualing chenb31a6c62020-01-13 17:27:00 +0800331
332/**\brief Stop play video
333 * \param[in] handle playback handle
334 * \retval DVR_SUCCESS On success
335 * \return Error code
336 */
hualing chen040df222020-01-17 13:35:02 +0800337int dvr_playback_video_stop(DVR_PlaybackHandle_t handle);
hualing chenb31a6c62020-01-13 17:27:00 +0800338
339/**\brief Pause play
340 * \param[in] handle playback handle
341 * \param[in] flush whether its internal buffers should be flushed
342 * \retval DVR_SUCCESS On success
343 * \return Error code
344 */
hualing chen040df222020-01-17 13:35:02 +0800345int dvr_playback_pause(DVR_PlaybackHandle_t handle, DVR_Bool_t flush);
hualing chenb31a6c62020-01-13 17:27:00 +0800346
347
348/**\brief seek
349 * \param[in] handle playback handle
hualing chen040df222020-01-17 13:35:02 +0800350 * \param[in] time_offset time offset base cur segment
hualing chenb31a6c62020-01-13 17:27:00 +0800351 * \retval DVR_SUCCESS On success
352 * \return Error code
353 */
hualing chencc91e1c2020-02-28 13:26:17 +0800354int dvr_playback_seek(DVR_PlaybackHandle_t handle, uint64_t segment_id, uint32_t time_offset);
hualing chenb31a6c62020-01-13 17:27:00 +0800355
356/**\brief Set play speed
357 * \param[in] handle playback handle
358 * \param[in] speed playback speed
359 * \retval DVR_SUCCESS On success
360 * \return Error code
361 */
hualing chen5cbe1a62020-02-10 16:36:36 +0800362int dvr_playback_set_speed(DVR_PlaybackHandle_t handle, DVR_PlaybackSpeed_t speed);
hualing chenb31a6c62020-01-13 17:27:00 +0800363
364/**\brief Get playback status
365 * \param[in] handle playback handle
366 * \param[out] p_status playback status
367 * \retval DVR_SUCCESS On success
368 * \return Error code
369 */
hualing chen040df222020-01-17 13:35:02 +0800370int dvr_playback_get_status(DVR_PlaybackHandle_t handle, DVR_PlaybackStatus_t *p_status);
hualing chenb31a6c62020-01-13 17:27:00 +0800371
372/**\brief Get playback capabilities
373 * \param[out] p_capability playback capability
374 * \retval DVR_SUCCESS On success
375 * \return Error code
376 */
hualing chen040df222020-01-17 13:35:02 +0800377int dvr_playback_get_capabilities(DVR_PlaybackCapability_t *p_capability);
hualing chenb31a6c62020-01-13 17:27:00 +0800378
hualing chen040df222020-01-17 13:35:02 +0800379/**\brief dump segmentinfo throw print log
hualing chenb31a6c62020-01-13 17:27:00 +0800380 * \param[int] handle playback
hualing chen040df222020-01-17 13:35:02 +0800381 * \param[int] segment_id if segment_id > 0, only dump this log. else dump all segment info
hualing chenb31a6c62020-01-13 17:27:00 +0800382 * \retval DVR_SUCCESS On success
383 * \return Error code
384 */
hualing chen5cbe1a62020-02-10 16:36:36 +0800385int dvr_dump_segmentinfo(DVR_PlaybackHandle_t handle, uint64_t segment_id);
hualing chenb31a6c62020-01-13 17:27:00 +0800386
387#ifdef __cplusplus
388}
389#endif
390
391#endif /*END DVR_PLAYBACK_H_*/