1
0
Fork 0
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:
winlin 2017-04-23 20:55:51 +08:00
parent 4167715153
commit ff87318b95
7 changed files with 45 additions and 1 deletions

View file

@ -906,6 +906,7 @@ int SrsRtmpConn::do_publishing(SrsSource* source, SrsPublishRecvThread* trd)
}
int64_t nb_msgs = 0;
uint64_t nb_frames = 0;
while (!disposed) {
pprint->elapse();
@ -941,6 +942,14 @@ int SrsRtmpConn::do_publishing(SrsSource* source, SrsPublishRecvThread* trd)
break;
}
nb_msgs = trd->nb_msgs();
// Update the stat for video fps.
// @remark https://github.com/ossrs/srs/issues/851
SrsStatistic* stat = SrsStatistic::instance();
if ((ret = stat->on_video_frames(req, (int)(trd->nb_video_frames() - nb_frames))) != ERROR_SUCCESS) {
return ret;
}
nb_frames = trd->nb_video_frames();
// reportable
if (pprint->can_print()) {