Zhiqiang Han | 2f019af | 2023-08-31 11:12:02 +0800 | [diff] [blame] | 1 | #ifndef _SEGMENT_DATAOUT_H_ |
| 2 | #define _SEGMENT_DATAOUT_H_ |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
| 8 | #include "dvr_types.h" |
| 9 | #include "segment_ops.h" |
| 10 | |
| 11 | /** |
| 12 | * Segment implementation 2 |
| 13 | * for data loop out |
| 14 | */ |
| 15 | |
| 16 | #define SEGMENT_DATAOUT_CMD_SET_CALLBACK 0x1001 |
| 17 | typedef struct Segment_DataoutCallback_s { |
| 18 | int (*callback)(unsigned char *buf, size_t size, void *priv); |
| 19 | void *priv; |
| 20 | } Segment_DataoutCallback_t; |
| 21 | |
| 22 | |
| 23 | |
| 24 | int segment_dataout_open(Segment_OpenParams_t *params, Segment_Handle_t *p_handle); |
| 25 | int segment_dataout_close(Segment_Handle_t handle); |
| 26 | int segment_dataout_ioctl(Segment_Handle_t handle, int cmd, void *data, size_t size); |
| 27 | ssize_t segment_dataout_write(Segment_Handle_t handle, void *buf, size_t count); |
| 28 | loff_t segment_dataout_tell_total_time(Segment_Handle_t handle); |
| 29 | int segment_dataout_store_info(Segment_Handle_t handle, Segment_StoreInfo_t *p_info); |
| 30 | int segment_dataout_store_allInfo(Segment_Handle_t handle, Segment_StoreInfo_t *p_info); |
| 31 | int segment_dataout_update_pts_force(Segment_Handle_t handle, uint64_t pts, loff_t offset); |
| 32 | int segment_dataout_update_pts(Segment_Handle_t handle, uint64_t pts, loff_t offset); |
| 33 | loff_t segment_dataout_tell_position(Segment_Handle_t handle); |
| 34 | |
| 35 | #ifdef __cplusplus |
| 36 | } |
| 37 | #endif |
| 38 | |
| 39 | #endif |