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
Implementations
Retrieve the current value of audio-video-offset property
Returns
The current value of audio-video-offset in nanoseconds
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
the absolute position time, in nanoseconds, of the currently-playing stream.
This is supported on crate feature v1_16
only.
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.
pub fn video_snapshot(
&self,
format: PlayerSnapshotFormat,
config: Option<&Structure>
) -> Option<Sample>
[src]
pub fn video_snapshot(
&self,
format: PlayerSnapshotFormat,
config: Option<&Structure>
) -> Option<Sample>
[src]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.
Seeks the currently-playing stream to the absolute position
time
in nanoseconds.
position
position to seek in nanoseconds
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_
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.
v1_16
only.name
visualization element obtained from
visualizations_get()
Returns
true
if the visualizations was set correctly. Otherwise,
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.
pub fn connect_media_info_updated<F: Fn(&Self, &PlayerMediaInfo) + Send + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_state_changed<F: Fn(&Self, PlayerState) + Send + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_uri_loaded<F: Fn(&Self, &str) + Send + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_video_dimensions_changed<F: Fn(&Self, i32, i32) + Send + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_audio_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_current_audio_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_current_subtitle_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_current_video_track_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_media_info_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_pipeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_position_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_rate_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_subtitle_video_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]v1_16
only.pub fn connect_suburi_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_uri_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_video_multiview_flags_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_video_multiview_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_video_renderer_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn new(
video_renderer: Option<&PlayerVideoRenderer>,
signal_dispatcher: Option<&PlayerSignalDispatcher>
) -> Player
[src]
pub fn new(
video_renderer: Option<&PlayerVideoRenderer>,
signal_dispatcher: Option<&PlayerSignalDispatcher>
) -> Player
[src]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
Returns
true
when the configuration could be set.
pub fn connect_duration_changed<F: Fn(&Player, Option<ClockTime>) + Send + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_position_updated<F: Fn(&Player, Option<ClockTime>) + Send + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]pub fn connect_seek_done<F: Fn(&Player, ClockTime) + Send + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]Trait Implementations
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
Returns the type identifier of Self
.
Auto Trait Implementations
Blanket Implementations
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
pub fn add_control_binding<P>(&self, binding: &P) -> Result<(), BoolError> where
P: IsA<ControlBinding>,
[src]
pub fn add_control_binding<P>(&self, binding: &P) -> Result<(), BoolError> where
P: IsA<ControlBinding>,
[src]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 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
pub fn connect_parent_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Fn(&O) + Send + Sync,
[src]Returns true
if the object is an instance of (can be cast to) T
.
pub fn set_properties(
&self,
property_values: &[(&str, &dyn ToValue)]
) -> Result<(), BoolError>
[src]pub fn set_properties_from_value(
&self,
property_values: &[(&str, Value)]
) -> Result<(), BoolError>
[src]pub fn set_property<'a, N, V>(
&self,
property_name: N,
value: V
) -> Result<(), BoolError> where
V: ToValue,
N: Into<&'a str>,
[src]pub fn set_property_from_value<'a, N>(
&self,
property_name: N,
value: &Value
) -> Result<(), BoolError> where
N: Into<&'a str>,
[src]pub fn property<'a, N>(&self, property_name: N) -> Result<Value, BoolError> where
N: Into<&'a str>,
[src]Safety Read more
Safety Read more
Safety Read more
Safety Read more
pub fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec) + Send + Sync,
[src]pub fn connect_notify_local<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: 'static + Fn(&T, &ParamSpec),
[src]pub unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F
) -> SignalHandlerId where
F: Fn(&T, &ParamSpec),
[src]pub fn has_property<'a, N>(&self, property_name: N, type_: Option<Type>) -> bool where
N: Into<&'a str>,
[src]pub fn find_property<'a, N>(&self, property_name: N) -> Option<ParamSpec> where
N: Into<&'a str>,
[src]pub fn connect<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static,
N: Into<&'a str>,
[src]Same as connect
but takes a SignalId
instead of a signal name.
pub fn connect_local<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value> + 'static,
N: Into<&'a str>,
[src]Same as connect_local
but takes a SignalId
instead of a signal name.
pub unsafe fn connect_unsafe<'a, N, F>(
&self,
signal_name: N,
after: bool,
callback: F
) -> Result<SignalHandlerId, BoolError> where
F: Fn(&[Value]) -> Option<Value>,
N: Into<&'a str>,
[src]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.
pub fn bind_property<'a, O, N, M>(
&'a self,
source_property: N,
target: &'a O,
target_property: M
) -> BindingBuilder<'a> where
O: ObjectType,
N: Into<&'a str>,
M: Into<&'a str>,
[src]Same as emit
but takes Value
for the arguments.
Same as emit_by_name
but takes Value
for the arguments.
Returns a SendValue
clone of self
.
impl<'a, T, C> FromValueOptional<'a> for T where
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>,
[src]