examples: vaenc-dynamic: support force key frame setting

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6619>
This commit is contained in:
He Junyan 2024-04-12 16:09:26 +08:00 committed by Víctor Manuel Jáquez Leal
parent 0e3e688bed
commit c6957d7a36

View file

@ -208,6 +208,7 @@ print_keyboard_help (void)
"p", "Decrease QP-P (only in CQP)"}, {
"B", "Increase QP-B (only in CQP)"}, {
"b", "Decrease QP-B (only in CQP)"}, {
"f", "Force to set a key frame"}, {
"k", "show keyboard shortcuts"}
};
/* *INDENT-ON* */
@ -418,6 +419,13 @@ keyboard_cb (gchar input, gboolean is_ascii, gpointer user_data)
g_object_set (data->encoder, "qpb", qpb, NULL);
break;
}
case 'f':{
GstEvent *event = gst_video_event_new_upstream_force_key_unit
(GST_CLOCK_TIME_NONE, TRUE, 0);
gst_println ("Sending force keyunit event");
gst_element_send_event (data->encoder, event);
break;
}
default:
break;
}