Trait gstreamer_editing_services::prelude::ProjectExt[][src]

pub trait ProjectExt: 'static {
Show methods fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> bool;
fn add_encoding_profile<P: IsA<EncodingProfile>>(
        &self,
        profile: &P
    ) -> Result<(), BoolError>;
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<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), Error>;
fn remove_asset<P: IsA<Asset>>(&self, asset: &P) -> Result<(), BoolError>;
fn save<P: IsA<Timeline>, Q: IsA<Asset>>(
        &self,
        timeline: &P,
        uri: &str,
        formatter_asset: Option<&Q>,
        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;
}

Trait containing all Project methods.

Implementors

crate::Project

Required methods

fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> bool[src]

Adds a crate::Asset to self, the project will keep a reference on asset.

asset

A crate::Asset to add to self

Returns

true if the asset could be added false it was already in the project

fn add_encoding_profile<P: IsA<EncodingProfile>>(
    &self,
    profile: &P
) -> Result<(), BoolError>
[src]

Adds profile to the project. It lets you save in what format the project has been renders and keep a reference to those formats. Also, those formats will be saves to the project file when possible.

profile

A 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 otherwize

fn create_asset(&self, id: Option<&str>, extractable_type: Type) -> bool[src]

Create and add a crate::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 crate::glib::Type of the asset to create

Returns

true if the asset started to be added false it was already in the project

fn create_asset_sync(
    &self,
    id: Option<&str>,
    extractable_type: Type
) -> Result<Option<Asset>, Error>
[src]

Create and add a crate::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 crate::glib::Type of the asset to create

Returns

The newly created crate::Asset or None.

fn asset(&self, id: &str, extractable_type: Type) -> Option<Asset>[src]

id

The id of the asset to retrieve

extractable_type

The extractable_type of the asset to retrieve from object

Returns

The crate::Asset with id or None if no asset with id as an ID

fn loading_assets(&self) -> Vec<Asset>[src]

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

fn uri(&self) -> Option<GString>[src]

Retrieve the uri that is currently set on self

Returns

a newly allocated string representing uri.

fn list_assets(&self, filter: Type) -> Vec<Asset>[src]

List all asset contained in self filtering per extractable_type as defined by filter. It copies the asset and thus will not be updated in time.

filter

Type of assets to list, GES_TYPE_EXTRACTABLE will list all assets

Returns

The list of crate::Asset the object contains

fn list_encoding_profiles(&self) -> Vec<EncodingProfile>[src]

Lists the encoding profile that have been set to self. The first one is the latest added.

Returns

The list of crate::gst_pbutils::EncodingProfile used in self

fn load<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), Error>[src]

Loads self into timeline

timeline

A blank timeline to load self into

Returns

true if the project could be loaded false otherwize.

fn remove_asset<P: IsA<Asset>>(&self, asset: &P) -> Result<(), BoolError>[src]

remove a asset to from self.

asset

A crate::Asset to remove from self

Returns

true if the asset could be removed false otherwise

fn save<P: IsA<Timeline>, Q: IsA<Asset>>(
    &self,
    timeline: &P,
    uri: &str,
    formatter_asset: Option<&Q>,
    overwrite: bool
) -> Result<(), Error>
[src]

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 crate::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 otherwize

fn connect_asset_added<F: Fn(&Self, &Asset) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

asset

The crate::Asset that has been added to project

fn connect_asset_loading<F: Fn(&Self, &Asset) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

asset

The crate::Asset that started loading

fn connect_asset_removed<F: Fn(&Self, &Asset) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

asset

The crate::Asset that has been removed from project

fn connect_error_loading<F: Fn(&Self, &Timeline, &Error) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

This is supported on crate feature v1_18 only.

timeline

The timeline that failed loading

error

The crate::glib::Error defining the error that occured

fn connect_error_loading_asset<F: Fn(&Self, &Error, &str, Type) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Informs you that a crate::Asset could not be created. In case of missing GStreamer plugins, the error will be set to GST_CORE_ERROR crate::gst::CoreError::MissingPlugin

error

The crate::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

fn connect_loaded<F: Fn(&Self, &Timeline) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

timeline

The crate::Timeline that completed loading

fn connect_loading<F: Fn(&Self, &Timeline) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

This is supported on crate feature v1_18 only.

timeline

The crate::Timeline that started loading

fn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<GString> + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

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

Loading content...

Implementors

impl<O: IsA<Project>> ProjectExt for O[src]

fn add_asset<P: IsA<Asset>>(&self, asset: &P) -> bool[src]

fn add_encoding_profile<P: IsA<EncodingProfile>>(
    &self,
    profile: &P
) -> Result<(), BoolError>
[src]

fn create_asset(&self, id: Option<&str>, extractable_type: Type) -> bool[src]

fn create_asset_sync(
    &self,
    id: Option<&str>,
    extractable_type: Type
) -> Result<Option<Asset>, Error>
[src]

fn asset(&self, id: &str, extractable_type: Type) -> Option<Asset>[src]

fn loading_assets(&self) -> Vec<Asset>[src]

fn uri(&self) -> Option<GString>[src]

fn list_assets(&self, filter: Type) -> Vec<Asset>[src]

fn list_encoding_profiles(&self) -> Vec<EncodingProfile>[src]

fn load<P: IsA<Timeline>>(&self, timeline: &P) -> Result<(), Error>[src]

fn remove_asset<P: IsA<Asset>>(&self, asset: &P) -> Result<(), BoolError>[src]

fn save<P: IsA<Timeline>, Q: IsA<Asset>>(
    &self,
    timeline: &P,
    uri: &str,
    formatter_asset: Option<&Q>,
    overwrite: bool
) -> Result<(), Error>
[src]

fn connect_asset_added<F: Fn(&Self, &Asset) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_asset_loading<F: Fn(&Self, &Asset) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_asset_removed<F: Fn(&Self, &Asset) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_error_loading<F: Fn(&Self, &Timeline, &Error) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

This is supported on crate feature v1_18 only.

fn connect_error_loading_asset<F: Fn(&Self, &Error, &str, Type) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_loaded<F: Fn(&Self, &Timeline) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

fn connect_loading<F: Fn(&Self, &Timeline) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

This is supported on crate feature v1_18 only.

fn connect_missing_uri<F: Fn(&Self, &Error, &Asset) -> Option<GString> + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Loading content...