add MediaTuple

This commit is contained in:
Johnny
2023-05-25 16:23:24 +08:00
committed by 夏楚
parent f4ee607feb
commit 0232caf068
41 changed files with 242 additions and 273 deletions

View File

@@ -39,10 +39,7 @@ public:
using RingDataType = std::shared_ptr<toolkit::List<TSPacket::Ptr> >;
using RingType = toolkit::RingBuffer<RingDataType>;
TSMediaSource(const std::string &vhost,
const std::string &app,
const std::string &stream_id,
int ring_size = TS_GOP_SIZE) : MediaSource(TS_SCHEMA, vhost, app, stream_id), _ring_size(ring_size) {}
TSMediaSource(const MediaTuple& tuple, int ring_size = TS_GOP_SIZE): MediaSource(TS_SCHEMA, tuple), _ring_size(ring_size) {}
~TSMediaSource() override { flush(); }

View File

@@ -21,12 +21,9 @@ class TSMediaSourceMuxer final : public MpegMuxer, public MediaSourceEventInterc
public:
using Ptr = std::shared_ptr<TSMediaSourceMuxer>;
TSMediaSourceMuxer(const std::string &vhost,
const std::string &app,
const std::string &stream_id,
const ProtocolOption &option) : MpegMuxer(false) {
TSMediaSourceMuxer(const MediaTuple& tuple, const ProtocolOption &option) : MpegMuxer(false) {
_option = option;
_media_src = std::make_shared<TSMediaSource>(vhost, app, stream_id);
_media_src = std::make_shared<TSMediaSource>(tuple);
}
~TSMediaSourceMuxer() override { MpegMuxer::flush(); };