Class BaseSink.Builder<B extends BaseSink.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Direct Known Subclasses:
AppSink.Builder, AudioBaseSink.Builder, VideoSink.Builder
Enclosing class:
BaseSink

public static class BaseSink.Builder<B extends BaseSink.Builder<B>> extends Element.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public BaseSink build()
      Finish building the BaseSink object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to BaseSink.
      Overrides:
      build in class Element.Builder<B extends BaseSink.Builder<B>>
      Returns:
      a new instance of BaseSink with the properties that were set in the Builder object.
    • setAsync

      public B setAsync(boolean async)
      If set to true, the basesink will perform asynchronous state changes. When set to false, the sink will not signal the parent when it prerolls. Use this option when dealing with sparse streams or when synchronisation is not required.
      Parameters:
      async - the value for the async property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setBlocksize

      public B setBlocksize(int blocksize)
      The amount of bytes to pull when operating in pull mode.
      Parameters:
      blocksize - the value for the blocksize property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setEnableLastSample

      public B setEnableLastSample(boolean enableLastSample)
      Enable the last-sample property. If false, basesink doesn't keep a reference to the last buffer arrived and the last-sample property is always set to null. This can be useful if you need buffers to be released as soon as possible, eg. if you're using a buffer pool.
      Parameters:
      enableLastSample - the value for the enable-last-sample property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setMaxBitrate

      public B setMaxBitrate(long maxBitrate)
      Control the maximum amount of bits that will be rendered per second. Setting this property to a value bigger than 0 will make the sink delay rendering of the buffers when it would exceed to max-bitrate.
      Parameters:
      maxBitrate - the value for the max-bitrate property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.2
    • setMaxLateness

      public B setMaxLateness(long maxLateness)
    • setProcessingDeadline

      public B setProcessingDeadline(long processingDeadline)
      Maximum amount of time (in nanoseconds) that the pipeline can take for processing the buffer. This is added to the latency of live pipelines.
      Parameters:
      processingDeadline - the value for the processing-deadline property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.16
    • setQos

      public B setQos(boolean qos)
    • setRenderDelay

      public B setRenderDelay(long renderDelay)
      The additional delay between synchronisation and actual rendering of the media. This property will add additional latency to the device in order to make other sinks compensate for the delay.
      Parameters:
      renderDelay - the value for the render-delay property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSync

      public B setSync(boolean sync)
    • setThrottleTime

      public B setThrottleTime(long throttleTime)
      The time to insert between buffers. This property can be used to control the maximum amount of buffers per second to render. Setting this property to a value bigger than 0 will make the sink create THROTTLE QoS events.
      Parameters:
      throttleTime - the value for the throttle-time property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTsOffset

      public B setTsOffset(long tsOffset)
      Controls the final synchronisation, a negative value will render the buffer earlier while a positive value delays playback. This property can be used to fix synchronisation in bad files.
      Parameters:
      tsOffset - the value for the ts-offset property
      Returns:
      the Builder instance is returned, to allow method chaining