[Spice-devel] [spice-gtk v1 3/4] channel-display-gst: improve check for decoder element

Francois Gouget fgouget at codeweavers.com
Wed Oct 19 10:11:53 UTC 2016


On Tue, 18 Oct 2016, Victor Toso wrote:
[...]
> +    elements = g_strsplit(gst_opts[codec_type].dec_name, "!", 0);

This would not work if one of the elements takes options.
(not the case right now but if we can keep the option open)


> +    for (i = 0; elements[i] != NULL; i++) {
> +        GstElementFactory *factory;
>  
> -    return has_codec;
> +        factory = gst_element_factory_find(g_strstrip(elements[i]));
> +        if (factory == NULL) {
> +            SPICE_DEBUG("no element %s", elements[i]);
> +            g_strfreev(elements);
> +            return FALSE;
> +        }

This will likely not be an issue with software decoders but with 
hardware ones that approach will not guarantee that the decoder is 
usable.

In a different context I have found that I can fnid dfbvideosink and 
even instantiate it. But it will refuse to switch to the READY state and 
is thus unusable. That makes sense since I was not using it in a Direct 
FB context.

I expect hardware decoders will be even worse. For instance vaapidecode 
is likely to be present but may not work if you don't have an Intel 
card. Even if you can instantiate it, it may cause a VP8 pipeline caps 
negotiation to fail if your graphics does not support VP8.

Given that this code is not speed critical I don't think there's much 
point in making it more complex and likely less reliable.


-- 
Francois Gouget <fgouget at codeweavers.com>


More information about the Spice-devel mailing list