Class Discoverer.Builder<B extends Discoverer.Builder<B>>

java.lang.Object
org.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.freedesktop.gstreamer.pbutils.Discoverer.Builder<B>
Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
Discoverer

public static class Discoverer.Builder<B extends Discoverer.Builder<B>> extends GObject.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 Discoverer build()
      Finish building the Discoverer object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Discoverer.
      Overrides:
      build in class GObject.Builder<B extends Discoverer.Builder<B>>
      Returns:
      a new instance of Discoverer with the properties that were set in the Builder object.
    • setTimeout

      public B setTimeout(long timeout)

      The duration (in nanoseconds) after which the discovery of an individual URI will timeout.

      If the discovery of a URI times out, the DiscovererResult.TIMEOUT will be set on the result flags.

      Parameters:
      timeout - the value for the timeout property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setUseCache

      public B setUseCache(boolean useCache)
    • onDiscovered

      public B onDiscovered(Discoverer.DiscoveredCallback handler)

      Will be emitted in async mode when all information on a URI could be discovered, or an error occurred.

      When an error occurs, info might still contain some partial information, depending on the circumstances of the error.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onFinished

      public B onFinished(Discoverer.FinishedCallback handler)
      Will be emitted in async mode when all pending URIs have been processed.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onLoadSerializedInfo

      public B onLoadSerializedInfo(Discoverer.LoadSerializedInfoCallback handler)
      Retrieves information about a URI from and external source of information, like a cache file. This is used by the discoverer to speed up the discovery.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      1.24
      See Also:
    • onSourceSetup

      public B onSourceSetup(Discoverer.SourceSetupCallback handler)

      This signal is emitted after the source element has been created for, so the URI being discovered, so it can be configured by setting additional properties (e.g. set a proxy server for an http source, or set the device and read speed for an audio cd source).

      This signal is usually emitted from the context of a GStreamer streaming thread.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onStarting

      public B onStarting(Discoverer.StartingCallback handler)
      Will be emitted when the discover starts analyzing the pending URIs
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: