Interface AudioBaseSinkCustomSlavingCallback
- All Superinterfaces:
FunctionPointer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
AudioBaseSinkCustomSlavingCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
run
(AudioBaseSink sink, ClockTime etime, ClockTime itime, ClockTimeDiff requestedSkew, AudioBaseSinkDiscontReason discontReason) This function is set with gst_audio_base_sink_set_custom_slaving_callback() and is called during playback.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, long, long, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment)
method.default void
upcall
(MemorySegment sink, long etime, long itime, MemorySegment requestedSkew, int discontReason, MemorySegment userData) Theupcall
method is called from native code.
-
Method Details
-
run
void run(AudioBaseSink sink, ClockTime etime, ClockTime itime, ClockTimeDiff requestedSkew, AudioBaseSinkDiscontReason discontReason) This function is set with gst_audio_base_sink_set_custom_slaving_callback() and is called during playback. It receives the current time of external and internal clocks, which the callback can then use to apply any custom slaving/synchronization schemes.The external clock is the sink's element clock, the internal one is the internal audio clock. The internal audio clock's calibration is applied to the timestamps before they are passed to the callback. The difference between etime and itime is the skew; how much internal and external clock lie apart from each other. A skew of 0 means both clocks are perfectly in sync. itime > etime means the external clock is going slower, while itime < etime means it is going faster than the internal clock. etime and itime are always valid timestamps, except for when a discontinuity happens.
requested_skew is an output value the callback can write to. It informs the sink of whether or not it should move the playout pointer, and if so, by how much. This pointer is only NULL if a discontinuity occurs; otherwise, it is safe to write to *requested_skew. The default skew is 0.
The sink may experience discontinuities. If one happens, discont is TRUE, itime, etime are set to GST_CLOCK_TIME_NONE, and requested_skew is NULL. This makes it possible to reset custom clock slaving algorithms when a discontinuity happens.
-
upcall
default void upcall(MemorySegment sink, long etime, long itime, MemorySegment requestedSkew, int discontReason, MemorySegment userData) Theupcall
method is called from native code. The parameters are marshaled andrun(org.freedesktop.gstreamer.audio.AudioBaseSink, org.freedesktop.gstreamer.gst.ClockTime, org.freedesktop.gstreamer.gst.ClockTime, org.freedesktop.gstreamer.gst.ClockTimeDiff, org.freedesktop.gstreamer.audio.AudioBaseSinkDiscontReason)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, long, long, java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-