Class AudioClock

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class AudioClock extends SystemClock

GstAudioClock makes it easy for elements to implement a GstClock, they simply need to provide a function that returns the current clock time.

This object is internally used to implement the clock in GstAudioBaseSink.

  • Constructor Details

    • AudioClock

      public AudioClock(MemorySegment address)
      Create a AudioClock instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • AudioClock

      public AudioClock(String name, @Nullable AudioClockGetTimeFunc func)
      Create a new GstAudioClock instance. Whenever the clock time should be calculated it will call func with userData. When func returns GST_CLOCK_TIME_NONE, the clock will return the last reported time.
      Parameters:
      name - the name of the clock
      func - a function
    • AudioClock

      public AudioClock()
      Create a new AudioClock.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the AudioClock class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected AudioClock asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class SystemClock
      Returns:
      the instance as if it were its parent type
    • adjust

      public ClockTime adjust(ClockTime time)
      Adjust time with the internal offset of the audio clock.
      Parameters:
      time - a GstClockTime
      Returns:
      time adjusted with the internal offset.
    • getTime

      public ClockTime getTime()
      Report the time as returned by the GstAudioClockGetTimeFunc without applying any offsets.
      Overrides:
      getTime in class Clock
      Returns:
      the time as reported by the time function of the audio clock
    • invalidate

      public void invalidate()

      Invalidate the clock function. Call this function when the provided GstAudioClockGetTimeFunc cannot be called anymore, for example, when the user_data becomes invalid.

      After calling this function, this AudioClock will return the last returned time for the rest of its lifetime.

    • reset

      public void reset(ClockTime time)
      Inform this AudioClock that future calls to GstAudioClockGetTimeFunc will return values starting from time. The clock will update an internal offset to make sure that future calls to internal_time will return an increasing result as required by the GstClock object.
      Parameters:
      time - a GstClockTime
    • builder

      public static AudioClock.Builder<? extends AudioClock.Builder> builder()
      A AudioClock.Builder object constructs a AudioClock with the specified properties. Use the various set...() methods to set properties, and finish construction with AudioClock.Builder.build().
      Returns:
      the builder object