初始提交

This commit is contained in:
xzl
2017-04-01 16:35:56 +08:00
parent aef0ecbcb9
commit 3f73024a9b
131 changed files with 18216 additions and 0 deletions

34
src/Player/PlayerBase.cpp Normal file
View File

@@ -0,0 +1,34 @@
/*
* PlayerBase.cpp
*
* Created on: 2016年12月1日
* Author: xzl
*/
#include "PlayerBase.h"
#include "Rtmp/RtmpPlayerImp.h"
#include "Rtsp/RtspPlayerImp.h"
#include "Rtsp/Rtsp.h"
#include <algorithm>
using namespace std;
using namespace ZL::Rtmp;
using namespace ZL::Rtsp;
namespace ZL {
namespace Player {
PlayerBase::Ptr PlayerBase::createPlayer(const char* strUrl) {
string prefix = FindField(strUrl, NULL, "://");
if (strcasecmp("rtsp",prefix.data()) == 0) {
return PlayerBase::Ptr(new RtspPlayerImp());
}
if (strcasecmp("rtmp",prefix.data()) == 0) {
return PlayerBase::Ptr(new RtmpPlayerImp());
}
return PlayerBase::Ptr(new RtspPlayerImp());
}
} /* namespace Player */
} /* namespace ZL */