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 680870 - playbin2 doesn't plug necessary parsers
playbin2 doesn't plug necessary parsers
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-07-30 21:14 UTC by Andreas Frisch
Modified: 2012-08-01 14:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GST_DEBUG_NO_COLOR=1 GST_DEBUG=*:3,*play*:5 gst-launch playbin2 uri="file:///media/net/MP3s/70s Disco/Chic - Le Freak.mp3" >/testProgs/go g_680870.log 2>&1 (178.42 KB, text/x-log)
2012-08-01 14:15 UTC, Andreas Frisch
Details

Description Andreas Frisch 2012-07-30 21:14:02 UTC
once again, i am sure we had this problem before but i can't seem to find the right ticket atm
i've got a sink with the following
Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      audio/x-raw-int
              endianess: 1234
                 signed: { true, false }
                   rate: { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }
               channels: [ 1, 2 ]
                  width: 8
                  depth: 8
      audio/x-raw-int
              endianess: 1234
                 signed: { true, false }
                   rate: { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }
               channels: [ 1, 2 ]
                  width: 16
                  depth: 16
      audio/x-raw-int
              endianess: 1234
                 signed: { true, false }
                   rate: { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }
               channels: [ 1, 2 ]
                  width: 24
                  depth: 24
      audio/x-raw-int
              endianess: 1234
                 signed: { true, false }
                   rate: { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }
               channels: [ 1, 2 ]
                  width: 32
                  depth: 24
      audio/x-raw-int
              endianess: 1234
                 signed: { true, false }
                   rate: { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }
               channels: [ 1, 2 ]
                  width: 32
                  depth: 32
      audio/mpeg
                 parsed: true
                 framed: true
      audio/x-ac3
                 framed: true
      audio/x-private1-ac3
                 framed: true
      audio/x-dts
                 framed: true
      audio/x-private1-dts
                 framed: true
      audio/x-private1-lpcm
                 framed: true
      audio/x-wma
                 framed: true

still, a gst-launch playbin2 uri=bla.mp3 will result in a pipeline without an mp3parse element, even though the element is present and recent with a rank of primary + 1 (257)
same thing is true for e.g. dcaparse
a manually built pipeline like gst-launch filesrc location=bla.mp3 ! id3demux ! dvbaudiosink will not fail to link either, even though pad templates are incompatible

i'm working with 0.10 branches of core, base, good, bad & ugly from today
Comment 1 Tim-Philipp Müller 2012-07-30 22:44:46 UTC
>       audio/mpeg
>                  parsed: true
>                  framed: true

This doesn't look right. I think you need to make separate structures for mpegversion={4,2},framed=true and mpegversion=1,parsed=true (you *should* in any case).
Comment 2 Andreas Frisch 2012-07-31 06:39:25 UTC
same result with

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
...
      audio/mpeg
            mpegversion: { 4, 2 }
                 framed: true
      audio/mpeg
            mpegversion: 1
                 parsed: true
...
Comment 3 Andreas Frisch 2012-07-31 08:08:36 UTC
http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?h=0.10&id=1f6056eafb6c37f4c78ed22b2796a1dcaeb51ee6

this looked like it could have been the caause, but i reverted it without success
Comment 4 Andreas Frisch 2012-07-31 09:53:44 UTC
fraxi bisected...

$ git bisect good
0dfdd9186e143daa568521c4e55c9923e5cbc466 is the first bad commit
commit 0dfdd9186e143daa568521c4e55c9923e5cbc466
Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date:   Wed May 23 16:34:37 2012 +0200

    playbin2: Put sinks before the other element factories in the autoplug factory list
    
    This makes sure that we always prefer sinks that support a format without
    decoding, independant of its rank. Previously we only sorted by rank.

:040000 040000 1c75aabaa69fc528ee0ec96a8ed35806a16b059b b59ee164a7927002c2fbb9ffa4c822a6d67fc633 M      gst
Comment 5 Sebastian Dröge (slomo) 2012-07-31 14:19:38 UTC
What are the caps on the demuxer (or whatever element is right before the sink) srcpad?
Comment 6 Sebastian Dröge (slomo) 2012-07-31 14:21:23 UTC
And what does the acceptcaps function/query of the sinkpad of the sink do (if there is one)?
Comment 7 Sebastian Dröge (slomo) 2012-07-31 14:23:09 UTC
Oh I see, this is in 0.10. Negotiation is known to be broken in this specific case (there's nothing that checks if caps contain all the fields that are on the pad template caps). It's fixed in 1.0 (and you can fix it in your sink by actually checking the caps in the acceptcaps function).
Comment 8 Andreas Frisch 2012-07-31 15:54:37 UTC
hi slomo!

in my first example i tried it with playbin2

then with a simple filesrc ! dvbaudiosink i get
ERROR: from element /GstPipeline:pipeline0/GstDVBAudioSink:dvbaudiosink0: The stream is in the wrong format.
Additional debug info:
gstdvbaudiosink.c(1071): gst_dvbaudiosink_render (): /GstPipeline:pipeline0/GstDVBAudioSink:dvbaudiosink0:
hardware decoder not setup (no caps in pipeline?)

if i insert id3demux, it gives me these caps: /GstPipeline:pipeline0/GstDVBAudioSink:dvbaudiosink0.GstPad:sink: caps = audio/mpeg, mpegversion=(int)1, layer=(int)3
it does preroll and goes into PLAYING without errors
even though i've implemented an arbitrary acceptcaps function
root@dm7020hd:/media/hdd/movie# gst-launch filesrc location="/media/net/MP3s/70s Disco/Chic - Le Freak.mp3" ! id3demux ! dvbaudiosink -v
of course this doesn't decode because the stream is unparsed
and the acceptcaps function is not being called

when trying with playbin2 now,
it calls the acceptcaps function twice which checks whether it's parsed or framed and subsequently returns FALSE (because it isn't)
0:00:00.451739741  9833   0x7dc050 WARN            dvbaudiosink gstdvbaudiosink.c:539:gst_dvbaudiosink_acceptcaps:<dvbaudiosink0> input stream is unframed && unparsed! can't handle!
but playbin2 still doesn't plug the parser element and just continues with PLAYING
Comment 9 Andreas Frisch 2012-08-01 14:15:58 UTC
Created attachment 220061 [details]
GST_DEBUG_NO_COLOR=1 GST_DEBUG=*:3,*play*:5 gst-launch playbin2 uri="file:///media/net/MP3s/70s Disco/Chic - Le Freak.mp3" >/testProgs/go g_680870.log 2>&1
Comment 10 Andreas Frisch 2012-08-01 14:26:25 UTC
i wasn't returning FALSE properly in the acceptcaps
works with the modified code, thanks slomo!