Class SystemClock

All Implemented Interfaces:
Proxy
Direct Known Subclasses:
AudioClock

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

The GStreamer core provides a GstSystemClock based on the system time. Asynchronous callbacks are scheduled from an internal thread.

Clock implementors are encouraged to subclass this systemclock as it implements the async notification.

Subclasses can however override all of the important methods for sync and async notifications to implement their own callback methods or blocking wait operations.

  • Constructor Details

    • SystemClock

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

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

    • getType

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

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

      protected SystemClock 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 Clock
      Returns:
      the instance as if it were its parent type
    • obtain

      public static Clock obtain()
      Get a handle to the default system clock. The refcount of the clock will be increased so you need to unref the clock after usage.
      Returns:

      the default clock.

      MT safe.

    • setDefault

      public static void setDefault(@Nullable Clock newClock)

      Sets the default system clock that can be obtained with gst_system_clock_obtain().

      This is mostly used for testing and debugging purposes when you want to have control over the time reported by the default system clock.

      MT safe.

      Parameters:
      newClock - a GstClock
      Since:
      1.4
    • builder

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