Class AudioAggregator
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
AudioAggregator.AudioAggregatorImpl
GstAudioAggregatorPad
for both
their source and sink pads,
gst_element_class_add_static_pad_template_with_gtype() is a convenient
helper.
GstAudioAggregator
can perform conversion on the data arriving
on its sink pads, based on the format expected downstream: in order
to enable that behaviour, the GType of the sink pads must either be
a (subclass of) GstAudioAggregatorConvertPad
to use the default
GstAudioConverter
implementation, or a subclass of GstAudioAggregatorPad
implementing GstAudioAggregatorPadClass
.convert_buffer.
To allow for the output caps to change, the mechanism is the same as above, with the GType of the source pad.
See GstAudioMixer
for an example.
When conversion is enabled, GstAudioAggregator
will accept
any type of raw audio caps and perform conversion
on the data arriving on its sink pads, with whatever downstream
expects as the target format.
In case downstream caps are not fully fixated, it will use the first configured sink pad to finish fixating its source pad caps.
A notable exception for now is the sample rate, sink pads must have the same sample rate as either the downstream requirement, or the first configured pad, or a combination of both (when downstream specifies a range or a set of acceptable rates).
The GstAggregator
::samples-selected signal is provided with some
additional information about the output buffer:
- "offset" G_TYPE_UINT64 Offset in samples since segment start for the position that is next to be filled in the output buffer.
- "frames" G_TYPE_UINT Number of frames per output buffer.
In addition the gst_aggregator_peek_next_sample() function returns
additional information in the info GstStructure
of the returned sample:
- "output-offset" G_TYPE_UINT64 Sample offset in output segment relative to the output segment's start where the current position of this input buffer would be placed
- "position" G_TYPE_UINT current position in the input buffer in samples
- "size" G_TYPE_UINT size of the input buffer in samples
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
The AudioAggregatorImpl type represents a native instance of the abstract AudioAggregator class.static class
AudioAggregator.Builder<B extends AudioAggregator.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.Nested classes/interfaces inherited from class org.freedesktop.gstreamer.base.Aggregator
Aggregator.AggregatorClass, Aggregator.AggregatorImpl, Aggregator.SamplesSelectedCallback
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
-
Constructor Summary
ConstructorDescriptionAudioAggregator
(MemorySegment address) Create a AudioAggregator proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
aggregateOneBuffer
(AudioAggregatorPad pad, Buffer inbuf, int inOffset, Buffer outbuf, int outOffset, int numFrames) Aggregates one input buffer to the output buffer.protected AudioAggregator
asParent()
Returns this instance as if it were its parent type.static AudioAggregator.Builder
<? extends AudioAggregator.Builder> builder()
AAudioAggregator.Builder
object constructs aAudioAggregator
with the specified properties.protected Buffer
createOutputBuffer
(int numFrames) Create a new output buffer contains num_frames frames.static MemoryLayout
The memory layout of the native struct.static Type
getType()
Get the GType of the AudioAggregator classvoid
setSinkCaps
(AudioAggregatorPad pad, Caps caps) Methods inherited from class org.freedesktop.gstreamer.base.Aggregator
aggregate, clip, createNewPad, decideAllocation, emitSamplesSelected, finishBuffer, finishBufferList, fixateSrcCaps, flush, getAllocator, getBufferPool, getForceLive, getIgnoreInactivePads, getLatency, getNextTime, negotiate, negotiatedSrcCaps, onSamplesSelected, peekNextSample, proposeAllocation, selectedSamples, setForceLive, setIgnoreInactivePads, setLatency, setSrcCaps, simpleGetNextTime, sinkEvent, sinkEventPreQueue, sinkQuery, sinkQueryPreQueue, srcActivate, srcEvent, srcQuery, start, stop, updateSegment, updateSrcCaps
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, query, 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
-
Constructor Details
-
AudioAggregator
Create a AudioAggregator 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.- Overrides:
asParent
in classAggregator
-
setSinkCaps
-
aggregateOneBuffer
protected boolean aggregateOneBuffer(AudioAggregatorPad pad, Buffer inbuf, int inOffset, Buffer outbuf, int outOffset, int numFrames) Aggregates one input buffer to the output buffer. The in_offset and out_offset are in "frames", which is the size of a sample times the number of channels. Returns TRUE if any non-silence was added to the buffer -
createOutputBuffer
Create a new output buffer contains num_frames frames. -
builder
AAudioAggregator.Builder
object constructs aAudioAggregator
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withAudioAggregator.Builder.build()
.
-