1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Support composited bridges for 1:N protocols converting. v6.0.41 (#3392)

Co-authored-by: john <hondaxiao@tencent.com>
Co-authored-by: chundonglinlin <chundonglinlin@163.com>
This commit is contained in:
Winlin 2023-04-01 21:34:59 +08:00 committed by GitHub
parent 771ae0a1a6
commit dcd02fe69c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 770 additions and 400 deletions

View file

@ -18,6 +18,7 @@
#include <srs_core_performance.hpp>
#include <srs_protocol_st.hpp>
#include <srs_app_hourglass.hpp>
#include <srs_app_stream_bridge.hpp>
class SrsFormat;
class SrsRtmpFormat;
@ -471,19 +472,6 @@ public:
// Global singleton instance.
extern SrsLiveSourceManager* _srs_sources;
// For RTMP2RTC, bridge SrsLiveSource to SrsRtcSource
class ISrsLiveSourceBridge
{
public:
ISrsLiveSourceBridge();
virtual ~ISrsLiveSourceBridge();
public:
virtual srs_error_t on_publish() = 0;
virtual srs_error_t on_audio(SrsSharedPtrMessage* audio) = 0;
virtual srs_error_t on_video(SrsSharedPtrMessage* video) = 0;
virtual void on_unpublish() = 0;
};
// The live streaming source.
class SrsLiveSource : public ISrsReloadHandler
{
@ -518,7 +506,7 @@ private:
// The event handler.
ISrsLiveSourceHandler* handler;
// The source bridge for other source.
ISrsLiveSourceBridge* bridge_;
ISrsStreamBridge* bridge_;
// The edge control service
SrsPlayEdge* play_edge;
SrsPublishEdge* publish_edge;
@ -551,7 +539,7 @@ public:
// Initialize the hls with handlers.
virtual srs_error_t initialize(SrsRequest* r, ISrsLiveSourceHandler* h);
// Bridge to other source, forward packets to it.
void set_bridge(ISrsLiveSourceBridge* v);
void set_bridge(ISrsStreamBridge* v);
// Interface ISrsReloadHandler
public:
virtual srs_error_t on_reload_vhost_play(std::string vhost);
@ -572,6 +560,7 @@ public:
public:
// TODO: FIXME: Use SrsSharedPtrMessage instead.
virtual srs_error_t on_audio(SrsCommonMessage* audio);
srs_error_t on_frame(SrsSharedPtrMessage* msg);
private:
virtual srs_error_t on_audio_imp(SrsSharedPtrMessage* audio);
public: