mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-16 04:55:58 +08:00
添加流创建时间、在线时间
This commit is contained in:
@@ -43,6 +43,7 @@ MediaSource::MediaSource(const string &schema, const string &vhost, const string
|
||||
_schema = schema;
|
||||
_app = app;
|
||||
_stream_id = stream_id;
|
||||
_create_stamp = time(NULL);
|
||||
}
|
||||
|
||||
MediaSource::~MediaSource() {
|
||||
@@ -70,6 +71,15 @@ int MediaSource::getBytesSpeed(){
|
||||
return _speed.getSpeed();
|
||||
}
|
||||
|
||||
uint64_t MediaSource::getCreateStamp() const {
|
||||
return _create_stamp;
|
||||
}
|
||||
|
||||
uint64_t MediaSource::getAliveSecond() const {
|
||||
//使用Ticker对象获取存活时间的目的是防止修改系统时间导致回退
|
||||
return _ticker.createdTime() / 1000;
|
||||
}
|
||||
|
||||
vector<Track::Ptr> MediaSource::getTracks(bool ready) const {
|
||||
auto listener = _listener.lock();
|
||||
if(!listener){
|
||||
|
||||
Reference in New Issue
Block a user