mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-01 23:49:00 +08:00
整理命名空间 (#1409)
* feat: remove using namespace mediakit in header files. (cherry picked from commit d44aeb339a8a0e1f0455be82b21fe4b1b536299f) * feat: remove using namespace mediakit in FFmpegSource.h * feat: remove using namespace mediakit in RtpExt.h * feat: remove using namespace mediakit in header files. * feat: remove using namespace std in header files. * feat: remove using namespace std in header files when zltoolkit remove std in header * 补充命名空间 * 整理命名空间 * 整理命名空间2 * 修复macos ci * 修复编译问题 * 修复编译问题2 * 修复编译问题3 Co-authored-by: Johnny <hellojinqiang@gmail.com> Co-authored-by: Xiaofeng Wang <wasphin@gmail.com>
This commit is contained in:
@@ -24,19 +24,16 @@
|
||||
#include "Network/Socket.h"
|
||||
#include "Network/TcpClient.h"
|
||||
|
||||
using namespace toolkit;
|
||||
using namespace mediakit::Client;
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
//实现了rtmp播放器协议部分的功能,及数据接收功能
|
||||
class RtmpPlayer : public PlayerBase, public TcpClient, public RtmpProtocol {
|
||||
class RtmpPlayer : public PlayerBase, public toolkit::TcpClient, public RtmpProtocol {
|
||||
public:
|
||||
typedef std::shared_ptr<RtmpPlayer> Ptr;
|
||||
RtmpPlayer(const EventPoller::Ptr &poller);
|
||||
RtmpPlayer(const toolkit::EventPoller::Ptr &poller);
|
||||
~RtmpPlayer() override;
|
||||
|
||||
void play(const string &strUrl) override;
|
||||
void play(const std::string &strUrl) override;
|
||||
void pause(bool bPause) override;
|
||||
void speed(float speed) override;
|
||||
void teardown() override;
|
||||
@@ -50,16 +47,16 @@ protected:
|
||||
protected:
|
||||
void onMediaData_l(RtmpPacket::Ptr chunk_data);
|
||||
//在获取config帧后才触发onPlayResult_l(而不是收到play命令回复),所以此时所有track都初始化完毕了
|
||||
void onPlayResult_l(const SockException &ex, bool handshake_done);
|
||||
void onPlayResult_l(const toolkit::SockException &ex, bool handshake_done);
|
||||
|
||||
//form Tcpclient
|
||||
void onRecv(const Buffer::Ptr &buf) override;
|
||||
void onConnect(const SockException &err) override;
|
||||
void onErr(const SockException &ex) override;
|
||||
void onRecv(const toolkit::Buffer::Ptr &buf) override;
|
||||
void onConnect(const toolkit::SockException &err) override;
|
||||
void onErr(const toolkit::SockException &ex) override;
|
||||
//from RtmpProtocol
|
||||
void onRtmpChunk(RtmpPacket::Ptr chunk_data) override;
|
||||
void onStreamDry(uint32_t stream_index) override;
|
||||
void onSendRawData(Buffer::Ptr buffer) override {
|
||||
void onSendRawData(toolkit::Buffer::Ptr buffer) override {
|
||||
send(std::move(buffer));
|
||||
}
|
||||
|
||||
@@ -82,9 +79,9 @@ protected:
|
||||
void send_pause(bool pause);
|
||||
|
||||
private:
|
||||
string _app;
|
||||
string _stream_id;
|
||||
string _tc_url;
|
||||
std::string _app;
|
||||
std::string _stream_id;
|
||||
std::string _tc_url;
|
||||
|
||||
bool _paused = false;
|
||||
bool _metadata_got = false;
|
||||
@@ -95,18 +92,18 @@ private:
|
||||
uint32_t _seek_ms = 0;
|
||||
uint32_t _fist_stamp[2] = {0, 0};
|
||||
uint32_t _now_stamp[2] = {0, 0};
|
||||
Ticker _now_stamp_ticker[2];
|
||||
deque<function<void(AMFValue &dec)> > _deque_on_status;
|
||||
unordered_map<int, function<void(AMFDecoder &dec)> > _map_on_result;
|
||||
toolkit::Ticker _now_stamp_ticker[2];
|
||||
std::deque<std::function<void(AMFValue &dec)> > _deque_on_status;
|
||||
std::unordered_map<int, std::function<void(AMFDecoder &dec)> > _map_on_result;
|
||||
|
||||
//rtmp接收超时计时器
|
||||
Ticker _rtmp_recv_ticker;
|
||||
toolkit::Ticker _rtmp_recv_ticker;
|
||||
//心跳发送定时器
|
||||
std::shared_ptr<Timer> _beat_timer;
|
||||
std::shared_ptr<toolkit::Timer> _beat_timer;
|
||||
//播放超时定时器
|
||||
std::shared_ptr<Timer> _play_timer;
|
||||
std::shared_ptr<toolkit::Timer> _play_timer;
|
||||
//rtmp接收超时定时器
|
||||
std::shared_ptr<Timer> _rtmp_recv_timer;
|
||||
std::shared_ptr<toolkit::Timer> _rtmp_recv_timer;
|
||||
};
|
||||
|
||||
} /* namespace mediakit */
|
||||
|
||||
Reference in New Issue
Block a user