pub trait ProjectExt: IsA<Project> + 'static {
Show 21 methods
// Provided methods
fn add_asset(&self, asset: &impl IsA<Asset>) -> bool { ... }
fn add_encoding_profile(
&self,
profile: &impl IsA<EncodingProfile>,
) -> Result<(), BoolError> { ... }
fn add_formatter(&self, formatter: &impl IsA<Formatter>) { ... }
fn create_asset(&self, id: Option<&str>, extractable_type: Type) -> bool { ... }
fn create_asset_sync(
&self,
id: Option<&str>,
extractable_type: Type,
) -> Result<Option<Asset>, Error> { ... }
fn asset(&self, id: &str, extractable_type: Type) -> Option<Asset> { ... }
fn loading_assets(&self) -> Vec<Asset> { ... }
fn uri(&self) -> Option<GString> { ... }
fn list_assets(&self, filter: Type) -> Vec<Asset> { ... }
fn list_encoding_profiles(&self) -> Vec<EncodingProfile> { ... }
fn load(&self, timeline: &impl IsA<Timeline>) -> Result<(), Error> { ... }
fn remove_asset(&self, asset: &impl IsA<Asset>) -> Result<(), BoolError> { ... }
fn save(
&self,
timeline: &impl IsA<Timeline>,
uri: &str,
formatter_asset: Option<impl IsA<Asset>>,
overwrite: bool,
) -> Result<(), Error> { ... }
fn connect_asset_added<F: Fn(&Self, &Asset) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_asset_loading<F: Fn(&Self, &Asset) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_asset_removed<F: Fn(&Self, &Asset) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_error_loading<F: Fn(&Self, &Timeline, &Error) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_error_loading_asset<F: Fn(&Self, &Error, &str, Type) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_loaded<F: Fn(&Self, &Timeline) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_loading<F: Fn(&Self, &Timeline) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<GString> + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Provided Methods§
Sourcefn add_encoding_profile(
&self,
profile: &impl IsA<EncodingProfile>,
) -> Result<(), BoolError>
fn add_encoding_profile( &self, profile: &impl IsA<EncodingProfile>, ) -> Result<(), BoolError>
Adds profile to the project. It lets you save in what format
the project will be rendered and keep a reference to those formats.
Also, those formats will be saved to the project file when possible.
§profile
A [gst_pbutils::EncodingProfile][crate::gst_pbutils::EncodingProfile] to add to the project. If a profile with
the same name already exists, it will be replaced.
§Returns
true if profile could be added, false otherwise
MT safe.
Sourcefn add_formatter(&self, formatter: &impl IsA<Formatter>)
fn add_formatter(&self, formatter: &impl IsA<Formatter>)
Sourcefn create_asset(&self, id: Option<&str>, extractable_type: Type) -> bool
fn create_asset(&self, id: Option<&str>, extractable_type: Type) -> bool
Create and add a Asset to self. You should connect to the
“asset-added” signal to get the asset when it finally gets added to
self
§id
The id of the asset to create and add to self
§extractable_type
The GType of the asset to create
§Returns
true if the asset was added and started loading, false it was
already in the project.
MT safe.
Sourcefn create_asset_sync(
&self,
id: Option<&str>,
extractable_type: Type,
) -> Result<Option<Asset>, Error>
fn create_asset_sync( &self, id: Option<&str>, extractable_type: Type, ) -> Result<Option<Asset>, Error>
Sourcefn loading_assets(&self) -> Vec<Asset>
fn loading_assets(&self) -> Vec<Asset>
Get the assets that are being loaded
§Returns
A set of loading asset
that will be added to self. Note that those Asset are not loaded yet,
and thus can not be used.
MT safe.
Sourcefn uri(&self) -> Option<GString>
fn uri(&self) -> Option<GString>
Retrieve the uri that is currently set on self
§Returns
a newly allocated string representing uri.
MT safe.
Sourcefn list_assets(&self, filter: Type) -> Vec<Asset>
fn list_assets(&self, filter: Type) -> Vec<Asset>
Sourcefn list_encoding_profiles(&self) -> Vec<EncodingProfile>
fn list_encoding_profiles(&self) -> Vec<EncodingProfile>
Lists the encoding profile that have been set to self. The first one
is the latest added.
§Returns
The
list of [gst_pbutils::EncodingProfile][crate::gst_pbutils::EncodingProfile] used in self
Sourcefn save(
&self,
timeline: &impl IsA<Timeline>,
uri: &str,
formatter_asset: Option<impl IsA<Asset>>,
overwrite: bool,
) -> Result<(), Error>
fn save( &self, timeline: &impl IsA<Timeline>, uri: &str, formatter_asset: Option<impl IsA<Asset>>, overwrite: bool, ) -> Result<(), Error>
Save the timeline of self to uri. You should make sure that timeline
is one of the timelines that have been extracted from self
(using ges_asset_extract (self);)
§timeline
The Timeline to save, it must have been extracted from self
§uri
The uri where to save self and timeline
§formatter_asset
The formatter asset to
use or None. If None, will try to save in the same format as the one
from which the timeline as been loaded or default to the best formatter
as defined in ges_find_formatter_for_uri
§overwrite
true to overwrite file if it exists
§Returns
true if the project could be save, false otherwise
MT safe.
Sourcefn connect_asset_added<F: Fn(&Self, &Asset) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_asset_added<F: Fn(&Self, &Asset) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcefn connect_asset_loading<F: Fn(&Self, &Asset) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_asset_loading<F: Fn(&Self, &Asset) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcefn connect_asset_removed<F: Fn(&Self, &Asset) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_asset_removed<F: Fn(&Self, &Asset) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcefn connect_error_loading<F: Fn(&Self, &Timeline, &Error) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_error_loading<F: Fn(&Self, &Timeline, &Error) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcefn connect_error_loading_asset<F: Fn(&Self, &Error, &str, Type) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_error_loading_asset<F: Fn(&Self, &Error, &str, Type) + 'static>( &self, f: F, ) -> SignalHandlerId
Informs you that a Asset could not be created. In case of
missing GStreamer plugins, the error will be set to GST_CORE_ERROR
gst::CoreError::MissingPlugin
§error
The glib::Error defining the error that occured, might be None
§id
The id of the asset that failed loading
§extractable_type
The extractable_type of the asset that
failed loading
Sourcefn connect_loaded<F: Fn(&Self, &Timeline) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_loaded<F: Fn(&Self, &Timeline) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcefn connect_loading<F: Fn(&Self, &Timeline) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_loading<F: Fn(&Self, &Timeline) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcefn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<GString> + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<GString> + 'static>( &self, f: F, ) -> SignalHandlerId
⚠️ The following code is in c ⚠️
static gchar
source_moved_cb (GESProject *project, GError *error, GESAsset *asset_with_error)
{
return g_strdup ("file:///the/new/uri.ogg");
}
static int
main (int argc, gchar ** argv)
{
GESTimeline *timeline;
GESProject *project = ges_project_new ("file:///some/uri.xges");
g_signal_connect (project, "missing-uri", source_moved_cb, NULL);
timeline = ges_asset_extract (GES_ASSET (project));
}§error
The error that happened
§wrong_asset
The asset with the wrong ID, you should us it and its content only to find out what the new location is.
§Returns
The new URI of wrong_asset
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.