rtsp/rtmp/mp4支持opus并整理代码

This commit is contained in:
xiongziliang
2020-08-01 10:22:12 +08:00
parent b4a3b608ab
commit a22f97c777
32 changed files with 556 additions and 635 deletions

View File

@@ -17,11 +17,9 @@
#include "Util/util.h"
#include "Util/TimeTicker.h"
#include "Common/MultiMediaSourceMuxer.h"
using namespace std;
using namespace toolkit;
#ifdef ENABLE_FAAC
#include "Codec/AACEncoder.h"
#endif //ENABLE_FAAC
@@ -55,16 +53,10 @@ class DevChannel : public MultiMediaSourceMuxer{
public:
typedef std::shared_ptr<DevChannel> Ptr;
//fDuration<=0为直播否则为点播
DevChannel(const string &vhost,
const string &app,
const string &stream_id,
float duration = 0,
bool enable_rtsp = true,
bool enable_rtmp = true,
bool enable_hls = true,
bool enable_mp4 = false);
DevChannel(const string &vhost, const string &app, const string &stream_id, float duration = 0,
bool enable_rtsp = true, bool enable_rtmp = true, bool enable_hls = true, bool enable_mp4 = false);
virtual ~DevChannel();
~DevChannel() override ;
/**
* 初始化视频Track
@@ -108,12 +100,12 @@ public:
void inputAAC(const char *data_without_adts, int len, uint32_t dts, const char *adts_header);
/**
* G711音频帧
* 输入OPUS/G711音频帧
* @param data 音频帧
* @param len 帧数据长度
* @param dts 时间戳,单位毫秒
*/
void inputG711(const char* data, int len, uint32_t dts);
void inputAudio(const char *data, int len, uint32_t dts);
#ifdef ENABLE_X264
/**