mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix #851, HTTP API support number of video frames for FPS. 2.0.240
This commit is contained in:
parent
4167715153
commit
ff87318b95
7 changed files with 45 additions and 1 deletions
|
@ -111,6 +111,7 @@ SrsStatisticStream::SrsStatisticStream()
|
|||
kbps->set_io(NULL, NULL);
|
||||
|
||||
nb_clients = 0;
|
||||
nb_frames = 0;
|
||||
}
|
||||
|
||||
SrsStatisticStream::~SrsStatisticStream()
|
||||
|
@ -129,6 +130,7 @@ int SrsStatisticStream::dumps(stringstream& ss)
|
|||
<< SRS_JFIELD_STR("app", app) << SRS_JFIELD_CONT
|
||||
<< SRS_JFIELD_ORG("live_ms", srs_get_system_time_ms()) << SRS_JFIELD_CONT
|
||||
<< SRS_JFIELD_ORG("clients", nb_clients) << SRS_JFIELD_CONT
|
||||
<< SRS_JFIELD_ORG("frames", nb_frames) << SRS_JFIELD_CONT
|
||||
<< SRS_JFIELD_ORG("send_bytes", kbps->get_send_bytes()) << SRS_JFIELD_CONT
|
||||
<< SRS_JFIELD_ORG("recv_bytes", kbps->get_recv_bytes()) << SRS_JFIELD_CONT
|
||||
<< SRS_JFIELD_OBJ("kbps")
|
||||
|
@ -327,6 +329,18 @@ int SrsStatistic::on_audio_info(SrsRequest* req,
|
|||
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