Make available the media_info variable for the class inherited from WebRtcSession and HttpSession. (#2505 #2461)

This commit is contained in:
a-ucontrol 2023-05-29 09:48:13 +03:00 committed by GitHub
parent 18dbbc8d19
commit 51e9313275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -124,6 +124,9 @@ private:
//设置socket标志 //设置socket标志
void setSocketFlags(); void setSocketFlags();
protected:
MediaInfo _mediaInfo;
private: private:
bool _is_live_stream = false; bool _is_live_stream = false;
bool _live_over_websocket = false; bool _live_over_websocket = false;
@ -132,7 +135,6 @@ private:
std::string _origin; std::string _origin;
Parser _parser; Parser _parser;
toolkit::Ticker _ticker; toolkit::Ticker _ticker;
MediaInfo _mediaInfo;
TSMediaSource::RingType::RingReader::Ptr _ts_reader; TSMediaSource::RingType::RingReader::Ptr _ts_reader;
FMP4MediaSource::RingType::RingReader::Ptr _fmp4_reader; FMP4MediaSource::RingType::RingReader::Ptr _fmp4_reader;
//处理content数据的callback //处理content数据的callback

View File

@ -21,6 +21,7 @@ public:
using Ptr = std::shared_ptr<WebRtcPlayer>; using Ptr = std::shared_ptr<WebRtcPlayer>;
~WebRtcPlayer() override = default; ~WebRtcPlayer() override = default;
static Ptr create(const EventPoller::Ptr &poller, const RtspMediaSource::Ptr &src, const MediaInfo &info, bool preferred_tcp = false); static Ptr create(const EventPoller::Ptr &poller, const RtspMediaSource::Ptr &src, const MediaInfo &info, bool preferred_tcp = false);
MediaInfo getMediaInfo() { return _media_info; }
protected: protected:
///////WebRtcTransportImp override/////// ///////WebRtcTransportImp override///////

View File

@ -35,6 +35,9 @@ public:
void onManager() override; void onManager() override;
static EventPoller::Ptr queryPoller(const Buffer::Ptr &buffer); static EventPoller::Ptr queryPoller(const Buffer::Ptr &buffer);
protected:
WebRtcTransportImp::Ptr _transport;
private: private:
//// HttpRequestSplitter override //// //// HttpRequestSplitter override ////
ssize_t onRecvHeader(const char *data, size_t len) override; ssize_t onRecvHeader(const char *data, size_t len) override;
@ -47,7 +50,6 @@ private:
bool _find_transport = true; bool _find_transport = true;
Ticker _ticker; Ticker _ticker;
std::weak_ptr<toolkit::TcpServer> _server; std::weak_ptr<toolkit::TcpServer> _server;
WebRtcTransportImp::Ptr _transport;
}; };
}// namespace mediakit }// namespace mediakit