Class AudioAggregator
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
AudioAggregator.AudioAggregator$Impl
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
- Since:
- 1.14
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe AudioAggregator$Impl type represents a native instance of the abstract AudioAggregator class.static classstatic classAudioAggregator.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.Aggregator$Impl, Aggregator.AggregatorClass, Aggregator.SamplesSelectedCallbackNested classes/interfaces inherited from class org.freedesktop.gstreamer.gst.Element
Element.Element$Impl, Element.ElementClass, Element.NoMorePadsCallback, Element.PadAddedCallback, Element.PadRemovedCallbackNested classes/interfaces inherited from class org.freedesktop.gstreamer.gst.GstObject
GstObject.DeepNotifyCallback, GstObject.Object$Impl, GstObject.ObjectClassNested classes/interfaces inherited from class org.gnome.gobject.InitiallyUnowned
InitiallyUnowned.InitiallyUnownedClassNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new AudioAggregator.AudioAggregator(MemorySegment address) Create a AudioAggregator proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaggregateOneBuffer(AudioAggregatorPad pad, Buffer inbuf, int inOffset, Buffer outbuf, int outOffset, int numFrames) Aggregates one input buffer to the output buffer.protected AudioAggregatorasParent()Returns this instance as if it were its parent type.protected BuffercreateOutputBuffer(int numFrames) Create a new output buffer contains num_frames frames.static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the AudioAggregator classvoidsetSinkCaps(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, pushSrcEvent, selectedSamples, setForceLive, setIgnoreInactivePads, setLatency, setSrcCaps, simpleGetNextTime, sinkEvent, sinkEventPreQueue, sinkQuery, sinkQueryPreQueue, srcActivate, srcEvent, srcQuery, start, stop, updateSegment, updateSrcCapsMethods 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, unlinkPadsMethods 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, unrefMethods inherited from class org.gnome.gobject.InitiallyUnowned
builderMethods 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, 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, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.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
-
AudioAggregator
public AudioAggregator()Creates a new AudioAggregator.
-
-
Method Details
-
getType
Get the GType of the AudioAggregator class- Returns:
- the GType
-
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 Javasuperkeyword, 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:
asParentin 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.
-