mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-30 23:02:24 +08:00
简化命名空间
This commit is contained in:
@@ -8,8 +8,7 @@
|
||||
|
||||
#define FILE_BUF_SIZE (64 * 1024)
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
|
||||
FlvMuxer::FlvMuxer() {
|
||||
@@ -227,5 +226,4 @@ FlvRecorder::~FlvRecorder() {
|
||||
}
|
||||
|
||||
|
||||
}//namespace Rtmp
|
||||
}//namespace ZL
|
||||
}//namespace mediakit
|
||||
|
||||
@@ -8,11 +8,9 @@
|
||||
#include "Rtmp.h"
|
||||
#include "RtmpMediaSource.h"
|
||||
#include "Network/Socket.h"
|
||||
using namespace toolkit;
|
||||
|
||||
using namespace ZL::Network;
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
class FlvMuxer{
|
||||
public:
|
||||
@@ -55,7 +53,6 @@ private:
|
||||
};
|
||||
|
||||
|
||||
}//namespace Rtmp
|
||||
}//namespace ZL
|
||||
}//namespace mediakit
|
||||
|
||||
#endif //ZLMEDIAKIT_FLVRECORDER_H
|
||||
|
||||
@@ -31,10 +31,7 @@
|
||||
#include "Util/util.h"
|
||||
#include "Util/logger.h"
|
||||
#include "Network/sockutil.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace ZL::Util;
|
||||
using namespace ZL::Network;
|
||||
using namespace toolkit;
|
||||
|
||||
#define PORT 1935
|
||||
#define DEFAULT_CHUNK_LEN 128
|
||||
|
||||
@@ -44,14 +44,9 @@
|
||||
#include "Util/ResourcePool.h"
|
||||
#include "Util/NoticeCenter.h"
|
||||
#include "Thread/ThreadPool.h"
|
||||
using namespace toolkit;
|
||||
|
||||
using namespace std;
|
||||
using namespace ZL::Util;
|
||||
using namespace ZL::Thread;
|
||||
using namespace ZL::Media;
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
class RtmpMediaSource: public MediaSource {
|
||||
public:
|
||||
@@ -122,7 +117,6 @@ protected:
|
||||
bool _bRegisted = false;
|
||||
};
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
#endif /* SRC_RTMP_RTMPMEDIASOURCE_H_ */
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
|
||||
#include "RtmpParser.h"
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
RtmpParser::RtmpParser(const AMFValue &val) {
|
||||
auto videoCodec = val["videocodecid"];
|
||||
@@ -232,29 +231,4 @@ inline void RtmpParser::onCheckMedia(const AMFValue& obj) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
@@ -34,16 +34,12 @@
|
||||
#include "Player/Player.h"
|
||||
#include "Util/TimeTicker.h"
|
||||
#include "Player/PlayerBase.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace ZL::Util;
|
||||
using namespace ZL::Player;
|
||||
using namespace toolkit;
|
||||
|
||||
#define H264_CODEC_ID 7
|
||||
#define AAC_CODEC_ID 10
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
class RtmpParser : public PlayerBase{
|
||||
public:
|
||||
@@ -112,7 +108,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
#endif /* SRC_RTMP_RTMPPARSER_H_ */
|
||||
|
||||
@@ -30,11 +30,9 @@
|
||||
#include "Util/util.h"
|
||||
#include "Util/onceToken.h"
|
||||
#include "Thread/ThreadPool.h"
|
||||
using namespace toolkit;
|
||||
|
||||
using namespace ZL::Util;
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
unordered_map<string, RtmpPlayer::rtmpCMDHandle> RtmpPlayer::g_mapCmd;
|
||||
RtmpPlayer::RtmpPlayer() {
|
||||
@@ -351,6 +349,5 @@ void RtmpPlayer::seekToTime(float fTime){
|
||||
|
||||
}
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
|
||||
@@ -39,14 +39,9 @@
|
||||
#include "Util/TimeTicker.h"
|
||||
#include "Network/Socket.h"
|
||||
#include "Network/TcpClient.h"
|
||||
using namespace toolkit;
|
||||
|
||||
using namespace std;
|
||||
using namespace ZL::Util;
|
||||
using namespace ZL::Player;
|
||||
using namespace ZL::Network;
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
class RtmpPlayer:public PlayerBase, public TcpClient, public RtmpProtocol{
|
||||
public:
|
||||
@@ -156,7 +151,6 @@ private:
|
||||
Ticker _aNowStampTicker[2];
|
||||
};
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
#endif /* SRC_RTMP_RtmpPlayer2_H_ */
|
||||
|
||||
@@ -35,13 +35,10 @@
|
||||
#include "RtmpMediaSource.h"
|
||||
#include "Poller/Timer.h"
|
||||
#include "Util/TimeTicker.h"
|
||||
using namespace toolkit;
|
||||
|
||||
using namespace std;
|
||||
using namespace ZL::Util;
|
||||
using namespace ZL::Player;
|
||||
namespace mediakit {
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
class RtmpPlayerImp: public PlayerImp<RtmpPlayer,RtmpParser> {
|
||||
public:
|
||||
typedef std::shared_ptr<RtmpPlayerImp> Ptr;
|
||||
@@ -92,7 +89,6 @@ private:
|
||||
};
|
||||
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
|
||||
} /* namespace mediakit */
|
||||
|
||||
#endif /* SRC_RTMP_RTMPPLAYERIMP_H_ */
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "Util/util.h"
|
||||
#include "Util/onceToken.h"
|
||||
#include "Thread/ThreadPool.h"
|
||||
using namespace ZL::Util;
|
||||
using namespace toolkit;
|
||||
|
||||
#ifdef ENABLE_OPENSSL
|
||||
#include "Util/SSLBox.h"
|
||||
@@ -72,8 +72,7 @@ static string openssl_HMACsha256(const void *key,unsigned int key_len,
|
||||
#define S2_FMS_KEY_SIZE 68
|
||||
#define C1_OFFSET_SIZE 4
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
RtmpProtocol::RtmpProtocol() {
|
||||
_nextHandle = [this](){
|
||||
@@ -697,5 +696,4 @@ BufferRaw::Ptr RtmpProtocol::obtainBuffer(const void *data, int len) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
@@ -39,11 +39,9 @@
|
||||
#include "Util/ResourcePool.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace ZL::Util;
|
||||
using namespace ZL::Network;
|
||||
using namespace toolkit;
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
class RtmpProtocol {
|
||||
public:
|
||||
@@ -119,7 +117,6 @@ private:
|
||||
function<void()> _nextHandle;
|
||||
};
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
#endif /* SRC_RTMP_RTMPPROTOCOL_H_ */
|
||||
|
||||
@@ -29,11 +29,9 @@
|
||||
#include "Util/util.h"
|
||||
#include "Util/onceToken.h"
|
||||
#include "Thread/ThreadPool.h"
|
||||
using namespace toolkit;
|
||||
|
||||
using namespace ZL::Util;
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
static int kSockFlags = SOCKET_DEFAULE_FLAGS | FLAG_MORE;
|
||||
|
||||
@@ -286,6 +284,5 @@ void RtmpPusher::onRtmpChunk(RtmpPacket &chunkData) {
|
||||
}
|
||||
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
#include "RtmpMediaSource.h"
|
||||
#include "Network/TcpClient.h"
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
class RtmpPusher: public RtmpProtocol , public TcpClient{
|
||||
public:
|
||||
@@ -123,7 +122,6 @@ private:
|
||||
Event _onPublished;
|
||||
};
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
#endif /* SRC_RTMP_RTMPPUSHER_H_ */
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
#include "Common/config.h"
|
||||
#include "Util/onceToken.h"
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
static int kSockFlags = SOCKET_DEFAULE_FLAGS | FLAG_MORE;
|
||||
|
||||
@@ -191,7 +190,7 @@ void RtmpSession::onCmd_publish(AMFDecoder &dec) {
|
||||
onRes(err);
|
||||
});
|
||||
};
|
||||
auto flag = NoticeCenter::Instance().emitEvent(Config::Broadcast::kBroadcastRtmpPublish,
|
||||
auto flag = NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastRtmpPublish,
|
||||
_mediaInfo,
|
||||
invoker,
|
||||
*this);
|
||||
@@ -506,7 +505,7 @@ void RtmpSession::onRtmpChunk(RtmpPacket &chunkData) {
|
||||
if (!_pPublisherSrc) {
|
||||
throw std::runtime_error("Not a rtmp publisher!");
|
||||
}
|
||||
GET_CONFIG_AND_REGISTER(bool,rtmp_modify_stamp,Config::Rtmp::kModifyStamp);
|
||||
GET_CONFIG_AND_REGISTER(bool,rtmp_modify_stamp,Rtmp::kModifyStamp);
|
||||
if(rtmp_modify_stamp){
|
||||
chunkData.timeStamp = _stampTicker[chunkData.typeId % 2].elapsedTime();
|
||||
}
|
||||
@@ -565,5 +564,4 @@ void RtmpSession::cancelDelyaTask(){
|
||||
}
|
||||
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
@@ -37,12 +37,9 @@
|
||||
#include "Util/util.h"
|
||||
#include "Util/TimeTicker.h"
|
||||
#include "Network/TcpSession.h"
|
||||
using namespace toolkit;
|
||||
|
||||
using namespace ZL::Util;
|
||||
using namespace ZL::Network;
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
class RtmpSession: public TcpSession ,public RtmpProtocol , public MediaSourceEvent{
|
||||
public:
|
||||
@@ -107,7 +104,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
#endif /* SRC_RTMP_RTMPSESSION_H_ */
|
||||
|
||||
@@ -29,12 +29,9 @@
|
||||
#include "Util/util.h"
|
||||
#include "Util/base64.h"
|
||||
#include "Network/sockutil.h"
|
||||
using namespace toolkit;
|
||||
|
||||
using namespace ZL::Util;
|
||||
using namespace ZL::Network;
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
RtmpToRtspMediaSource::RtmpToRtspMediaSource(const string &vhost,
|
||||
const string &app,
|
||||
@@ -89,7 +86,7 @@ void RtmpToRtspMediaSource::makeSDP() {
|
||||
// _pRtspSrc->onGetRTP(pkt,bKeyPos);
|
||||
// };
|
||||
//
|
||||
// GET_CONFIG_AND_REGISTER(uint32_t,videoMtu,Config::Rtp::kVideoMtuSize);
|
||||
// GET_CONFIG_AND_REGISTER(uint32_t,videoMtu,Rtp::kVideoMtuSize);
|
||||
// _pRtpMaker_h264.reset(new RtpMaker_H264(lam, ssrc0,videoMtu));
|
||||
//
|
||||
// char strTemp[100];
|
||||
@@ -131,7 +128,7 @@ void RtmpToRtspMediaSource::makeSDP() {
|
||||
// auto lam = [this](const RtpPacket::Ptr &pkt, bool bKeyPos) {
|
||||
// _pRtspSrc->onGetRTP(pkt,bKeyPos);
|
||||
// };
|
||||
// GET_CONFIG_AND_REGISTER(uint32_t,audioMtu,Config::Rtp::kAudioMtuSize);
|
||||
// GET_CONFIG_AND_REGISTER(uint32_t,audioMtu,Rtp::kAudioMtuSize);
|
||||
// _pRtpMaker_aac.reset(new RtpMaker_AAC(lam, ssrc1, audioMtu,_pParser->getAudioSampleRate()));
|
||||
//
|
||||
// char configStr[32];
|
||||
@@ -159,5 +156,4 @@ void RtmpToRtspMediaSource::makeSDP() {
|
||||
}
|
||||
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
@@ -43,14 +43,10 @@
|
||||
#include "Util/util.h"
|
||||
#include "Util/logger.h"
|
||||
#include "MediaFile/MediaRecorder.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace ZL::Util;
|
||||
using namespace ZL::Rtsp;
|
||||
using namespace ZL::MediaFile;
|
||||
using namespace toolkit;
|
||||
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
namespace mediakit {
|
||||
|
||||
class RtmpToRtspMediaSource: public RtmpMediaSource {
|
||||
public:
|
||||
@@ -100,7 +96,6 @@ private:
|
||||
void makeSDP();
|
||||
};
|
||||
|
||||
} /* namespace Rtmp */
|
||||
} /* namespace ZL */
|
||||
} /* namespace mediakit */
|
||||
|
||||
#endif /* SRC_RTMP_RTMPTORTSPMEDIASOURCE_H_ */
|
||||
|
||||
@@ -30,9 +30,7 @@
|
||||
#include "Util/util.h"
|
||||
#include "Util/logger.h"
|
||||
#include "Network/sockutil.h"
|
||||
|
||||
using namespace ZL::Util;
|
||||
using namespace ZL::Network;
|
||||
using namespace toolkit;
|
||||
|
||||
/////////////////////AMFValue/////////////////////////////
|
||||
inline void AMFValue::destroy() {
|
||||
|
||||
@@ -30,9 +30,7 @@
|
||||
#include <stdarg.h>
|
||||
#include "Util/util.h"
|
||||
#include "Network/sockutil.h"
|
||||
|
||||
using namespace ZL::Util;
|
||||
using namespace ZL::Network;
|
||||
using namespace toolkit;
|
||||
|
||||
/*
|
||||
* Used to do unaligned loads on archs that don't support them. GCC can mostly
|
||||
|
||||
Reference in New Issue
Block a user