Using GST_TAG_TRACK_NUMBER for selecting tracks / subsongs?

Tim Müller tim at centricular.com
Mon May 16 09:05:39 UTC 2016


On Mon, 2016-05-16 at 10:45 +0200, Carlos Rafael Giani wrote:

Hi,

> I was thinking of ways to allow application to select subsongs with
> my 
> nonstream-audio plugins ( https://github.com/dv1/gst-nonstream-audio
> ). 
> Then I stumbled upon GST_TAG_TRACK_NUMBER. Does it make sense to
> inject 
> this into the pipeline and use that to select a "track" (= subsong)?
> Or 
> is there a better way? I know of the TOC setter, but do not see how
> this 
> would help with selecting the current subsong.

GstTocSetter is for writing ToCs when writing files, I don't think it's
what you need.

I think you have two options:

1) you can register a new GstFormat called "track" and do a seek in
track format then. This is similar to what we used to do before we had
TOC support in GStreamer (for audio cds, dvd sources had title and
chapter formats)

2) make your element advertise tracks/subsongs via GstToc. The
application can then select the desired track/subsong by sending a
TOC_SELECT event to the pipeline/your plugin:

  gst_event_new_toc_select()

I'd go for 2).

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com




More information about the gstreamer-devel mailing list