how to add jpegparse manually in decodebin
I have a hardware image/jpeg decoder on my device. When I use the following command line to manually specify jpegparse and v4l2dec plugins, it can decode and display normally.
gst-launch-1.0 filesrc location="003.JPG_320x482_24.jpg" ! jpegparse ! v4l2dec ! waylandsink surface-id=30
But if I use decodebin, decodebin does not automatically connect jpegparse for me. And v4l2dec plugin gives an error.
root@sta1295-evb-mmc:/run/media/sda1/JPG# gst-launch-1.0 filesrc location="003.JPG_320x482_24.jpg" ! decodebin ! waylandsink surface-id=30
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
[ 41.740292] g1 50090000.g1: [ 3:jpeg] JpegDecGetImageInfo error JPEGDEC_STRM_ERROR(-7)
[ 41.752047] g1 50090000.g1: [ 3:jpeg] JpegDecGetImageInfo error JPEGDEC_STRM_ERROR(-7)
[ 41.761828] g1 50090000.g1: [ 3:jpeg] JpegDecGetImageInfo error JPEGDEC_STRM_ERROR(-7)
[ 41.771353] g1 50090000.g1: [ 3:jpeg] JpegDecGetImageInfo error JPEGDEC_STRM_ERROR(-7)
[ 41.781953] g1 50090000.g1: [ 3:jpeg] JpegDecGetImageInfo error JPEGDEC_INCREASE_INPUT_BUFFER(-10)
[ 41.793303] g1 50090000.g1: [ 3:jpeg] JpegDecGetImageInfo error JPEGDEC_INCREASE_INPUT_BUFFER(-10)
[ 41.803182] g1 50090000.g1: [ 3:jpeg] JpegDecGetImageInfo error JPEGDEC_STRM_ERROR(-7)
[ 41.811703] g1 50090000.g1: [ 3:jpeg] JpegDecGetImageInfo error JPEGDEC_STRM_ERROR(-7)
[ 41.821324] g1 50090000.g1: [ 3:jpeg] JpegDecGetImageInfo error JPEGDEC_STRM_ERROR(-7)
[ 41.830637] g1 50090000.g1: [ 3:jpeg] JpegDecGetImageInfo error JPEGDEC_STRM_ERROR(-7)
[ 41.839733] g1 50090000.g1: [ 3:jpeg] invalid stream coded resolution: (0x0) is 0 or > 16370688 pixels budget
[ 41.850084] g1 50090000.g1: [ 3:jpeg] Fatal error (-22)
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind: Internal data stream error.
Additional debug info:
../../../../../../../../../sources/gstreamer/gstreamer1.0/plugins/elements/gsttypefindelement.c(1228): gst_type_find_element_loop (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind:
streaming stopped, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
So what i have to do is manually add the jpegparse plugin to decodebin. I hope someone can give me some tips.