You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.6 KiB
C

12 months ago
/*
* 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"
#ifdef __cplusplus
extern "C" {
#endif
///////////////////////////////////////////flv录制/////////////////////////////////////////////
typedef struct mk_flv_recorder_t *mk_flv_recorder;
/**
* flv
* @return
*/
API_EXPORT mk_flv_recorder API_CALL mk_flv_recorder_create();
/**
* flv
* @param ctx
*/
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
*/
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录制/////////////////////////////////////////////
/**
*
* @param type 0:hls,1:MP4
* @param vhost
* @param app
* @param stream id
* @return ,0:, 1:
*/
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 mp40
* @return 10
*/
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
*/
API_EXPORT int API_CALL mk_recorder_stop(int type, const char *vhost, const char *app, const char *stream);
#ifdef __cplusplus
}
#endif
#endif /* MK_RECORDER_API_H_ */