can not set flexible to property compliance of vah264dec

cfd new newcfd at yahoo.com
Thu May 11 14:54:07 UTC 2023


Hi, Tim

    int 3 will work and &value works as well. Thanks a lot.
    Joe

    On Wednesday, May 10, 2023, 07:45:37 p.m. EDT, Tim-Philipp Müller via gstreamer-devel <gstreamer-devel at lists.freedesktop.org> wrote:  
 
 On Wed, 2023-05-10 at 18:35 +0000, cfd new via gstreamer-devel wrote:
Hi,

  GParamSpec * property_spec = g_object_class_find_property( G_OBJECT_GET_CLASS( decoder ), "compliance" );
  GType prop_type = G_PARAM_SPEC_VALUE_TYPE( property_spec );
  GValue value = { 0 };
  g_value_init( &value, prop_type );
  gst_value_deserialize( &value, "flexible" );  value has the correct index 3=flexible.
Butg_object_set( decoder, "compliance", value, nullptr );
crashes.



Yes. g_object_set() expects an integer for an enum property, not a GValue structure.
g_object_set_property(G_OBJECT (decoder), "compliance", &value);
might work for a GValue though.
This should also work:
 gst_util_set_object_arg( G_OBJECT( decoder ), "compliance", "flexible" );
Or this:
 g_object_set (decoder, "compliance", 3, NULL);
Cheers Tim  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230511/ebcca82f/attachment.htm>


More information about the gstreamer-devel mailing list