From af88e87eec9358a01d427ba8530218c1ab7a45da Mon Sep 17 00:00:00 2001 From: He Junyan Date: Fri, 12 Apr 2024 16:09:26 +0800 Subject: [PATCH] examples: vaenc-dynamic: support force key frame setting Part-of: --- .../tests/examples/va/vaenc-dynamic-reconfigure.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/subprojects/gst-plugins-bad/tests/examples/va/vaenc-dynamic-reconfigure.c b/subprojects/gst-plugins-bad/tests/examples/va/vaenc-dynamic-reconfigure.c index f41a1ae53b..dbcce541bc 100644 --- a/subprojects/gst-plugins-bad/tests/examples/va/vaenc-dynamic-reconfigure.c +++ b/subprojects/gst-plugins-bad/tests/examples/va/vaenc-dynamic-reconfigure.c @@ -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* */ @@ -414,6 +415,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; }