Trait gstreamer_editing_services::prelude::ClipExt [−][src]
pub trait ClipExt: 'static {
Show methods
fn add_asset<P: IsA<Asset>>(
&self,
asset: &P
) -> Result<TrackElement, BoolError>;
fn add_child_to_track<P: IsA<TrackElement>, Q: IsA<Track>>(
&self,
child: &P,
track: &Q
) -> Result<TrackElement, Error>;
fn add_top_effect<P: IsA<BaseEffect>>(
&self,
effect: &P,
index: i32
) -> Result<(), Error>;
fn find_track_element<P: IsA<Track>>(
&self,
track: Option<&P>,
type_: Type
) -> Option<TrackElement>;
fn find_track_elements<P: IsA<Track>>(
&self,
track: Option<&P>,
track_type: TrackType,
type_: Type
) -> Vec<TrackElement>;
fn duration_limit(&self) -> ClockTime;
fn internal_time_from_timeline_time<P: IsA<TrackElement>>(
&self,
child: &P,
timeline_time: impl Into<Option<ClockTime>>
) -> Result<Option<ClockTime>, Error>;
fn layer(&self) -> Option<Layer>;
fn supported_formats(&self) -> TrackType;
fn timeline_time_from_internal_time<P: IsA<TrackElement>>(
&self,
child: &P,
internal_time: impl Into<Option<ClockTime>>
) -> Result<Option<ClockTime>, Error>;
fn timeline_time_from_source_frame(
&self,
frame_number: FrameNumber
) -> Result<Option<ClockTime>, Error>;
fn top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P) -> i32;
fn top_effect_position<P: IsA<BaseEffect>>(&self, effect: &P) -> i32;
fn top_effects(&self) -> Vec<TrackElement>;
fn move_to_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), BoolError>;
fn move_to_layer_full<P: IsA<Layer>>(&self, layer: &P) -> Result<(), Error>;
fn remove_top_effect<P: IsA<BaseEffect>>(
&self,
effect: &P
) -> Result<(), Error>;
fn set_supported_formats(&self, supportedformats: TrackType);
fn set_top_effect_index<P: IsA<BaseEffect>>(
&self,
effect: &P,
newindex: u32
) -> Result<(), BoolError>;
fn set_top_effect_index_full<P: IsA<BaseEffect>>(
&self,
effect: &P,
newindex: u32
) -> Result<(), Error>;
fn set_top_effect_priority<P: IsA<BaseEffect>>(
&self,
effect: &P,
newpriority: u32
) -> Result<(), BoolError>;
fn split(&self, position: u64) -> Result<Clip, BoolError>;
fn split_full(&self, position: u64) -> Result<Option<Clip>, Error>;
fn connect_duration_limit_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_layer_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
fn connect_supported_formats_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId;
}Expand description
Required methods
Extracts a TrackElement from an asset and adds it to the clip.
This can be used to add effects that derive from the asset to the
clip, but this method is not intended to be used to create the core
elements of the clip.
asset
An asset with GES_TYPE_TRACK_ELEMENT as its
property::Asset::extractable-type
Returns
The newly created element, or
None if an error occurred.
fn add_child_to_track<P: IsA<TrackElement>, Q: IsA<Track>>(
&self,
child: &P,
track: &Q
) -> Result<TrackElement, Error>[src]
fn add_child_to_track<P: IsA<TrackElement>, Q: IsA<Track>>(
&self,
child: &P,
track: &Q
) -> Result<TrackElement, Error>[src]v1_18 only.Adds the track element child of the clip to a specific track.
If the given child is already in another track, this will create a copy of the child, add it to the clip, and add this copy to the track.
You should only call this whilst a clip is part of a Timeline, and
for tracks that are in the same timeline.
This method is an alternative to using the
signal::Timeline::select-tracks-for-object signal, but can be used to
complement it when, say, you wish to copy a clip’s children from one
track into a new one.
When the child is a core child, it must be added to a track that does not already contain another core child of the same clip. If it is not a core child (an additional effect), then it must be added to a track that already contains one of the core children of the same clip.
This method can also fail if the adding the track element to the track
would break a configuration rule of the corresponding Timeline,
such as causing three sources to overlap at a single time, or causing
a source to completely overlap another in the same track.
child
A child of self
track
The track to add child to
Returns
The element that was added to track, either
child or a copy of child, or None if the element could not be added.
fn add_top_effect<P: IsA<BaseEffect>>(
&self,
effect: &P,
index: i32
) -> Result<(), Error>[src]
fn add_top_effect<P: IsA<BaseEffect>>(
&self,
effect: &P,
index: i32
) -> Result<(), Error>[src]v1_18 only.Add a top effect to a clip at the given index.
Unlike using GESContainerExt::add(), this allows you to set the index
in advance. It will also check that no error occurred during the track
selection for the effect.
Note, only subclasses of GESClipClass that have
GES_CLIP_CLASS_CAN_ADD_EFFECTS set to true (such as GESSourceClip
and GESBaseEffectClip) can have additional top effects added.
Note, if the effect is a time effect, this may be refused if the clip would not be able to adapt itself once the effect is added.
effect
A top effect to add
index
The index to add effect at, or -1 to add at the highest
Returns
true if effect was successfully added to self at index.
fn find_track_element<P: IsA<Track>>(
&self,
track: Option<&P>,
type_: Type
) -> Option<TrackElement>[src]
fn find_track_element<P: IsA<Track>>(
&self,
track: Option<&P>,
type_: Type
) -> Option<TrackElement>[src]Finds an element controlled by the clip. If track is given,
then only the track elements in track are searched for. If type_ is
given, then this function searches for a track element of the given
type_.
Note, if multiple track elements in the clip match the given criteria,
this will return the element amongst them with the highest
property::TimelineElement::priority (numerically, the smallest). See
find_track_elements() if you wish to find all such elements.
track
The track to search in, or None to search in
all tracks
type_
The type of track element to search for, or G_TYPE_NONE to
match any type
Returns
The element controlled by
self, in track, and of the given type_, or None if no such element
could be found.
fn find_track_elements<P: IsA<Track>>(
&self,
track: Option<&P>,
track_type: TrackType,
type_: Type
) -> Vec<TrackElement>[src]
fn find_track_elements<P: IsA<Track>>(
&self,
track: Option<&P>,
track_type: TrackType,
type_: Type
) -> Vec<TrackElement>[src]Finds the TrackElement-s controlled by the clip that match the
given criteria. If track is given as None and track_type is given as
TrackType::UNKNOWN, then the search will match all elements in any
track, including those with no track, and of any
property::TrackElement::track-type. Otherwise, if track is not None, but
track_type is TrackType::UNKNOWN, then only the track elements in
track are searched for. Otherwise, if track_type is not
TrackType::UNKNOWN, but track is None, then only the track
elements whose property::TrackElement::track-type matches track_type are
searched for. Otherwise, when both are given, the track elements that
match either criteria are searched for. Therefore, if you wish to
only find elements in a specific track, you should give the track as
track, but you should not give the track’s property::Track::track-type as
track_type because this would also select elements from other tracks
of the same type.
You may also give type_ to further restrict the search to track
elements of the given type_.
track
The track to search in, or None to search in
all tracks
track_type
The track-type of the track element to search for, or
TrackType::UNKNOWN to match any track type
type_
The type of track element to search for, or G_TYPE_NONE to
match any type
Returns
A list of all
the TrackElement-s controlled by self, in track or of the given
track_type, and of the given type_.
fn duration_limit(&self) -> ClockTime[src]
fn duration_limit(&self) -> ClockTime[src]v1_18 only.v1_18 only.Convert the timeline time to an internal source time of the child.
This will take any time effects placed on the clip into account (see
BaseEffect for what time effects are supported, and how to
declare them in GES).
When timeline_time is above the property::TimelineElement::start of self,
this will return the internal time at which the content that appears at
timeline_time in the output of the timeline is created in child. For
example, if timeline_time corresponds to the current seek position,
this would let you know which part of a media file is being read.
This will be done assuming the clip has an indefinite end, so the
internal time may be beyond the current out-point of the child, or even
its property::TimelineElement::max-duration.
If, instead, timeline_time is below the current
property::TimelineElement::start of self, this will return what you would
need to set the property::TimelineElement::in-point of child to if you set
the property::TimelineElement::start of self to timeline_time and wanted
to keep the content of child currently found at the current
property::TimelineElement::start of self at the same timeline position. If
this would be negative, the conversion fails. This is useful for
determining what property::TimelineElement::in-point would result from a
EditMode::Trim to timeline_time.
Note that whilst a clip has no time effects, this second return is
equivalent to finding the internal time at which the content that
appears at timeline_time in the timeline can be found in child if it
had indefinite extent in both directions. However, with non-linear time
effects this second return will be more distinct.
In either case, the returned time would be appropriate to use for the
property::TimelineElement::in-point or property::TimelineElement::max-duration of the
child.
See timeline_time_from_internal_time(), which performs the
reverse.
child
An property::TrackElement::active child of self with a
property::TrackElement::track
timeline_time
A time in the timeline time coordinates
Returns
The time in the internal coordinates of child corresponding
to timeline_time, or GST_CLOCK_TIME_NONE if the conversion could not
be performed.
fn supported_formats(&self) -> TrackType[src]v1_18 only.fn timeline_time_from_source_frame(
&self,
frame_number: FrameNumber
) -> Result<Option<ClockTime>, Error>[src]
fn timeline_time_from_source_frame(
&self,
frame_number: FrameNumber
) -> Result<Option<ClockTime>, Error>[src]v1_18 only.fn top_effect_index<P: IsA<BaseEffect>>(&self, effect: &P) -> i32[src]fn top_effect_position<P: IsA<BaseEffect>>(&self, effect: &P) -> i32[src]fn top_effects(&self) -> Vec<TrackElement>[src]v1_18 only.fn remove_top_effect<P: IsA<BaseEffect>>(&self, effect: &P) -> Result<(), Error>[src]
fn remove_top_effect<P: IsA<BaseEffect>>(&self, effect: &P) -> Result<(), Error>[src]v1_18 only.fn set_supported_formats(&self, supportedformats: TrackType)[src]fn set_top_effect_index<P: IsA<BaseEffect>>(
&self,
effect: &P,
newindex: u32
) -> Result<(), BoolError>[src]fn set_top_effect_index_full<P: IsA<BaseEffect>>(
&self,
effect: &P,
newindex: u32
) -> Result<(), Error>[src]
fn set_top_effect_index_full<P: IsA<BaseEffect>>(
&self,
effect: &P,
newindex: u32
) -> Result<(), Error>[src]v1_18 only.fn set_top_effect_priority<P: IsA<BaseEffect>>(
&self,
effect: &P,
newpriority: u32
) -> Result<(), BoolError>[src]v1_18 only.fn connect_duration_limit_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
fn connect_duration_limit_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]v1_18 only.fn connect_layer_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId[src]fn connect_supported_formats_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]Implementors
fn add_child_to_track<P: IsA<TrackElement>, Q: IsA<Track>>(
&self,
child: &P,
track: &Q
) -> Result<TrackElement, Error>[src]
fn add_child_to_track<P: IsA<TrackElement>, Q: IsA<Track>>(
&self,
child: &P,
track: &Q
) -> Result<TrackElement, Error>[src]v1_18 only.v1_18 only.fn find_track_element<P: IsA<Track>>(
&self,
track: Option<&P>,
type_: Type
) -> Option<TrackElement>[src]fn find_track_elements<P: IsA<Track>>(
&self,
track: Option<&P>,
track_type: TrackType,
type_: Type
) -> Vec<TrackElement>[src]v1_18 only.v1_18 only.v1_18 only.fn timeline_time_from_source_frame(
&self,
frame_number: FrameNumber
) -> Result<Option<ClockTime>, Error>[src]
fn timeline_time_from_source_frame(
&self,
frame_number: FrameNumber
) -> Result<Option<ClockTime>, Error>[src]v1_18 only.v1_18 only.v1_18 only.fn set_top_effect_index<P: IsA<BaseEffect>>(
&self,
effect: &P,
newindex: u32
) -> Result<(), BoolError>[src]fn set_top_effect_index_full<P: IsA<BaseEffect>>(
&self,
effect: &P,
newindex: u32
) -> Result<(), Error>[src]
fn set_top_effect_index_full<P: IsA<BaseEffect>>(
&self,
effect: &P,
newindex: u32
) -> Result<(), Error>[src]v1_18 only.fn set_top_effect_priority<P: IsA<BaseEffect>>(
&self,
effect: &P,
newpriority: u32
) -> Result<(), BoolError>[src]v1_18 only.v1_18 only.