Struct gstreamer_player::Player[][src]

pub struct Player(_);
Expand description

Starting from GStreamer 1.20, application developers are strongly advised to migrate to GstPlay. Player will be deprecated in 1.20 and most likely removed by 1.24.

Implements

gst::prelude::ObjectExt, trait@glib::ObjectExt

Implementations

Retrieve the current value of audio-video-offset property

Returns

The current value of audio-video-offset in nanoseconds

Retrieve the current value of the indicated type_.

type_

PlayerColorBalanceType

Returns

The current value of type_, between [0,1]. In case of error -1 is returned.

A Function to get current audio PlayerAudioInfo instance.

Returns

current audio track.

The caller should free it with g_object_unref()

A Function to get current subtitle PlayerSubtitleInfo instance.

Returns

current subtitle track.

The caller should free it with g_object_unref()

A Function to get current video PlayerVideoInfo instance.

Returns

current video track.

The caller should free it with g_object_unref()

Returns

Name of the currently enabled visualization. g_free() after usage.

Retrieves the duration of the media stream that self represents.

Returns

the duration of the currently-playing media stream, in nanoseconds.

A Function to get the current media info PlayerMediaInfo instance.

Returns

media info instance.

The caller should free it with g_object_unref()

Retrieve the current value of the indicated type_.

Returns

The current value of type_, Default: 0x00000000 “none

Retrieve the current value of the indicated type_.

Returns

The current value of type_, Default: -1 “none”

Returns

true if the currently-playing stream is muted.

Returns

The internal playbin instance.

The caller should free it with g_object_unref()

Returns

the absolute position time, in nanoseconds, of the currently-playing stream.

Returns

current playback rate

current subtitle URI

Returns

URI of the current external subtitle. g_free() after usage.

This is supported on crate feature v1_16 only.

Retrieve the current value of subtitle-video-offset property

Returns

The current value of subtitle-video-offset in nanoseconds

Gets the URI of the currently-playing stream.

Returns

a string containing the URI of the currently-playing stream. g_free() after usage.

Get a snapshot of the currently selected video stream, if any. The format can be selected with format and optional configuration is possible with config Currently supported settings are:

  • width, height of type G_TYPE_INT
  • pixel-aspect-ratio of type GST_TYPE_FRACTION Except for GST_PLAYER_THUMBNAIL_RAW_NATIVE format, if no config is set, pixel-aspect-ratio would be 1/1

format

output format of the video snapshot

config

Additional configuration

Returns

Current video snapshot sample or None on failure

Returns the current volume level, as a percentage between 0 and 1.

Returns

the volume as percentage between 0 and 1.

Checks whether the self has color balance support available.

Returns

true if self has color balance support. Otherwise, false.

Pauses the current stream.

Request to play the loaded stream.

Seeks the currently-playing stream to the absolute position time in nanoseconds.

position

position to seek in nanoseconds

stream_index

stream index

Returns

true or false

Sets the audio track stream_idex.

Enable or disable the current audio track.

enabled

TRUE or FALSE

Sets audio-video-offset property by value of offset

offset

gint64 in nanoseconds

Sets the current value of the indicated channel type_ to the passed value.

type_

PlayerColorBalanceType

value

The new value for the type_, ranged [0,1]

Sets the current value of the indicated mode type_ to the passed value.

flags

The new value for the type_

Sets the current value of the indicated mode type_ to the passed value.

mode

The new value for the type_

true if the currently-playing stream should be muted.

val

Mute state the should be set

Playback at specified rate

rate

playback rate

stream_index

stream index

Returns

true or false

Sets the subtitle stack stream_index.

Enable or disable the current subtitle track.

enabled

TRUE or FALSE

Sets the external subtitle URI. This should be combined with a call to gst_player_set_subtitle_track_enabled(self, TRUE) so the subtitles are actually rendered.

uri

subtitle URI

This is supported on crate feature v1_16 only.

Sets subtitle-video-offset property by value of offset

offset

gint64 in nanoseconds

Sets the next URI to play.

uri

next URI to play.

stream_index

stream index

Returns

true or false

Sets the video track stream_index.

Enable or disable the current video track.

enabled

TRUE or FALSE

name

visualization element obtained from visualizations_get()

Returns

true if the visualizations was set correctly. Otherwise, false.

Enable or disable the visualization.

enabled

TRUE or FALSE

Sets the volume level of the stream as a percentage between 0 and 1.

This volume is a linear factor. For showing the volume in a GUI it might make sense to first convert from a different format. Volume sliders should usually use a cubic volume. See gst_stream_volume_convert_volume().

val

the new volume level, as a percentage between 0 and 1

Stops playing the current stream and resets to the first position in the stream.

Returns

a None terminated array containing all available visualizations. Use gst_player_visualizations_free() after usage.

This is supported on crate feature v1_16 only.

Creates a new Player instance that uses signal_dispatcher to dispatch signals to some event loop system, or emits signals directly if NULL is passed. See gst_player_g_main_context_signal_dispatcher_new().

Video is going to be rendered by video_renderer, or if None is provided no special video set up will be done and some default handling will be performed.

video_renderer

GstPlayerVideoRenderer to use

signal_dispatcher

GstPlayerSignalDispatcher to use

Returns

a new Player instance

Get a copy of the current configuration of the player. This configuration can either be modified and used for the set_config() call or it must be freed after usage.

Returns

a copy of the current configuration of self. Use gst_structure_free() after usage or set_config().

Set the configuration of the player. If the player is already configured, and the configuration haven’t change, this function will return true. If the player is not in the GST_PLAYER_STATE_STOPPED, this method will return false and active configuration will remain.

config is a gst::Structure that contains the configuration parameters for the player.

This function takes ownership of config.

config

a gst::Structure

Returns

true when the configuration could be set.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Upcasts an object to a superclass or interface T. Read more

Upcasts an object to a reference of its superclass or interface T. Read more

Tries to downcast to a subclass or interface implementor T. Read more

Tries to downcast to a reference of its subclass or interface implementor T. Read more

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more

Casts to T unconditionally. Read more

Casts to &T unconditionally. Read more

Performs the conversion.

Attach the ControlBinding to the object. If there already was a ControlBinding for this property it will be replaced. Read more

A default error function that uses g_printerr() to display the error message and the optional debug string.. Read more

Gets the corresponding ControlBinding for the property. This should be unreferenced again after use. Read more

Obtain the control-rate for this self. Audio processing Element objects will use this rate to sub-divide their processing loop and call sync_values() in between. The length of the processing segment should be up to control-rate nanoseconds. Read more

Returns a copy of the name of self. Caller should g_free() the return value after usage. For a nameless object, this returns None, which you can safely g_free() as well. Read more

Returns the parent of self. This function increases the refcount of the parent object so you should gst_object_unref() it after usage. Read more

Generates a string describing the path of self in the object hierarchy. Only useful (or used) for debugging. Read more

Gets the value for the given controlled property at the requested time. Read more

Performs the conversion.

Returns true if the object is an instance of (can be cast to) T.

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Same as connect but takes a SignalId instead of a signal name.

Same as connect_local but takes a SignalId instead of a signal name.

Same as connect_unsafe but takes a SignalId instead of a signal name.

Emit signal by signal id.

Emit signal with details by signal id.

Emit signal by it’s name.

Same as emit but takes Value for the arguments.

Same as emit_by_name but takes Value for the arguments.

Same as emit_with_details but takes Value for the arguments.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Returns a SendValue clone of self.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.