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 668996 - [0.11] no way for applications to get at GstAudioCdSrc tracks
[0.11] no way for applications to get at GstAudioCdSrc tracks
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
Other Linux
: Normal normal
: 0.11.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 678742
Reported: 2012-01-30 07:53 UTC by Jonathan Matthew
Modified: 2012-06-26 18:55 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Jonathan Matthew 2012-01-30 07:53:25 UTC
In 0.10, Rhythmbox used the GstCddaBaseSrc.tracks array to get track details for audio CDs without seeking to each of them individually.  In 0.11 the track list is inside the private structure for GstAudioCdSrc and I don't see another way to access it.
Comment 1 Sebastian Dröge (slomo) 2012-01-30 09:05:25 UTC
You can do a DURATION (and POSITION) query in the "track" format (and can also seek in that format). Use gst_format_get_by_nick() to get the GstFormat for this.

Maybe this needs documentation updates :)
Comment 2 Jonathan Matthew 2012-01-30 09:47:48 UTC
I can do a DURATION query in track format to get the number of tracks, but to get the length of a specific track, it looks like I'd need to seek to that track and then do a duration query in time format, which would be very slow compared to just looking at the track array.

Bug 551011 has more history on this.
Comment 3 Sebastian Dröge (slomo) 2012-01-30 09:50:09 UTC
Then we need API to get the tracks from the element again. The returned tracks must get a boxed type though.
Comment 4 Tim-Philipp Müller 2012-01-30 11:55:11 UTC
maybe one could just add an actional signal to get a GstTagList for a given track-number? (similar to how playbin has actional signals to get tags for streams)

Or we could put an array of taglists with all tags for all tracks into the taglist for the current track.
Comment 5 Tim-Philipp Müller 2012-06-25 10:27:12 UTC
Adding GstToc support would take care of this, I think.
Comment 6 Tim-Philipp Müller 2012-06-26 18:55:03 UTC
At least the message seems to work:

 commit b27c649a482569217d0e3fb1d072f370f4e74ce9
 Author: Tim-Philipp Müller <>
 Date:   Tue Jun 26 19:50:49 2012 +0100

    audiocdsrc: post TOC message on the bus on start-up
    First attempt at implement the various GstToc API
    bits in GstAudioCdSrc.

tpm@zingle:~/gst/0.11/gst-plugins-base/gst-libs/gst/audio$ gst-launch-1.0 --toc cdparanoiasrc ! pulsesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
FOUND TOC      : found by element "cdparanoiasrc0".
track: start: 0:00:00.000000000 stop: 0:04:25.346666666
    track number: 1
    track count: 18
    duration: 265346666666
track: start: 0:04:25.346666666 stop: 0:05:58.453333333
    track number: 2
    track count: 18
    duration: 93106666666
track: start: 0:05:58.453333333 stop: 0:08:48.840000000
    track number: 3
    track count: 18
    duration: 170386666666
track: start: 0:08:48.840000000 stop: 0:11:26.866666666
    track number: 4
    track count: 18
    duration: 158026666666
track: start: 0:11:26.866666666 stop: 0:14:50.453333333
    track number: 5
    track count: 18
    duration: 203586666666
track: start: 0:14:50.453333333 stop: 0:18:30.066666666
    track number: 6
    track count: 18
    duration: 219613333333
track: start: 0:18:30.066666666 stop: 0:23:25.573333333
    track number: 7
    track count: 18
    duration: 295506666666
track: start: 0:23:25.573333333 stop: 0:28:10.586666666
    track number: 8
    track count: 18
    duration: 285013333333
track: start: 0:28:10.586666666 stop: 0:31:21.520000000
    track number: 9
    track count: 18
    duration: 190933333333
track: start: 0:31:21.520000000 stop: 0:33:40.173333333
    track number: 10
    track count: 18
    duration: 138653333333
track: start: 0:33:40.173333333 stop: 0:36:35.946666666
    track number: 11
    track count: 18
    duration: 175773333333
track: start: 0:36:35.946666666 stop: 0:40:53.786666666
    track number: 12
    track count: 18
    duration: 257840000000
track: start: 0:40:53.786666666 stop: 0:43:34.600000000
    track number: 13
    track count: 18
    duration: 160813333333
track: start: 0:43:34.600000000 stop: 0:48:02.786666666
    track number: 14
    track count: 18
    duration: 268186666666
track: start: 0:48:02.786666666 stop: 0:51:16.426666666
    track number: 15
    track count: 18
    duration: 193640000000
track: start: 0:51:16.426666666 stop: 0:58:20.133333333
    track number: 16
    track count: 18
    duration: 423706666666
track: start: 0:58:20.133333333 stop: 1:01:02.960000000
    track number: 17
    track count: 18
    duration: 162826666666
track: start: 1:01:02.960000000 stop: 1:08:33.760000000
    track number: 18
    track count: 18
    duration: 450800000000
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstPulseSinkClock