can not set flexible to property compliance of vah264dec

Tim-Philipp Müller t.i.m at zen.co.uk
Wed May 10 22:34:28 UTC 2023


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.
> 
> But
> g_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/20230510/d6c82939/attachment.htm>


More information about the gstreamer-devel mailing list