After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676302 - [jpegdec] Sinkpad template caps too strict
[jpegdec] Sinkpad template caps too strict
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.11.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-05-18 10:03 UTC by Mathias Hasselmann (IRC: tbf)
Modified: 2012-07-08 12:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH 1/3] jpegdec: Report more premissive sinkpad caps (1.06 KB, patch)
2012-05-22 08:28 UTC, Mathias Hasselmann (IRC: tbf)
needs-work Details | Review
[PATCH 2/3] tests: Add some basic tests for jpegdec (10.83 KB, patch)
2012-05-22 08:29 UTC, Mathias Hasselmann (IRC: tbf)
committed Details | Review
[PATCH 3/3] tests: Drop redundant elements_level_LDADD line (944 bytes, patch)
2012-05-22 08:30 UTC, Mathias Hasselmann (IRC: tbf)
committed Details | Review

Description Mathias Hasselmann (IRC: tbf) 2012-05-18 10:03:45 UTC
gst-discoverer fails on JPEG images with:

0:00:00.338286384  2947      0x16c34f0 WARN            uridecodebin gsturidecodebin.c:875:unknown_type_cb:<discoverer-uri> warning: No decoder available for type 'image/jpeg, width=(int)120, height=(int)160, sof-marker=(int)0'.

still the test suite doesn't report regressions regarding jpegdec:

