ZLMediaKit/c_wrapper/src/media.h

104 lines
3.6 KiB
C
Raw Normal View History

2017-12-13 18:15:22 +08:00
/*
* MIT License
*
* Copyright (c) 2016 xiongziliang <771730766@qq.com>
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef SRC_MEDIA_H_
#define SRC_MEDIA_H_
#include "common.h"
#ifdef __cplusplus
extern "C" {
#endif
////////////////////////////////Rtsp media////////////////////////////////////////////
typedef void* MediaContext;
/*
* :
* :mediaName:,url地址的一部分
* :
*/
2017-12-19 10:34:52 +08:00
API_EXPORT MediaContext API_CALL createMedia(const char *appName,const char *mediaName);
2017-12-13 18:15:22 +08:00
/*
* :
* :ctx:
* :
*/
2017-12-19 10:34:52 +08:00
API_EXPORT void API_CALL releaseMedia(MediaContext ctx);
2017-12-13 18:15:22 +08:00
/*
* :
* :ctx:;width:;height:;frameRate:fps
* :
*/
2017-12-19 10:34:52 +08:00
API_EXPORT void API_CALL media_initVideo(MediaContext ctx, int width, int height, int frameRate);
2017-12-13 18:15:22 +08:00
/*
* :
* :ctx:;channel:;sampleBit:,16bit;sampleRate:
* :
*/
2017-12-19 10:34:52 +08:00
API_EXPORT void API_CALL media_initAudio(MediaContext ctx, int channel, int sampleBit, int sampleRate);
2017-12-13 18:15:22 +08:00
/*
* :H264视频SPS和PPS帧,00 00 01,00 00 00 01
* :ctx:;data:H264数据;len:H264数据字节数;stamp:
* :
*/
2017-12-19 10:34:52 +08:00
API_EXPORT void API_CALL media_inputH264(MediaContext ctx, void *data, int len, unsigned long stamp);
2017-12-13 18:15:22 +08:00
/*
* :AAC音频(adts头)
* :ctx:;data:AAC数据;len:AAC数据字节数;stamp:
* :
*/
2017-12-19 10:34:52 +08:00
API_EXPORT void API_CALL media_inputAAC(MediaContext ctx, void *data, int len, unsigned long stamp);
2017-12-13 18:15:22 +08:00
2017-12-19 10:34:52 +08:00
/*
* :AAC音频(adts头)
* :ctx:;data:AAC数据;len:AAC数据字节数;stamp:;adts:adts头指针
* :
*/
API_EXPORT void API_CALL media_inputAAC1(MediaContext ctx, void *data, int len, unsigned long stamp,void *adts);
/*
* :AAC音频(2aac配置)
* :ctx:;data:AAC数据;len:AAC数据字节数;stamp:;adts:adts头指针;aac_cfg:aac配置
* :
*/
API_EXPORT void API_CALL media_inputAAC2(MediaContext ctx, void *data, int len, unsigned long stamp,void *aac_cfg);
2017-12-13 18:15:22 +08:00
2017-12-19 10:34:52 +08:00
2017-12-13 18:15:22 +08:00
#ifdef __cplusplus
}
#endif
#endif /* SRC_MEDIA_H_ */