vaapiencode: allow to set property on runtime
authorHyunjun Ko <zzoon@igalia.com>
Fri, 20 Oct 2017 10:37:15 +0000 (12:37 +0200)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Fri, 20 Oct 2017 11:22:51 +0000 (13:22 +0200)
Tis patch, allows some properties that we want to be set on
runtime. (eg. bitrate)

Note that all properties are under control by num_codedbuf_queued.

https://bugzilla.gnome.org/show_bug.cgi?id=786321

gst/vaapi/gstvaapiencode.c

index 0aaa4d1..5bc67c5 100644 (file)
@@ -175,11 +175,18 @@ gst_vaapiencode_default_set_property (GstVaapiEncode * encode, guint prop_id,
     const GValue * value)
 {
   PropValue *const prop_value = prop_value_lookup (encode, prop_id);
+  GstVaapiEncoder *encoder = encode->encoder;
 
   if (prop_value) {
     g_value_copy (value, &prop_value->value);
+
+    if (encoder)
+      return (gst_vaapi_encoder_set_property (encoder, prop_id,
+              value) == GST_VAAPI_ENCODER_STATUS_SUCCESS);
+
     return TRUE;
   }
+
   return FALSE;
 }