整理命名空间 (#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:
夏楚
2022-02-02 20:34:50 +08:00
committed by GitHub
parent 80a0e27d8c
commit c72cf4cbcc
239 changed files with 1887 additions and 1766 deletions

View File

@@ -17,11 +17,11 @@
namespace mediakit {
class RtpProcess : public SockInfo, public MediaSinkInterface, public MediaSourceEventInterceptor, public std::enable_shared_from_this<RtpProcess>{
class RtpProcess : public toolkit::SockInfo, public MediaSinkInterface, public MediaSourceEventInterceptor, public std::enable_shared_from_this<RtpProcess>{
public:
typedef std::shared_ptr<RtpProcess> Ptr;
friend class RtpProcessHelper;
RtpProcess(const string &stream_id);
RtpProcess(const std::string &stream_id);
~RtpProcess();
/**
@@ -34,7 +34,7 @@ public:
* @param dts_out 解析出最新的dts
* @return 是否解析成功
*/
bool inputRtp(bool is_udp, const Socket::Ptr &sock, const char *data, size_t len, const struct sockaddr *addr , uint32_t *dts_out = nullptr);
bool inputRtp(bool is_udp, const toolkit::Socket::Ptr &sock, const char *data, size_t len, const struct sockaddr *addr , uint32_t *dts_out = nullptr);
/**
* 是否超时,用于超时移除对象
@@ -49,7 +49,7 @@ public:
/**
* 设置onDetach事件回调
*/
void setOnDetach(const function<void()> &cb);
void setOnDetach(const std::function<void()> &cb);
/**
* 设置onDetach事件回调,false检查RTP超时true停止
@@ -57,11 +57,11 @@ public:
void setStopCheckRtp(bool is_check=false);
/// SockInfo override
string get_local_ip() override;
std::string get_local_ip() override;
uint16_t get_local_port() override;
string get_peer_ip() override;
std::string get_peer_ip() override;
uint16_t get_peer_port() override;
string getIdentifier() const override;
std::string getIdentifier() const override;
int getTotalReaderCount();
void setListener(const std::weak_ptr<MediaSourceEvent> &listener);
@@ -74,7 +74,7 @@ protected:
//// MediaSourceEvent override ////
MediaOriginType getOriginType(MediaSource &sender) const override;
string getOriginUrl(MediaSource &sender) const override;
std::string getOriginUrl(MediaSource &sender) const override;
std::shared_ptr<SockInfo> getOriginSock(MediaSource &sender) const override;
private:
@@ -85,19 +85,19 @@ private:
uint32_t _dts = 0;
uint64_t _total_bytes = 0;
struct sockaddr _addr{0};
Socket::Ptr _sock;
toolkit::Socket::Ptr _sock;
MediaInfo _media_info;
Ticker _last_frame_time;
function<void()> _on_detach;
toolkit::Ticker _last_frame_time;
std::function<void()> _on_detach;
std::shared_ptr<FILE> _save_file_rtp;
std::shared_ptr<FILE> _save_file_video;
ProcessInterface::Ptr _process;
MultiMediaSourceMuxer::Ptr _muxer;
atomic_bool _stop_rtp_check{false};
atomic_flag _busy_flag{false};
Ticker _last_check_alive;
recursive_mutex _func_mtx;
deque<function<void()> > _cached_func;
std::atomic_bool _stop_rtp_check{false};
std::atomic_flag _busy_flag{false};
toolkit::Ticker _last_check_alive;
std::recursive_mutex _func_mtx;
std::deque<std::function<void()> > _cached_func;
};
}//namespace mediakit