新增Frame多转发代理

This commit is contained in:
xiongziliang
2018-10-26 16:09:48 +08:00
parent 6870292fd6
commit f26076635d
10 changed files with 145 additions and 79 deletions

View File

@@ -35,6 +35,7 @@ using namespace toolkit;
namespace mediakit {
#if 0
DevChannel::DevChannel(const char *strVhost,
const char *strApp,
const char *strId,
@@ -303,5 +304,7 @@ void DevChannel::initAudio(const AudioInfo& info) {
_pAdtsHeader->no_raw_data_blocks_in_frame = 0;
}
#endif
} /* namespace mediakit */

View File

@@ -37,10 +37,12 @@
#include "Rtsp/RtspToRtmpMediaSource.h"
#include "RtspMuxer/RtspSdp.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
@@ -52,6 +54,7 @@ using namespace toolkit;
namespace mediakit {
#if 0
class VideoInfo {
public:
int iWidth;
@@ -119,6 +122,23 @@ private:
std::shared_ptr<AACFrame> _pAdtsHeader;
};
#endif //0
class DevChannelNew : public MultiMediaSourceMuxer
{
public:
typedef std::shared_ptr<DevChannelNew> Ptr;
DevChannelNew(const char *strVhost,
const char *strApp,
const char *strId,
float fDuration = 0,
bool bEanbleHls = true,
bool bEnableMp4 = false):
MultiMediaSourceMuxer(strVhost,strApp,strId,fDuration){};
virtual ~DevChannelNew(){}
};
typedef DevChannelNew DevChannel;
} /* namespace mediakit */

View File

@@ -83,6 +83,7 @@ void PlayerProxy::play(const char* strUrl) {
weak_ptr<PlayerProxy> weakSelf = shared_from_this();
//todo(xzl) 修复此处
// setOnVideoCB( [weakSelf](const H264Frame &data ) {
// auto strongSelf = weakSelf.lock();
// if(!strongSelf){
@@ -212,7 +213,7 @@ void PlayerProxy::makeMuteAudio(uint32_t stamp) {
auto iAudioIndex = stamp / MUTE_ADTS_DATA_MS;
if(_iAudioIndex != iAudioIndex){
_iAudioIndex = iAudioIndex;
_pChn->inputAAC((char *)MUTE_ADTS_DATA,MUTE_ADTS_DATA_LEN, _iAudioIndex * MUTE_ADTS_DATA_MS);
_pChn->inputFrame(std::make_shared<AACFrameNoCopyAble>((char *)MUTE_ADTS_DATA,MUTE_ADTS_DATA_LEN, _iAudioIndex * MUTE_ADTS_DATA_MS));
//DebugL << _iAudioIndex * MUTE_ADTS_DATA_MS << " " << stamp;
}
}