Require vpudec jpeg input to be parsed.
vpudec declares support for image/jpeg, but input buffers
must be properly framed for it to work, ie one full jpeg
per buffer. For that reason the following doesn't work:
filesrc location=f.jpg ! vpudec ! fakesink
filesrc will read and push 4096 byte blocks of f.jpg
at the time and vpudec doesn't aggregate them and fails
to decode.
Since vpudec has a high rank (PRIMARY+1) it will be
selected over CPU based jpegdec, so anything using
decodebin is also broken:
filesrc location=f.jpg ! decodebin ! fakesink
Instead of lowering rank for vpudec, which should
be high for all the other formats it supports, require
jpeg data to be parsed. The parser jpegparse has rank
0 and is never autoplugged by decodebin, so jpegdec
will always be used unless vpudec is explicitly wired up:
filesrc location=f.jpg ! jpegparse ! vpudec ! fakesink
or it's contained inside a container that provides the
framing and marks it as "parsed=true":
filesrc location=mjpeg.mp4 ! decodebin ! fakesink
This way we keep VPU based jpeg decoding support for users
that explicitly require it, and make all standard GStreamer
tools work for jpeg out of the box.
Change-Id: Ie1c9e18c6494f8041e5c51547287be73828646e3
1 file changed