[gst-devel] cdparanoia Sink properties

Ronald S. Bultje rbultje at ronald.bitfreak.net
Wed Jan 5 01:27:16 CET 2005


Hi Matt,

On Mon, 2005-01-03 at 23:40, Matt Jones wrote:
> I'm working on implementing CD-playing support in rhythmbox, and I have
> it playing CDs (currently finishing up cddb lookups before I submit the
> patch). But, I ran across an issue with gstreamer that would be nice to
> change. The cdparanoia source exports the cddb hash of a cd as a
> property,

Hm, yes, it's still there. I'd recommend to not use it. The CDDB hash is
also exported as metadata (via the 'found-tag' signal, the tag is called
'disc-id'). Given that this is metadata (well, in essence), I'd
recommend using that.

>  but it doesn't export other useful information - such as the
> track count on a cd, and the length of each track. It would be great if
> this was a property that one could access. It seems like you could grab
> this from the GstIndex the cdparanoia source keeps, but I'm not very
> familiar with how one uses this, and all my attempts with it have
> failed, as the cdparanoia source requires one to set it to a playing
> state for this information to be looked up.

You can do that using querying using a custom format:

GstFormat fmt = gst_format_get_by_nick ("track");
gint64 val;
if (gst_element_query (cdparanoia, GST_QUERY_LENGTH, &fmt, &val)) {
  g_print ("This CD has %lld tracks\n", val);
}

There's a patch in bugzilla to make timestamps relative to the current
track (currently, timestamps keep incrementing across tracks). We'll
probably apply this.

> If i submitted a patch that would allow one to request for the number of
> tracks from a cdparanoia source, and possibly the length of each track
> (without the source set to a GST_STATE_PLAYING), would it have any
> chance of being accepted? Also, cdparanoia (the library) has a macro
> IS_AUDIO that reports if a track is an audio track (versus a data track)
> - it might be useful to have access to this as well.

Not as a property. Those things should not be properties, they're
supposed to be used for customizeable things, such as encoder settings
or resampling methods or so.

Ronald

-- 
Ronald S. Bultje <rbultje at ronald.bitfreak.net>





More information about the gstreamer-devel mailing list