mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-16 04:55:58 +08:00
初始提交
This commit is contained in:
34
src/Player/PlayerBase.cpp
Normal file
34
src/Player/PlayerBase.cpp
Normal 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 */
|
||||
Reference in New Issue
Block a user