blob: 7fb2178061d91605183b9efec44cf6de6610c50a [file] [log] [blame]
Pengfei Liub4734232020-01-17 18:25:10 +08001/*
2 * \file
3 * Segment operation module
4 */
5
Pengfei Liu2afc35d2020-01-07 10:47:39 +08006#ifndef _DVR_SEGMENT_H_
7#define _DVR_SEGMENT_H_
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
Gong Ke3489c0f2020-01-16 18:11:44 +080013#include "dvr_types.h"
Pengfei Liu2afc35d2020-01-07 10:47:39 +080014
Pengfei Liub4734232020-01-17 18:25:10 +080015/**\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 Liuc181a982020-01-07 19:27:13 +080021int dvr_segment_delete(const char *location, uint64_t segment_id);
Pengfei Liu2afc35d2020-01-07 10:47:39 +080022
Pengfei Liub4734232020-01-17 18:25:10 +080023/**\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 Liuc181a982020-01-07 19:27:13 +080030int dvr_segment_get_list(const char *location, uint32_t *p_segment_nb, uint64_t **pp_segment_ids);
Pengfei Liu2afc35d2020-01-07 10:47:39 +080031
Pengfei Liub4734232020-01-17 18:25:10 +080032/**\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 */
39int dvr_segment_get_info(const char *location, uint64_t segment_id, DVR_RecordSegmentInfo_t *p_info);
Pengfei Liuc181a982020-01-07 19:27:13 +080040
Pengfei Liub4734232020-01-17 18:25:10 +080041/**\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 Liuc181a982020-01-07 19:27:13 +080048int dvr_segment_link(const char *location, uint32_t nb_segments, uint64_t *p_segment_ids);
Pengfei Liu2afc35d2020-01-07 10:47:39 +080049
50#ifdef __cplusplus
51}
52#endif
53
54#endif /*END _DVR_SEGMENT_H_*/