时间戳统一使用毫秒

This commit is contained in:
xiongziliang
2018-10-26 14:12:16 +08:00
parent e816c56f2e
commit 8f8eda9337
24 changed files with 188 additions and 100 deletions

View File

@@ -184,12 +184,12 @@ RtpCodec::Ptr Factory::getRtpEncoderById(CodecId codecId,
}
}
RtpCodec::Ptr Factory::getRtpDecoderById(CodecId codecId, uint32_t ui32SampleRate) {
RtpCodec::Ptr Factory::getRtpDecoderById(CodecId codecId) {
switch (codecId){
case CodecH264:
return std::make_shared<H264RtpDecoder>();
case CodecAAC:
return std::make_shared<AACRtpDecoder>(ui32SampleRate);
return std::make_shared<AACRtpDecoder>();
default:
WarnL << "暂不支持该CodecId:" << codecId;
return nullptr;

View File

@@ -86,7 +86,7 @@ public:
* @param ui32SampleRate
* @return
*/
static RtpCodec::Ptr getRtpDecoderById(CodecId codecId, uint32_t ui32SampleRate);
static RtpCodec::Ptr getRtpDecoderById(CodecId codecId);
////////////////////////////////rtmp相关//////////////////////////////////

View File

@@ -32,6 +32,8 @@
class MultiMediaSourceMuxer {
public:
typedef std::shared_ptr<MultiMediaSourceMuxer> Ptr;
MultiMediaSourceMuxer(const string &vhost,
const string &strApp,
const string &strId,
@@ -68,6 +70,18 @@ public:
_rtmp->setListener(listener);
_rtsp->setListener(listener);
}
/**
* 返回总的消费者个数
* @return
*/
int readerCount() const{
return _rtsp->readerCount() + _rtmp->readerCount();
}
void updateTimeStamp(uint32_t stamp){
_rtsp->updateTimeStamp(stamp);
}
private:
RtmpMediaSourceMuxer::Ptr _rtmp;
RtspMediaSourceMuxer::Ptr _rtsp;