Class AudioCdSrc
- All Implemented Interfaces:
Proxy
,URIHandler
Using GstAudioCdSrc-based elements in applications
GstAudioCdSrc registers two GstFormat
<!-- -->s of its own, namely
the "track" format and the "sector" format. Applications will usually
only find the "track" format interesting. You can retrieve that GstFormat
for use in seek events or queries with gst_format_get_by_nick("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 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).
Tags and meta-information
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.
Tracks and Table of Contents (TOC)
Applications will be informed of the available tracks via a TOC message
on the pipeline's GstBus
. The GstToc
will contain a GstTocEntry
for
each track, with information about each track. The duration for each
track can be retrieved via the GST_TAG_DURATION
tag from each entry's
tag list, or calculated via gst_toc_entry_get_start_stop_times().
The track entries in the TOC will be sorted by track number.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Audio CD source base class.static class
AudioCdSrc.Builder<B extends AudioCdSrc.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.Nested classes/interfaces inherited from class org.freedesktop.gstreamer.base.PushSrc
PushSrc.PushSrcClass
Nested classes/interfaces inherited from class org.freedesktop.gstreamer.base.BaseSrc
BaseSrc.BaseSrcClass, BaseSrc.BaseSrcImpl
Nested classes/interfaces inherited from class org.freedesktop.gstreamer.gst.Element
Element.ElementClass, Element.ElementImpl, Element.NoMorePadsCallback, Element.PadAddedCallback, Element.PadRemovedCallback
Nested classes/interfaces inherited from class org.freedesktop.gstreamer.gst.GstObject
GstObject.DeepNotifyCallback, GstObject.ObjectClass, GstObject.ObjectImpl
Nested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback
Nested classes/interfaces inherited from interface org.freedesktop.gstreamer.gst.URIHandler
URIHandler.URIHandlerImpl, URIHandler.URIHandlerInterface
-
Constructor Summary
ConstructorDescriptionAudioCdSrc
(MemorySegment address) Create a AudioCdSrc proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addTrack
(AudioCdSrcTrack track) CDDA sources use this function from their start vfunc to announce the available data and audio tracks to the base source class.protected AudioCdSrc
asParent()
Returns this instance as if it were its parent type.static AudioCdSrc.Builder
<? extends AudioCdSrc.Builder> builder()
AAudioCdSrc.Builder
object constructs aAudioCdSrc
with the specified properties.protected void
close()
closing the devicestatic MemoryLayout
The memory layout of the native struct.static Type
getType()
Get the GType of the AudioCdSrc classprotected boolean
opening the deviceprotected Buffer
readSector
(int sector) reading a sectorMethods inherited from class org.freedesktop.gstreamer.base.BaseSrc
alloc, create, decideAllocation, doSeek, event, fill, fixate, getAllocator, getBlocksize, getBufferPool, getCaps, getDoTimestamp, getSize, getTimes, isAsync, isLive, isSeekable, negotiate, newSeamlessSegment, newSegment, prepareSeekSegment, pushSegment, query, queryLatency, setAsync, setAutomaticEos, setBlocksize, setCaps, setDoTimestamp, setDynamicSize, setFormat, setLive, start, startComplete, startWait, stop, submitBufferList, unlock, unlockStop, waitPlaying
Methods inherited from class org.freedesktop.gstreamer.gst.Element
abortState, addPad, addPropertyDeepNotifyWatch, addPropertyNotifyWatch, callAsync, changeState, continueState, createAllPads, decorateStreamId, decorateStreamIdPrintf, emitNoMorePads, emitPadAdded, emitPadRemoved, foreachPad, foreachSinkPad, foreachSrcPad, getBaseTime, getBus, getClock, getCompatiblePad, getCompatiblePadTemplate, getContext, getContexts, getContextUnlocked, getCurrentClockTime, getCurrentRunningTime, getFactory, getMetadata, getPadTemplate, getPadTemplateList, getRequestPad, getStartTime, getState, getStaticPad, isLockedState, iteratePads, iterateSinkPads, iterateSrcPads, link, linkFiltered, linkMany, linkPads, linkPadsFiltered, linkPadsFull, linkPadsFull, lostState, makeFromUri, messageFull, messageFull, messageFullWithDetails, messageFullWithDetails, noMorePads, onNoMorePads, onPadAdded, onPadRemoved, padAdded, padRemoved, postMessage, provideClock, queryConvert, queryDuration, queryPosition, register, releasePad, releaseRequestPad, removePad, removePropertyNotifyWatch, requestPad, requestPadSimple, seek, seek, seekSimple, seekSimple, sendEvent, setBaseTime, setBus, setClock, setContext, setLockedState, setStartTime, setState, stateChanged, stateChangeReturnGetName, stateGetName, syncStateWithParent, typeSetSkipDocumentation, unlink, unlinkMany, unlinkPads
Methods inherited from class org.freedesktop.gstreamer.gst.GstObject
addControlBinding, checkUniqueness, deepNotify, defaultDeepNotify, defaultError, emitDeepNotify, getControlBinding, getControlRate, getGValueArray, getName, getParent, getPathString, getValue, getValueArray, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, onDeepNotify, ref, refSink, removeControlBinding, replace, setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setName, setParent, suggestNextSync, syncValues, unparent, unref
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.freedesktop.gstreamer.gst.URIHandler
getProtocols, getUri, getUriType, setUri
-
Constructor Details
-
AudioCdSrc
Create a AudioCdSrc proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
addTrack
CDDA sources use this function from their start vfunc to announce the available data and audio tracks to the base source class. The caller should allocatetrack
on the stack, the base source will do a shallow copy of the structure (and take ownership of the taglist if there is one).- Parameters:
track
- address ofGstAudioCdSrcTrack
to add- Returns:
- FALSE on error, otherwise TRUE.
-
close
protected void close()closing the device -
open
opening the device -
readSector
reading a sector -
builder
AAudioCdSrc.Builder
object constructs aAudioCdSrc
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withAudioCdSrc.Builder.build()
.
-