mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-25 15:36:42 +00:00
vtenc: assume 25 fps for unknown framerate
This is better than reporting no latency at all and then later failing in live pipelines. https://bugzilla.gnome.org/show_bug.cgi?id=786036
This commit is contained in:
parent
27c04cf912
commit
f5d8304724
1 changed files with 9 additions and 2 deletions
|
@ -1054,8 +1054,15 @@ gst_vtenc_update_latency (GstVTEnc * self)
|
||||||
CFNumberGetValue (value, kCFNumberSInt32Type, &frames);
|
CFNumberGetValue (value, kCFNumberSInt32Type, &frames);
|
||||||
if (self->latency_frames == -1 || self->latency_frames != frames) {
|
if (self->latency_frames == -1 || self->latency_frames != frames) {
|
||||||
self->latency_frames = frames;
|
self->latency_frames = frames;
|
||||||
|
if (self->video_info.fps_d == 0 || self->video_info.fps_n == 0) {
|
||||||
|
/* FIXME: Assume 25fps. This is better than reporting no latency at
|
||||||
|
* all and then later failing in live pipelines
|
||||||
|
*/
|
||||||
|
frame_duration = gst_util_uint64_scale (GST_SECOND, 1, 25);
|
||||||
|
} else {
|
||||||
frame_duration = gst_util_uint64_scale (GST_SECOND,
|
frame_duration = gst_util_uint64_scale (GST_SECOND,
|
||||||
self->video_info.fps_d, self->video_info.fps_n);
|
self->video_info.fps_d, self->video_info.fps_n);
|
||||||
|
}
|
||||||
latency = frame_duration * frames;
|
latency = frame_duration * frames;
|
||||||
GST_INFO_OBJECT (self,
|
GST_INFO_OBJECT (self,
|
||||||
"latency status %d frames %d fps %d/%d time %" GST_TIME_FORMAT, status,
|
"latency status %d frames %d fps %d/%d time %" GST_TIME_FORMAT, status,
|
||||||
|
|
Loading…
Reference in a new issue