mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge SRS2 for #851
This commit is contained in:
commit
c97f2233a2
6 changed files with 44 additions and 0 deletions
|
@ -115,6 +115,7 @@ SrsStatisticStream::SrsStatisticStream()
|
|||
kbps->set_io(NULL, NULL);
|
||||
|
||||
nb_clients = 0;
|
||||
nb_frames = 0;
|
||||
}
|
||||
|
||||
SrsStatisticStream::~SrsStatisticStream()
|
||||
|
@ -132,6 +133,7 @@ int SrsStatisticStream::dumps(SrsJsonObject* obj)
|
|||
obj->set("app", SrsJsonAny::str(app.c_str()));
|
||||
obj->set("live_ms", SrsJsonAny::integer(srs_get_system_time_ms()));
|
||||
obj->set("clients", SrsJsonAny::integer(nb_clients));
|
||||
obj->set("frames", SrsJsonAny::integer(nb_frames));
|
||||
obj->set("send_bytes", SrsJsonAny::integer(kbps->get_send_bytes()));
|
||||
obj->set("recv_bytes", SrsJsonAny::integer(kbps->get_recv_bytes()));
|
||||
|
||||
|
@ -342,6 +344,18 @@ int SrsStatistic::on_audio_info(SrsRequest* req, SrsAudioCodecId acodec, SrsAudi
|
|||
return ret;
|
||||
}
|
||||
|
||||
int SrsStatistic::on_video_frames(SrsRequest* req, int nb_frames)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
SrsStatisticVhost* vhost = create_vhost(req);
|
||||
SrsStatisticStream* stream = create_stream(vhost, req);
|
||||
|
||||
stream->nb_frames += nb_frames;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void SrsStatistic::on_stream_publish(SrsRequest* req, int cid)
|
||||
{
|
||||
SrsStatisticVhost* vhost = create_vhost(req);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue