examples: vaenc-dynamic: support target percentage change in QVBR

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6465>
This commit is contained in:
Víctor Manuel Jáquez Leal 2024-03-27 19:45:02 +01:00
parent a9d839b8a3
commit d18d6a70ac

View file

@ -200,8 +200,8 @@ print_keyboard_help (void)
"<", "Decrease bitrate by 100 kbps"}, {
"]", "Increase target usage"}, {
"[", "Decrease target usage"}, {
"}", "Increase target percentage by 10% (only in VBR)"}, {
"{", "Decrease target percentage by 10% (only in VBR)"}, {
"}", "Increase target percentage by 10% (only in [Q]VBR)"}, {
"{", "Decrease target percentage by 10% (only in [Q]VBR)"}, {
"I", "Increase QP-I"}, {
"i", "Decrease QP-I"}, {
"P", "Increase QP-P (only in CQP)"}, {
@ -329,7 +329,8 @@ keyboard_cb (gchar input, gboolean is_ascii, gpointer user_data)
case '}':{
guint target;
if (!is_ratectl (data->encoder, 0x00000004 /* VA_RC_VBR */ ))
if (!is_ratectl (data->encoder, 0x00000004 /* VA_RC_VBR */ )
|| is_ratectl (data->encoder, 0x00000400 /* VA_RC_QVBR */ ))
break;
g_object_get (data->encoder, "target-percentage", &target, NULL);
@ -341,7 +342,8 @@ keyboard_cb (gchar input, gboolean is_ascii, gpointer user_data)
case '{':{
guint target;
if (!is_ratectl (data->encoder, 0x00000004 /* VA_RC_VBR */ ))
if (!is_ratectl (data->encoder, 0x00000004 /* VA_RC_VBR */ )
|| is_ratectl (data->encoder, 0x00000400 /* VA_RC_QVBR */ ))
break;
g_object_get (data->encoder, "target-percentage", &target, NULL);