MediaFileProtocol

public protocol MediaFileProtocol : MediaStreamProtocol

GtkMediaFile implements GtkMediaStream for files.

This provides a simple way to play back video files with GTK.

GTK provides a GIO extension point for GtkMediaFile implementations to allow for external implementations using various media frameworks.

GTK itself includes implementations using GStreamer and ffmpeg.

The MediaFileProtocol protocol exposes the methods and properties of an underlying GtkMediaFile instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see MediaFile. Alternatively, use MediaFileRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkMediaFile instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • media_file_ptr Default implementation

    Typed pointer to the underlying GtkMediaFile instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkMediaFile instance.

    Declaration

    Swift

    var media_file_ptr: UnsafeMutablePointer<GtkMediaFile>! { get }
  • Required Initialiser for types conforming to MediaFileProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

MediaFile Class

  • Bind a MediaFilePropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: MediaFilePropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a MediaFile property

    Declaration

    Swift

    @inlinable
    func get(property: MediaFilePropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a MediaFile property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: MediaFilePropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

MediaFile Class: MediaFileProtocol extension (methods and fields)

  • clear() Extension method

    Resets the media file to be empty.

    Declaration

    Swift

    @inlinable
    func clear()
  • getFile() Extension method

    Returns the file that self is currently playing from.

    When self is not playing or not playing from a file, nil is returned.

    Declaration

    Swift

    @inlinable
    func getFile() -> GIO.FileRef!
  • getInputStream() Extension method

    Returns the stream that self is currently playing from.

    When self is not playing or not playing from a stream, nil is returned.

    Declaration

    Swift

    @inlinable
    func getInputStream() -> GIO.InputStreamRef!
  • set(file:) Extension method

    Sets the GtkMediaFile to play the given file.

    If any file is still playing, stop playing it.

    Declaration

    Swift

    @inlinable
    func set(file: GIO.FileRef? = nil)
  • set(file:) Extension method

    Sets the GtkMediaFile to play the given file.

    If any file is still playing, stop playing it.

    Declaration

    Swift

    @inlinable
    func set<FileT>(file: FileT?) where FileT : FileProtocol
  • set(filename:) Extension method

    Sets the `GtkMediaFile to play the given file.

    This is a utility function that converts the given filename to a GFile and calls [methodGtk.MediaFile.set_file].

    Declaration

    Swift

    @inlinable
    func set(filename: UnsafePointer<CChar>? = nil)
  • setInput(stream:) Extension method

    Sets the GtkMediaFile to play the given stream.

    If anything is still playing, stop playing it.

    Full control about the stream is assumed for the duration of playback. The stream will not be closed.

    Declaration

    Swift

    @inlinable
    func setInput(stream: GIO.InputStreamRef? = nil)
  • setInput(stream:) Extension method

    Sets the GtkMediaFile to play the given stream.

    If anything is still playing, stop playing it.

    Full control about the stream is assumed for the duration of playback. The stream will not be closed.

    Declaration

    Swift

    @inlinable
    func setInput<InputStreamT>(stream: InputStreamT?) where InputStreamT : InputStreamProtocol
  • setResource(resourcePath:) Extension method

    Sets the `GtkMediaFile to play the given resource.

    This is a utility function that converts the given resource_path to a GFile and calls [methodGtk.MediaFile.set_file].

    Declaration

    Swift

    @inlinable
    func setResource(resourcePath: UnsafePointer<CChar>? = nil)
  • file Extension method

    The file being played back or nil if not playing a file.

    Declaration

    Swift

    @inlinable
    var file: GIO.FileRef! { get nonmutating set }
  • inputStream Extension method

    Returns the stream that self is currently playing from.

    When self is not playing or not playing from a stream, nil is returned.

    Declaration

    Swift

    @inlinable
    var inputStream: GIO.InputStreamRef! { get nonmutating set }
  • parentInstance Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var parentInstance: GtkMediaStream { get }