Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 1 | /* |
| 2 | * \file |
| 3 | * Segment operation module |
| 4 | */ |
| 5 | |
Pengfei Liu | 2afc35d | 2020-01-07 10:47:39 +0800 | [diff] [blame] | 6 | #ifndef _DVR_SEGMENT_H_ |
| 7 | #define _DVR_SEGMENT_H_ |
| 8 | |
| 9 | #ifdef __cplusplus |
| 10 | extern "C" { |
| 11 | #endif |
| 12 | |
Gong Ke | 3489c0f | 2020-01-16 18:11:44 +0800 | [diff] [blame] | 13 | #include "dvr_types.h" |
Pengfei Liu | 2afc35d | 2020-01-07 10:47:39 +0800 | [diff] [blame] | 14 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 15 | /**\brief Delete a segment |
| 16 | * \param[in] location, The record file's location |
| 17 | * \param[in] segment_id, The segment's index |
| 18 | * \return DVR_SUCCESS On success |
| 19 | * \return Error code On failure |
| 20 | */ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 21 | int dvr_segment_delete(const char *location, uint64_t segment_id); |
Pengfei Liu | 2afc35d | 2020-01-07 10:47:39 +0800 | [diff] [blame] | 22 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 23 | /**\brief Get the segment list of a record file |
| 24 | * \param[in] location, The record file's location |
| 25 | * \param[out] p_segment_nb, Return the segments number |
| 26 | * \param[out] pp_segment_ids, Return the segments index |
| 27 | * \return DVR_SUCCESS On success |
| 28 | * \return Error code On failure |
| 29 | */ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 30 | int dvr_segment_get_list(const char *location, uint32_t *p_segment_nb, uint64_t **pp_segment_ids); |
Pengfei Liu | 2afc35d | 2020-01-07 10:47:39 +0800 | [diff] [blame] | 31 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 32 | /**\brief Get the segment's information |
| 33 | * \param[in] location, The record file's location |
| 34 | * \param[in] segment_id, The segment index |
| 35 | * \param[out] p_info, Return the segment's information |
| 36 | * \return DVR_SUCCESS On success |
| 37 | * \return Error code On failure |
| 38 | */ |
| 39 | int dvr_segment_get_info(const char *location, uint64_t segment_id, DVR_RecordSegmentInfo_t *p_info); |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 40 | |
Pengfei Liu | b473423 | 2020-01-17 18:25:10 +0800 | [diff] [blame] | 41 | /**\brief Link a segment group as the record file's list |
| 42 | * \param[in] location, The record file's location |
| 43 | * \param[in] nb_segments, The number of segments |
| 44 | * \param[in] p_segment_ids, The segments index in the group |
| 45 | * \return DVR_SUCCESS On success |
| 46 | * \return Error code On failure |
| 47 | */ |
Pengfei Liu | c181a98 | 2020-01-07 19:27:13 +0800 | [diff] [blame] | 48 | int dvr_segment_link(const char *location, uint32_t nb_segments, uint64_t *p_segment_ids); |
Pengfei Liu | 2afc35d | 2020-01-07 10:47:39 +0800 | [diff] [blame] | 49 | |
| 50 | #ifdef __cplusplus |
| 51 | } |
| 52 | #endif |
| 53 | |
| 54 | #endif /*END _DVR_SEGMENT_H_*/ |