修复无法编译的bug

This commit is contained in:
xiongziliang 2018-10-25 17:39:19 +08:00
parent 3d83a236b6
commit dc1ce6fe11
7 changed files with 21 additions and 43 deletions

View File

@ -150,8 +150,8 @@ void MediaInfo::parse(const string &url){
auto pos = steamid.find("?");
if(pos != string::npos){
_streamid = steamid.substr(0,pos);
_para_strs = steamid.substr(pos + 1);
_params = Parser::parseArgs(_para_strs);
_param_strs = steamid.substr(pos + 1);
_params = Parser::parseArgs(_param_strs);
if(_params.find(VHOST_KEY) != _params.end()){
_vhost = _params[VHOST_KEY];
}

View File

@ -85,7 +85,7 @@ public:
string _app;
string _streamid;
StrCaseMap _params;
string _para_strs;
string _param_strs;
};

View File

@ -45,9 +45,6 @@ void MediaPlayer::play(const char* strUrl) {
_strPrefix = strPrefix;
_parser = PlayerBase::createPlayer(strUrl);
_parser->setOnShutdown(_shutdownCB);
//todo(xzl) 修复此处
// _parser->setOnVideoCB(_onGetVideoCB);
// _parser->setOnAudioCB(_onGetAudioCB);
}
_parser->setOnPlayResult(_playResultCB);
_parser->mINI::operator=(*this);

View File

@ -64,24 +64,14 @@ private:
if(_pRtmpMediaSrc){
_pRtmpMediaSrc->onGetMetaData(val);
}
try {
_parser.reset(new RtmpDemuxer(val));
//todo(xzl) 修复此处
// _parser->setOnVideoCB(_onGetVideoCB);
// _parser->setOnAudioCB(_onGetAudioCB);
return true;
} catch (std::exception &ex) {
WarnL << ex.what();
return _pRtmpMediaSrc ? true : false;
}
_parser.reset(new RtmpDemuxer(val));
return true;
}
void onMediaData(const RtmpPacket::Ptr &chunkData) override {
if(_parser){
_parser->inputRtmp(chunkData);
}
if(_pRtmpMediaSrc){
_pRtmpMediaSrc->onWrite(chunkData);
}
}
_parser->inputRtmp(chunkData);
}
private:

View File

@ -67,26 +67,15 @@ private:
if(_pRtspMediaSrc){
_pRtspMediaSrc->onGetSDP(sdp);
}
try {
_parser.reset(new RtspDemuxer(sdp));
//todo(xzl) 修复此处
// _parser->setOnVideoCB(_onGetVideoCB);
// _parser->setOnAudioCB(_onGetAudioCB);
return true;
} catch (std::exception &ex) {
WarnL << ex.what();
return _pRtspMediaSrc ? true : false;
}
_parser.reset(new RtspDemuxer(sdp));
return true;
}
void onRecvRTP(const RtpPacket::Ptr &rtppt, const RtspTrack &track) override {
if(_parser){
_parser->inputRtp(rtppt);
}
if(_pRtspMediaSrc){
_pRtspMediaSrc->onWrite(rtppt,true);
}
}
if(_pRtspMediaSrc){
_pRtspMediaSrc->onWrite(rtppt,true);
}
_parser->inputRtp(rtppt);
}
private:
RtspMediaSource::Ptr _pRtspMediaSrc;

View File

@ -68,6 +68,8 @@ int main(int argc, char *argv[]) {
H264Decoder decoder;
YuvDisplayer displayer;
//todo(xzl) 修复此处
#if 0
player->setOnVideoCB([&](const H264Frame &frame) {
#ifndef __MACH__
SDLDisplayerHelper::Instance().doTask([&, frame]() {
@ -93,7 +95,7 @@ int main(int argc, char *argv[]) {
#endif
});
#endif
EventPoller::Instance().runLoop();
}
UDPServer::Destory();

View File

@ -34,7 +34,7 @@
#include "Http/HttpSession.h"
#include "Shell/ShellSession.h"
#include "Util/MD5.h"
#include "Rtmp/FlvMuxer.h"
#include "RtmpMuxer/FlvMuxer.h"
#ifdef ENABLE_OPENSSL
#include "Util/SSLBox.h"
@ -57,7 +57,7 @@ using namespace mediakit;
static onceToken s_token([](){
NoticeCenter::Instance().addListener(nullptr,Broadcast::kBroadcastOnGetRtspRealm,[](BroadcastOnGetRtspRealmArgs){
if(string("1") == args.m_streamid ){
if(string("1") == args._streamid ){
// live/1需要认证
EventPoller::Instance().async([invoker](){
//该流需要认证并且设置realm
@ -104,7 +104,7 @@ static onceToken s_token([](){
NoticeCenter::Instance().addListener(nullptr,Broadcast::kBroadcastRtmpPublish,[](BroadcastRtmpPublishArgs){
InfoL << args.m_vhost << " " << args.m_app << " " << args.m_streamid << " " << args.m_param_strs ;
InfoL << args._vhost << " " << args._app << " " << args._streamid << " " << args._param_strs ;
EventPoller::Instance().async([invoker](){
invoker("");//鉴权成功
//invoker("this is auth failed message");//鉴权失败
@ -112,7 +112,7 @@ static onceToken s_token([](){
});
NoticeCenter::Instance().addListener(nullptr,Broadcast::kBroadcastMediaPlayed,[](BroadcastMediaPlayedArgs){
InfoL << args.m_schema << " " << args.m_vhost << " " << args.m_app << " " << args.m_streamid << " " << args.m_param_strs ;
InfoL << args._schema << " " << args._vhost << " " << args._app << " " << args._streamid << " " << args._param_strs ;
EventPoller::Instance().async([invoker](){
invoker("");//鉴权成功
//invoker("this is auth failed message");//鉴权失败