GNOME Bugzilla – Bug 668996
[0.11] no way for applications to get at GstAudioCdSrc tracks
Last modified: 2012-06-26 18:55:03 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.
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 :)
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.
Then we need API to get the tracks from the element again. The returned tracks must get a boxed type though.
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.
Adding GstToc support would take care of this, I think.
At least the message seems to work: commit b27c649a482569217d0e3fb1d072f370f4e74ce9 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> 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. https://bugzilla.gnome.org/show_bug.cgi?id=668996 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