mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 22:55:52 +08:00
MediaSource类添加getTracks接口
This commit is contained in:
parent
a451da058c
commit
1cff946848
Binary file not shown.
@ -186,6 +186,14 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual int readerCount() = 0;
|
virtual int readerCount() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取track
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
virtual vector<Track::Ptr> getTracks(bool trackReady) const{
|
||||||
|
return vector<Track::Ptr>(0);
|
||||||
|
}
|
||||||
protected:
|
protected:
|
||||||
void regist() ;
|
void regist() ;
|
||||||
bool unregist() ;
|
bool unregist() ;
|
||||||
|
@ -96,6 +96,17 @@ public:
|
|||||||
int readerCount() override {
|
int readerCount() override {
|
||||||
return RtmpMediaSource::readerCount() + (_muxer ? _muxer->readerCount() : 0);
|
return RtmpMediaSource::readerCount() + (_muxer ? _muxer->readerCount() : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取track
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
vector<Track::Ptr> getTracks(bool trackReady) const override {
|
||||||
|
if(!_demuxer){
|
||||||
|
return this->RtmpMediaSource::getTracks(trackReady);
|
||||||
|
}
|
||||||
|
return _demuxer->getTracks(trackReady);
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
RtmpDemuxer::Ptr _demuxer;
|
RtmpDemuxer::Ptr _demuxer;
|
||||||
MultiMediaSourceMuxer::Ptr _muxer;
|
MultiMediaSourceMuxer::Ptr _muxer;
|
||||||
|
@ -88,6 +88,17 @@ public:
|
|||||||
int readerCount() override {
|
int readerCount() override {
|
||||||
return RtspMediaSource::readerCount() + (_muxer ? _muxer->readerCount() : 0);
|
return RtspMediaSource::readerCount() + (_muxer ? _muxer->readerCount() : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取track
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
vector<Track::Ptr> getTracks(bool trackReady) const override {
|
||||||
|
if(!_demuxer){
|
||||||
|
return this->RtspMediaSource::getTracks(trackReady);
|
||||||
|
}
|
||||||
|
return _demuxer->getTracks(trackReady);
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
RtspDemuxer::Ptr _demuxer;
|
RtspDemuxer::Ptr _demuxer;
|
||||||
MultiMediaSourceMuxer::Ptr _muxer;
|
MultiMediaSourceMuxer::Ptr _muxer;
|
||||||
|
Loading…
Reference in New Issue
Block a user