支持bitrate

This commit is contained in:
xiongziliang
2020-12-05 12:22:17 +08:00
parent 42679cdf98
commit 55cf411c1e
23 changed files with 102 additions and 52 deletions

View File

@@ -68,8 +68,11 @@ const string& MediaSource::getId() const {
return _stream_id;
}
int MediaSource::getBytesSpeed(){
return _speed.getSpeed();
int MediaSource::getBytesSpeed(TrackType type){
if(type == TrackInvalid){
return _speed[TrackVideo].getSpeed() + _speed[TrackAudio].getSpeed();
}
return _speed[type].getSpeed();
}
uint64_t MediaSource::getCreateStamp() const {

View File

@@ -220,7 +220,7 @@ public:
virtual void setTimeStamp(uint32_t stamp) {};
// 获取数据速率单位bytes/s
int getBytesSpeed();
int getBytesSpeed(TrackType type = TrackInvalid);
// 获取流创建GMT unix时间戳单位秒
uint64_t getCreateStamp() const;
// 获取流上线时间,单位秒
@@ -286,7 +286,7 @@ private:
void emitEvent(bool regist);
protected:
BytesSpeed _speed;
BytesSpeed _speed[TrackMax];
private:
time_t _create_stamp;