mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
videoencoder: fix forwarding of GstForceKeyUnit events
Use the frame id to match the output forced keyframe with the event that forced it. https://bugzilla.gnome.org/show_bug.cgi?id=706885
This commit is contained in:
parent
80fca3b4e3
commit
688505de88
1 changed files with 8 additions and 0 deletions
|
@ -174,6 +174,7 @@ struct _ForcedKeyUnitEvent
|
||||||
gboolean pending; /* TRUE if this was requested already */
|
gboolean pending; /* TRUE if this was requested already */
|
||||||
gboolean all_headers;
|
gboolean all_headers;
|
||||||
guint count;
|
guint count;
|
||||||
|
guint32 frame_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1325,6 +1326,7 @@ gst_video_encoder_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fevt) {
|
if (fevt) {
|
||||||
|
fevt->frame_id = frame->system_frame_number;
|
||||||
GST_DEBUG_OBJECT (encoder,
|
GST_DEBUG_OBJECT (encoder,
|
||||||
"Forcing a key unit at running time %" GST_TIME_FORMAT,
|
"Forcing a key unit at running time %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (running_time));
|
GST_TIME_ARGS (running_time));
|
||||||
|
@ -1792,6 +1794,12 @@ gst_video_encoder_finish_frame (GstVideoEncoder * encoder,
|
||||||
if (!tmp->pending)
|
if (!tmp->pending)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* Exact match using the frame id */
|
||||||
|
if (frame->system_frame_number == tmp->frame_id) {
|
||||||
|
fevt = tmp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Simple case, keyunit ASAP */
|
/* Simple case, keyunit ASAP */
|
||||||
if (tmp->running_time == GST_CLOCK_TIME_NONE) {
|
if (tmp->running_time == GST_CLOCK_TIME_NONE) {
|
||||||
fevt = tmp;
|
fevt = tmp;
|
||||||
|
|
Loading…
Reference in a new issue