stream-deploy/ZLM/api/include/mk_recorder.h

160 lines
5.3 KiB
C++
Raw Normal View History

/*
* Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
*
* Use of this source code is governed by MIT-like license that can be found in the
* LICENSE file in the root of the source tree. All contributing project authors
* may be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MK_RECORDER_API_H_
#define MK_RECORDER_API_H_
#include "mk_common.h"
#include "mk_util.h"
#ifdef __cplusplus
extern "C" {
#endif
// /////////////////////////////////////////flv录制///////////////////////////////////////////// [AUTO-TRANSLATED:a084663f]
// /////////////////////////////////////////flv录制/////////////////////////////////////////////
typedef struct mk_flv_recorder_t *mk_flv_recorder;
/**
* flv录制器
* @return
* Create flv recorder
* @return
* [AUTO-TRANSLATED:7582cde1]
*/
API_EXPORT mk_flv_recorder API_CALL mk_flv_recorder_create();
/**
* flv录制器
* @param ctx
* Release flv recorder
* @param ctx
* [AUTO-TRANSLATED:c33c76bb]
*/
API_EXPORT void API_CALL mk_flv_recorder_release(mk_flv_recorder ctx);
/**
* flv
* @param ctx flv录制器
* @param vhost
* @param app RtmpMediaSource的 app名
* @param stream RtmpMediaSource的 stream名
* @param file_path
* @return 0:-1:,RtmpMediaSource不存在
* Start recording flv
* @param ctx flv recorder
* @param vhost virtual host
* @param app app name of the bound RtmpMediaSource
* @param stream stream name of the bound RtmpMediaSource
* @param file_path file storage address
* @return 0: start exceeds, -1: failure, file opening fails or the RtmpMediaSource does not exist
* [AUTO-TRANSLATED:194cf3de]
*/
API_EXPORT int API_CALL mk_flv_recorder_start(mk_flv_recorder ctx, const char *vhost, const char *app, const char *stream, const char *file_path);
// /////////////////////////////////////////hls/mp4录制///////////////////////////////////////////// [AUTO-TRANSLATED:99c61c68]
// /////////////////////////////////////////hls/mp4录制/////////////////////////////////////////////
/**
*
* @param type 0:hls,1:MP4
* @param vhost
* @param app
* @param stream id
* @return ,0:, 1:
* Get recording status
* @param type 0: hls, 1: MP4
* @param vhost virtual host
* @param app application name
* @param stream stream id
* @return recording status, 0: not recording, 1: recording
* [AUTO-TRANSLATED:0b1d374a]
*/
API_EXPORT int API_CALL mk_recorder_is_recording(int type, const char *vhost, const char *app, const char *stream);
/**
*
* @param type 0:hls-ts,1:MP4,2:hls-fmp4,3:http-fmp4,4:http-ts
* @param vhost
* @param app
* @param stream id
* @param customized_path null则自动生成
* @param max_second mp4录制最大切片时间0
* @return 10
* Start recording
* @param type 0: hls-ts, 1: MP4, 2: hls-fmp4, 3: http-fmp4, 4: http-ts
* @param vhost virtual host
* @param app application name
* @param stream stream id
* @param customized_path custom directory for saving recording files, defaults to empty or null, automatically generated
* @param max_second maximum slice time for mp4 recording, in seconds, set to 0 to use the configuration file configuration
* @return 1 represents success, 0 represents failure
* [AUTO-TRANSLATED:0a1c8c3e]
*/
API_EXPORT int API_CALL mk_recorder_start(int type, const char *vhost, const char *app, const char *stream, const char *customized_path, size_t max_second);
/**
*
* @param type 0:hls-ts,1:MP4,2:hls-fmp4,3:http-fmp4,4:http-ts
* @param vhost
* @param app
* @param stream id
* @return 1:0
* Stop recording
* @param type 0: hls-ts, 1: MP4, 2: hls-fmp4, 3: http-fmp4, 4: http-ts
* @param vhost virtual host
* @param app application name
* @param stream stream id
* @return 1: success, 0: failure
* [AUTO-TRANSLATED:df1638e7]
*/
API_EXPORT int API_CALL mk_recorder_stop(int type, const char *vhost, const char *app, const char *stream);
/**
*
* @param vhost
* @param app
* @param stream id
* @param path
* @param back_ms
* @param forward_ms
* @return 1:0
* */
API_EXPORT int API_CALL mk_recorder_start_task(const char *vhost, const char *app, const char *stream, const char *path, uint32_t back_ms, uint32_t forward_ms);
/**
* mp4列表
* @param vhost
* @param app app
* @param stream id
* @param file_path
* @param file_repeat
* @param ini
*/
API_EXPORT void API_CALL mk_load_mp4_file(const char *vhost, const char *app, const char *stream, const char *file_path, int file_repeat);
API_EXPORT void API_CALL mk_load_mp4_file2(const char *vhost, const char *app, const char *stream, const char *file_path, int file_repeat, mk_ini ini);
#ifdef __cplusplus
}
#endif
#endif /* MK_RECORDER_API_H_ */