mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +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;
|
||||
|
||||
/**
|
||||
* 获取track
|
||||
* @return
|
||||
*/
|
||||
virtual vector<Track::Ptr> getTracks(bool trackReady) const{
|
||||
return vector<Track::Ptr>(0);
|
||||
}
|
||||
protected:
|
||||
void regist() ;
|
||||
bool unregist() ;
|
||||
|
@ -96,6 +96,17 @@ public:
|
||||
int readerCount() override {
|
||||
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:
|
||||
RtmpDemuxer::Ptr _demuxer;
|
||||
MultiMediaSourceMuxer::Ptr _muxer;
|
||||
|
@ -88,6 +88,17 @@ public:
|
||||
int readerCount() override {
|
||||
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:
|
||||
RtspDemuxer::Ptr _demuxer;
|
||||
MultiMediaSourceMuxer::Ptr _muxer;
|
||||
|
Loading…
Reference in New Issue
Block a user