ZLMediaKit/c_wrapper/src/media.h

88 lines
3.0 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地址的一部分
* :
*/
API_EXPORT MediaContext CALLTYPE createMedia(const char *appName,const char *mediaName);
/*
* :
* :ctx:
* :
*/
API_EXPORT void CALLTYPE releaseMedia(MediaContext ctx);
/*
* :
* :ctx:;width:;height:;frameRate:fps
* :
*/
API_EXPORT void CALLTYPE media_initVideo(MediaContext ctx, int width, int height, int frameRate);
/*
* :
* :ctx:;channel:;sampleBit:,16bit;sampleRate:
* :
*/
API_EXPORT void CALLTYPE media_initAudio(MediaContext ctx, int channel, int sampleBit, int sampleRate);
/*
* :H264视频SPS和PPS帧,00 00 01,00 00 00 01
* :ctx:;data:H264数据;len:H264数据字节数;stamp:
* :
*/
API_EXPORT void CALLTYPE media_inputH264(MediaContext ctx, void *data, int len, unsigned long stamp);
/*
* :AAC音频(adts头)
* :ctx:;data:AAC数据;len:AAC数据字节数;stamp:
* :
*/
API_EXPORT void CALLTYPE media_inputAAC(MediaContext ctx, void *data, int len, unsigned long stamp);
#ifdef __cplusplus
}
#endif
#endif /* SRC_MEDIA_H_ */