A base class for CD digital audio (CDDA) sources. More...
Inherits Gst::PushSrc.
Public Member Functions | |
virtual | ~CddaBaseSrc () |
GstCddaBaseSrc* | gobj () |
Provides access to the underlying C GObject. | |
const GstCddaBaseSrc* | gobj () const |
Provides access to the underlying C GObject. | |
GstCddaBaseSrc* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
bool | add_track (guint num, guint start, guint end, bool is_audio=true, const Gst::TagList& tags=Gst::TagList()) |
CDDA sources use this function from their start vfunc to announce the available data and audio tracks to the base source class. | |
Glib::PropertyProxy< std::string > | property_device () |
CD device location. | |
Glib::PropertyProxy_ReadOnly < std::string > | property_device () const |
CD device location. | |
Glib::PropertyProxy < CddaBaseSrcMode > | property_mode () |
Mode. | |
Glib::PropertyProxy_ReadOnly < CddaBaseSrcMode > | property_mode () const |
Mode. | |
Glib::PropertyProxy< guint > | property_track () |
Track. | |
Glib::PropertyProxy_ReadOnly < guint > | property_track () const |
Track. | |
virtual bool | open_vfunc (std::string& device) |
Virtual function to open a CD device. | |
virtual void | close_vfunc () |
Virtual function to close the device. | |
virtual Glib::RefPtr< Gst::Buffer > | read_sector_vfunc (gint sector) |
Virtual function to read one sector (LBA). | |
virtual std::string | get_default_device_vfunc () const |
Virtual function to get default device. | |
virtual Glib::ArrayHandle < std::string > | probe_devices_vfunc () |
Virtual function to return array of CD devices. | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gst::CddaBaseSrc > | wrap (GstCddaBaseSrc* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
A base class for CD digital audio (CDDA) sources.
Provides a base class for CDDA sources, which handles things like seeking, querying, discid calculation, tags, and buffer timestamping.
Gst::CddaBaseSrc registers two Gst::Formats of its own, namely the "track" format and the "sector" format. Applications will usually only find the "track" format interesting. You can retrieve that Gst::Format for use in seek events or queries with Gst::get_format("track").
In order to query the number of tracks, for example, an application would set the CDDA source element to READY or PAUSED state and then query the the number of tracks via Gst::Element::query_duration() using the track format acquired above. Applications can query the currently playing track in the same way.
Alternatively, applications may retrieve the currently playing track and the total number of tracks from the taglist that will be posted on the bus whenever the CD is opened or the currently playing track changes. The taglist will contain Gst::TAG_TRACK_NUMBER and Gst::TAG_TRACK_COUNT tags.
Applications playing back CD audio using playbin and cdda://n URIs should issue a seek command in track format to change between tracks, rather than setting a new cdda://n+1 URI on playbin (as setting a new URI on playbin involves closing and re-opening the CD device, which is much much slower).
CDDA sources will automatically emit a number of tags, details about which can be found in the libgsttag documentation. Those tags are: Gst::TAG_CDDA_CDDB_DISCID, Gst::TAG_CDDA_CDDB_DISCID_FULL, Gst::TAG_CDDA_MUSICBRAINZ_DISCID, Gst::TAG_CDDA_MUSICBRAINZ_DISCID_FULL, among others.
virtual Gst::CddaBaseSrc::~CddaBaseSrc | ( | ) | [virtual] |
bool Gst::CddaBaseSrc::add_track | ( | guint | num, | |
guint | start, | |||
guint | end, | |||
bool | is_audio = true , |
|||
const Gst::TagList& | tags = Gst::TagList() | |||
) |
CDDA sources use this function from their start vfunc to announce the available data and audio tracks to the base source class.
num | Track number in TOC (usually starts from 1, but not always). | |
start | The first sector of the track (LBA). | |
end | The last sector of the track (LBA). | |
is_audio | Whether this is an audio track. | |
tags | Track-specific tags (e.g. from cd-text information). |
virtual void Gst::CddaBaseSrc::close_vfunc | ( | ) | [virtual] |
Virtual function to close the device.
virtual std::string Gst::CddaBaseSrc::get_default_device_vfunc | ( | ) | const [virtual] |
Virtual function to get default device.
It is optional and may return an empty string.
GstCddaBaseSrc* Gst::CddaBaseSrc::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gst::PushSrc.
const GstCddaBaseSrc* Gst::CddaBaseSrc::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gst::PushSrc.
GstCddaBaseSrc* Gst::CddaBaseSrc::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Reimplemented from Gst::PushSrc.
virtual bool Gst::CddaBaseSrc::open_vfunc | ( | std::string & | device | ) | [virtual] |
Virtual function to open a CD device.
virtual Glib::ArrayHandle<std::string> Gst::CddaBaseSrc::probe_devices_vfunc | ( | ) | [virtual] |
Virtual function to return array of CD devices.
It is optional and may return an empty array.
Glib::PropertyProxy<std::string> Gst::CddaBaseSrc::property_device | ( | ) |
CD device location.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<std::string> Gst::CddaBaseSrc::property_device | ( | ) | const |
CD device location.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<CddaBaseSrcMode> Gst::CddaBaseSrc::property_mode | ( | ) | const |
Mode.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<CddaBaseSrcMode> Gst::CddaBaseSrc::property_mode | ( | ) |
Mode.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy<guint> Gst::CddaBaseSrc::property_track | ( | ) |
Track.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly<guint> Gst::CddaBaseSrc::property_track | ( | ) | const |
Track.
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
virtual Glib::RefPtr<Gst::Buffer> Gst::CddaBaseSrc::read_sector_vfunc | ( | gint | sector | ) | [virtual] |
Virtual function to read one sector (LBA).
Glib::RefPtr< Gst::CddaBaseSrc > wrap | ( | GstCddaBaseSrc * | object, | |
bool | take_copy = false | |||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. | |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |