vaapidecode: reply to CAPS queries.

Handle GST_QUERY_CAPS, which is the GStreamer 1.0 mechanism to retrieve
the set of allowed caps, i.e. it works similar to GstPad::get_caps().

This fixes fallback to SW decoding if no HW decoder is available.
This commit is contained in:
Gwenole Beauchesne 2013-04-02 16:12:16 +02:00
parent 788d337505
commit ead7ec2f43

View file

@ -775,9 +775,23 @@ gst_vaapidecode_query(GST_PAD_QUERY_FUNCTION_ARGS)
if (gst_vaapi_reply_to_query(query, decode->display))
res = TRUE;
else if (GST_PAD_IS_SINK(pad))
res = GST_PAD_QUERY_FUNCTION_CALL(decode->sinkpad_query,
decode->sinkpad, parent, query);
else if (GST_PAD_IS_SINK(pad)) {
switch (GST_QUERY_TYPE(query)) {
#if GST_CHECK_VERSION(1,0,0)
case GST_QUERY_CAPS: {
GstCaps * const caps = gst_vaapidecode_get_caps(pad);
gst_query_set_caps_result(query, caps);
gst_caps_unref(caps);
res = TRUE;
break;
}
#endif
default:
res = GST_PAD_QUERY_FUNCTION_CALL(decode->sinkpad_query,
decode->sinkpad, parent, query);
break;
}
}
else
res = GST_PAD_QUERY_FUNCTION_CALL(decode->srcpad_query,
decode->srcpad, parent, query);