mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-04 01:37:33 +08:00
支持bitrate
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user