mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-01 09:01:33 +08:00
35 lines
724 B
C++
35 lines
724 B
C++
|
/*
|
||
|
* 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 */
|