vaapidecode: make decoder work with playbin
authorLionel Landwerlin <llandwerlin@gmail.com>
Fri, 13 Jun 2014 20:45:04 +0000 (21:45 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 3 Jul 2014 21:07:51 +0000 (23:07 +0200)
commit334a0ca8bd20181bcb66ce910c36a54886f99d56
tree97129d705df804840001be94fd023efadbb70f62
parent4d2de696a99201d53371fbe3c0dcb51d33404a9a
vaapidecode: make decoder work with playbin

When playbin/decodebin builds the pipeline, it puts decoders and sinks
into different bins and forwards the queries from bins to bins. So in
the initials steps the pipeline is built iteratively by playbin and
looks like this :

[filesrc]

[filesrc] -> [typefind]

[filesrc] -> [typefind] -> [demuxer]

[filesrc] -> [typefind] -> [demuxer] -> [decoder]

At this point the decoder is asked for its SRC caps and it will make a
choice based on what gst_pad_peer_query_caps() returns. The problem is
that the caps returns at that point includes caps features like ANY,
essentially because playbin can plug in additional elements like
videoscale, videoconv or deinterlace.

This patch adds a another call to
gst_vaapi_find_preferred_caps_feature() when the decoder decides its
allocation, to make sure we asks the downstream elements when the
entire pipeline has been built.

https://bugzilla.gnome.org/show_bug.cgi?id=731645
gst/vaapi/gstvaapidecode.c