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.
-
Untyped pointer to the underlying
GtkMediaFileinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
media_file_ptrDefault implementationTyped pointer to the underlying
GtkMediaFileinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkMediaFileinstance.Declaration
Swift
var media_file_ptr: UnsafeMutablePointer<GtkMediaFile>! { get } -
Required Initialiser for types conforming to
MediaFileProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
MediaFilePropertyNamesource 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 : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a MediaFile property
Declaration
Swift
@inlinable func get(property: MediaFilePropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) 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
propertythe property to get the value for
Return Value
the value of the named property
-
clear()Extension methodResets the media file to be empty.
Declaration
Swift
@inlinable func clear() -
getFile()Extension methodReturns the file that
selfis currently playing from.When
selfis not playing or not playing from a file,nilis returned.Declaration
Swift
@inlinable func getFile() -> GIO.FileRef! -
getInputStream()Extension methodReturns the stream that
selfis currently playing from.When
selfis not playing or not playing from a stream,nilis returned.Declaration
Swift
@inlinable func getInputStream() -> GIO.InputStreamRef! -
set(file:Extension method) Sets the
GtkMediaFileto 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
GtkMediaFileto 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
filenameto aGFileand calls [methodGtk.MediaFile.set_file].Declaration
Swift
@inlinable func set(filename: UnsafePointer<CChar>? = nil) -
setInput(stream:Extension method) Sets the
GtkMediaFileto play the given stream.If anything is still playing, stop playing it.
Full control about the
streamis 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
GtkMediaFileto play the given stream.If anything is still playing, stop playing it.
Full control about the
streamis 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_pathto aGFileand calls [methodGtk.MediaFile.set_file].Declaration
Swift
@inlinable func setResource(resourcePath: UnsafePointer<CChar>? = nil) -
fileExtension methodThe file being played back or
nilif not playing a file.Declaration
Swift
@inlinable var file: GIO.FileRef! { get nonmutating set } -
inputStreamExtension methodReturns the stream that
selfis currently playing from.When
selfis not playing or not playing from a stream,nilis returned.Declaration
Swift
@inlinable var inputStream: GIO.InputStreamRef! { get nonmutating set } -
parentInstanceExtension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GtkMediaStream { get }
View on GitHub
Install in Dash
MediaFileProtocol Protocol Reference