Running suite(s): states
100%: Checks: 3, Failures: 0, Errors: 0
PASS: generic/states
Running suite(s): aacparse
100%: Checks: 8, Failures: 0, Errors: 0
PASS: elements/aacparse
Running suite(s): ac3parse
100%: Checks: 6, Failures: 0, Errors: 0
PASS: elements/ac3parse
Running suite(s): amrwb_parse
100%: Checks: 6, Failures: 0, Errors: 0
Running suite(s): amrnb_parse
100%: Checks: 6, Failures: 0, Errors: 0
PASS: elements/amrparse
Running suite(s): alphacolor
100%: Checks: 2, Failures: 0, Errors: 0
PASS: elements/alphacolor
Running suite(s): aspectratiocrop
100%: Checks: 2, Failures: 0, Errors: 0
PASS: elements/aspectratiocrop
Running suite(s): amplify
100%: Checks: 8, Failures: 0, Errors: 0
PASS: elements/audioamplify
Running suite(s): audiochebband
100%: Checks: 24, Failures: 0, Errors: 0
PASS: elements/audiochebband
Running suite(s): audiocheblimit
100%: Checks: 16, Failures: 0, Errors: 0
PASS: elements/audiocheblimit
Running suite(s): dynamic
100%: Checks: 7, Failures: 0, Errors: 0
PASS: elements/audiodynamic
Running suite(s): audioecho
100%: Checks: 3, Failures: 0, Errors: 0
PASS: elements/audioecho
Running suite(s): audiofirfilter
100%: Checks: 1, Failures: 0, Errors: 0
PASS: elements/audiofirfilter
Running suite(s): audioiirfilter
100%: Checks: 1, Failures: 0, Errors: 0
PASS: elements/audioiirfilter
Running suite(s): invert
100%: Checks: 4, Failures: 0, Errors: 0
PASS: elements/audioinvert
Running suite(s): panorama
100%: Checks: 13, Failures: 0, Errors: 0
PASS: elements/audiopanorama
Running suite(s): audiowsincband
100%: Checks: 14, Failures: 0, Errors: 0
PASS: elements/audiowsincband
Running suite(s): audiowsinclimit
100%: Checks: 10, Failures: 0, Errors: 0
PASS: elements/audiowsinclimit
Running suite(s): autodetect
100%: Checks: 1, Failures: 0, Errors: 0
PASS: elements/autodetect
Running suite(s): avimux
100%: Checks: 2, Failures: 0, Errors: 0
PASS: elements/avimux
Running suite(s): avisubtitle
100%: Checks: 2, Failures: 0, Errors: 0
PASS: elements/avisubtitle
Running suite(s): capssetter
100%: Checks: 6, Failures: 0, Errors: 0
PASS: elements/capssetter
Running suite(s): deinterlace
0%: Checks: 6, Failures: 6, Errors: 0
elements/deinterlace.c:44:F:general:test_create_and_unref:0: Assertion 'deinterlace != NULL' failed
elements/deinterlace.c:105:F:general:test_mode_auto_accept_caps:0: Assertion 'deinterlace != NULL' failed
elements/deinterlace.c:105:F:general:test_mode_forced_accept_caps:0: Assertion 'deinterlace != NULL' failed
elements/deinterlace.c:105:F:general:test_mode_disabled_accept_caps:0: Assertion 'deinterlace != NULL' failed
elements/deinterlace.c:105:F:general:test_mode_disabled_passthrough:0: Assertion 'deinterlace != NULL' failed
elements/deinterlace.c:105:F:general:test_mode_auto_deinterlaced_passthrough:0: Assertion 'deinterlace != NULL' failed
FAIL: elements/deinterlace
Running suite(s): deinterleave
0:00:01.049242575   795      0x10a3e30 ERROR           deinterleave deinterleave.c:412:gst_deinterleave_sink_setcaps:<deinterleave0> can't set new caps: audio/x-raw, format=(string)F32LE, channels=(int)3, layout=(string)interleaved, rate=(int)48000, channel-mask=(bitmask)0x0000000000000007
0:00:01.049798721   795      0x10a3e30 ERROR           deinterleave deinterleave.c:412:gst_deinterleave_sink_setcaps:<deinterleave0> can't set new caps: audio/x-raw, format=(string)F32LE, channels=(int)3, layout=(string)interleaved, rate=(int)48000, channel-mask=(bitmask)0x0000000000000007
0:00:01.049875127   795      0x10a3e30 ERROR           deinterleave deinterleave.c:412:gst_deinterleave_sink_setcaps:<deinterleave0> can't set new caps: audio/x-raw, format=(string)F32LE, channels=(int)3, layout=(string)interleaved, rate=(int)48000, channel-mask=(bitmask)0x0000000000000007
100%: Checks: 5, Failures: 0, Errors: 0
PASS: elements/deinterleave
Running suite(s): equalizer
100%: Checks: 4, Failures: 0, Errors: 0
PASS: elements/equalizer
Running suite(s): flacparse
100%: Checks: 6, Failures: 0, Errors: 0
PASS: elements/flacparse
Running suite(s): flvdemux
100%: Checks: 2, Failures: 0, Errors: 0
PASS: elements/flvdemux
Running suite(s): flvmux
100%: Checks: 498, Failures: 0, Errors: 0
PASS: elements/flvmux
Running suite(s): icydemux
100%: Checks: 3, Failures: 0, Errors: 0
PASS: elements/icydemux
Running suite(s): id3demux

** (id3demux:1402): ERROR **: ERROR for id3-588148-unsynced-v24.tag: GStreamer hat einen allgemeinen Datenstromfehler festgestellt.
gsttagdemux.c(1261): gst_tag_demux_element_loop (): /GstPipeline:pipeline/GstID3Demux:id3demux:
Stream stopped, reason error

0%: Checks: 4, Failures: 3, Errors: 1
elements/id3demux.c:94:F:general:test_tdat_tyer:0: 'state_ret' (0) is not equal to 'GST_STATE_CHANGE_SUCCESS' (1)
elements/id3demux.c:94:F:general:test_wcop:0: 'state_ret' (0) is not equal to 'GST_STATE_CHANGE_SUCCESS' (1)
elements/id3demux.c:94:F:general:test_unsync_v23:0: 'state_ret' (0) is not equal to 'GST_STATE_CHANGE_SUCCESS' (1)
elements/id3demux.c:94:E:general:test_unsync_v24:0: (after this point) Received signal 5 (Trace/Breakpoint ausgelöst)
FAIL: elements/id3demux
Running suite(s): imagefreeze
100%: Checks: 6, Failures: 0, Errors: 0
PASS: elements/imagefreeze
Running suite(s): interleave
100%: Checks: 7, Failures: 0, Errors: 0
PASS: elements/interleave
Running suite(s): level
100%: Checks: 2, Failures: 0, Errors: 0
PASS: elements/level
Running suite(s): matroskamux
100%: Checks: 4, Failures: 0, Errors: 0
PASS: elements/matroskamux
Running suite(s): matroskaparse
100%: Checks: 2, Failures: 0, Errors: 0
PASS: elements/matroskaparse
Running suite(s): mpegaudioparse
100%: Checks: 6, Failures: 0, Errors: 0
PASS: elements/mpegaudioparse
Running suite(s): multifile
100%: Checks: 4, Failures: 0, Errors: 0
PASS: elements/multifile
Running suite(s): qtmux
100%: Checks: 22, Failures: 0, Errors: 0
PASS: elements/qtmux
Running suite(s): rganalysis
100%: Checks: 55, Failures: 0, Errors: 0
PASS: elements/rganalysis
Running suite(s): rglimiter
100%: Checks: 4, Failures: 0, Errors: 0
PASS: elements/rglimiter
Running suite(s): rgvolume
100%: Checks: 8, Failures: 0, Errors: 0
PASS: elements/rgvolume
Running suite(s): rtp_data_test
80%: Checks: 21, Failures: 4, Errors: 0
elements/rtp-payloading.c:345:F:linear:rtp_h264_list_lt_mtu:0: Failure 'chain_list_bytes_received != bytes_sent * LOOP_COUNT' occured
elements/rtp-payloading.c:345:F:linear:rtp_h264_list_gt_mtu:0: Failure 'chain_list_bytes_received != bytes_sent * LOOP_COUNT' occured
elements/rtp-payloading.c:345:F:linear:rtp_mp4v_list:0: Failure 'chain_list_bytes_received != bytes_sent * LOOP_COUNT' occured
elements/rtp-payloading.c:345:F:linear:rtp_jpeg_list:0: Failure 'chain_list_bytes_received != bytes_sent * LOOP_COUNT' occured
FAIL: elements/rtp-payloading
Running suite(s): rtpbin
100%: Checks: 4, Failures: 0, Errors: 0
PASS: elements/rtpbin
Running suite(s): BufferList
100%: Checks: 0, Failures: 0, Errors: 0
PASS: elements/rtpbin_buffer_list
Running suite(s): rtpjitterbuffer
100%: Checks: 4, Failures: 0, Errors: 0
PASS: elements/rtpjitterbuffer
Running suite(s): shapewipe
100%: Checks: 1, Failures: 0, Errors: 0
PASS: elements/shapewipe
Running suite(s): spectrum
100%: Checks: 4, Failures: 0, Errors: 0
PASS: elements/spectrum
Running suite(s): udpsink_test
100%: Checks: 0, Failures: 0, Errors: 0
PASS: elements/udpsink
Running suite(s): udpsrc
100%: Checks: 1, Failures: 0, Errors: 0
PASS: elements/udpsrc
Running suite(s): videocrop
100%: Checks: 29, Failures: 0, Errors: 0
PASS: elements/videocrop
Running suite(s): videofilter
100%: Checks: 3, Failures: 0, Errors: 0
PASS: elements/videofilter
Running suite(s): wavpackparse
100%: Checks: 2, Failures: 0, Errors: 0
PASS: elements/wavpackparse
Running suite(s): y4menc
100%: Checks: 1, Failures: 0, Errors: 0
PASS: elements/y4menc
Running suite(s): Pipelines
100%: Checks: 2, Failures: 0, Errors: 0
PASS: pipelines/simple-launch-lines
Running suite(s): effectv
100%: Checks: 12, Failures: 0, Errors: 0
PASS: pipelines/effectv
Running suite(s): tagschecking
100%: Checks: 3, Failures: 0, Errors: 0
PASS: pipelines/tagschecking
Running suite(s): wavenc
100%: Checks: 1, Failures: 0, Errors: 0
PASS: pipelines/wavenc
Running suite(s): jpegenc
100%: Checks: 2, Failures: 0, Errors: 0
PASS: elements/jpegenc
Running suite(s): souphttpsrc
100%: Checks: 14, Failures: 0, Errors: 0
PASS: elements/souphttpsrc
Running suite(s): id3v2mux
100%: Checks: 1, Failures: 0, Errors: 0
PASS: elements/id3v2mux
Running suite(s): apev2mux
100%: Checks: 1, Failures: 0, Errors: 0
PASS: elements/apev2mux
deinterlace_line_vfir:
    backup function  :   PASSED
    compiled function:   PASSED
deinterlace_line_linear:
    backup function  :   PASSED
    compiled function:   PASSED
deinterlace_line_linear_blend:
    backup function  :   PASSED
    compiled function:   PASSED
deinterlace_line_greedy:
    backup function  :   PASSED
    compiled function:   PASSED
PASS: orc/deinterlace
orc_splat_u32:
    backup function  :   PASSED
    compiled function:   PASSED
orc_memcpy_u32:
    backup function  :   PASSED
    compiled function:   PASSED
orc_blend_u8:
    backup function  :   PASSED
    compiled function:   PASSED
orc_blend_argb:
    backup function  :   PASSED
    compiled function:   PASSED
orc_blend_bgra:
    backup function  :   PASSED
    compiled function:   PASSED
orc_overlay_argb:
    backup function  :   PASSED
    compiled function:   PASSED
orc_overlay_bgra:
    backup function  :   PASSED
    compiled function:   PASSED
PASS: orc/videomixer
orc_splat_u32:
    backup function  :   PASSED
    compiled function:   PASSED
PASS: orc/videobox
==========================================================================
3 of 63 tests failed
Please report to http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer
==========================================================================
Comment 1 Sebastian Dröge (slomo) 2012-05-18 10:16:19 UTC
(In reply to comment #0)
> gst-discoverer fails on JPEG images with:
> 
> 0:00:00.338286384  2947      0x16c34f0 WARN            uridecodebin
> gsturidecodebin.c:875:unknown_type_cb:<discoverer-uri> warning: No decoder
> available for type 'image/jpeg, width=(int)120, height=(int)160,
> sof-marker=(int)0'.

jpegdec additionally requires the framerate field. The template caps on the sinkpad of jpegdec are far too strict and require too many fields.
Comment 2 Mathias Hasselmann (IRC: tbf) 2012-05-22 08:28:58 UTC
Created attachment 214638 [details] [review]
[PATCH 1/3] jpegdec: Report more premissive sinkpad caps
Comment 3 Mathias Hasselmann (IRC: tbf) 2012-05-22 08:29:38 UTC
Created attachment 214639 [details] [review]
[PATCH 2/3] tests: Add some basic tests for jpegdec
Comment 4 Mathias Hasselmann (IRC: tbf) 2012-05-22 08:30:27 UTC
Created attachment 214640 [details] [review]
[PATCH 3/3] tests: Drop redundant elements_level_LDADD line

...somewhat unrelated minor issue I've spotted while updating Makefile.am
Comment 5 Tim-Philipp Müller 2012-05-22 08:36:22 UTC
Comment on attachment 214638 [details] [review]
[PATCH 1/3] jpegdec: Report more premissive sinkpad caps

This does not look right. The sof-marker restrictions are there for a reason.
Comment 6 Sebastian Dröge (slomo) 2012-05-22 09:01:52 UTC
(In reply to comment #5)
> (From update of attachment 214638 [details] [review])
> This does not look right. The sof-marker restrictions are there for a reason.

But would require the typefinder to add it and probably a parser to be plugged by default (in case of demuxers that don't set it)
Comment 7 Tim-Philipp Müller 2012-05-22 09:11:58 UTC
> But would require the typefinder to add it

Lucky us:
$ gst-typefind-1.0 ~/samples/*jpg
/home/tpm/samples/149363-rbcrasher.jpg - image/jpeg, width=(int)1500, height=(int)1500, sof-marker=(int)0
/home/tpm/samples/556648-lossless.jpg - image/jpeg, width=(int)320, height=(int)240, sof-marker=(int)3


> and probably a parser to be plugged by default (in case of demuxers that don't set it)

Yes, indeed, would need to be added to demuxers, or we would need to fix up the parser. Demuxers could trivially run gst_type_find_for_buffer() on the first jpeg buffer they push out though (if they don't want to peek at the bits directly). We could probably also get away with just setting sof-marker=0 for now on demuxer caps, with a big FIXME. The most interesting distinction is between "normal" jpeg and lossless jpeg.
Comment 8 Mathias Hasselmann (IRC: tbf) 2012-05-23 12:58:26 UTC
pipeline for creating a lossless jpeg:

filesrc location=test.png ! pngdec ! autoconvert ! ffenc_ljpeg ! filesink location=test.ljp
Comment 9 Mathias Hasselmann (IRC: tbf) 2012-05-23 17:56:35 UTC
Seems it is sufficient to only drop the framerate capability. Is there any reason for having this one in jpegdec?

diff --git ext/jpeg/gstjpegdec.c ext/jpeg/gstjpegdec.c
index 45d05b7..95715d3 100644
--- ext/jpeg/gstjpegdec.c
+++ ext/jpeg/gstjpegdec.c
@@ -83,7 +83,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
     GST_STATIC_CAPS ("image/jpeg, "
         "width = (int) [ " G_STRINGIFY (MIN_WIDTH) ", " G_STRINGIFY (MAX_WIDTH)
         " ], " "height = (int) [ " G_STRINGIFY (MIN_HEIGHT) ", "
-        G_STRINGIFY (MAX_HEIGHT) " ], framerate = (fraction) [ 0/1, MAX ], "
+        G_STRINGIFY (MAX_HEIGHT) " ], "
         "sof-marker = (int) { 0, 1, 2, 5, 6, 7, 9, 10, 13, 14 }")
     );
Comment 10 Wim Taymans 2012-05-24 14:13:37 UTC
commit e143c43ef5b7b5c164396fa99cb7e0ee4577c3ba
Author: Mathias Hasselmann <mathias.hasselmann at gmx.de>
Date:   Thu May 24 16:09:54 2012 +0200

    jpegdec: remove framerate
    
    The jpeg decoder doesn't need/care about the framerate to so it should
    not be in the caps.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=676302
Comment 11 Murray Cumming 2012-07-02 09:32:39 UTC
Shouldn't the tests from comment #3 and comment #4 go in, to avoid future regressions?
Comment 12 Tim-Philipp Müller 2012-07-08 12:36:01 UTC
Sure, pushed:

commit fc578e76991f5e4df4bb02ecd3dfbcda29f0ba26
Author: Mathias Hasselmann <mathias@openismus.com>
Date:   Mon May 21 13:54:51 2012 +0200

    tests: drop redundant elements_level_LDADD line
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676302

commit f3f71b974994e804bcc3402cb40384829ddee11f
Author: Tim-Philipp Müller <tim@centricular.net>
Date:   Sun Jul 8 13:30:34 2012 +0100

    tests: minor jpegdec clean-ups and fixes
    
    Fix race condition in eos checking and a leak. And
    build pipeline without parse_launch.

commit 0da9456ba23d4847e4d4b29f008a1fe7f8267279
Author: Mathias Hasselmann <mathias@openismus.com>
Date:   Mon May 21 13:53:54 2012 +0200

    tests: Add some basic tests for jpegdec
    
    https://bugzilla.gnome.org/show_bug.cgi?id=676302


Thanks for the reminder and the test!