diff --git a/.rustfmt.toml b/.rustfmt.toml index e2af441ec..fa15a9754 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -12,4 +12,5 @@ ignore = [ "gstreamer-sdp/src/auto", "gstreamer-video/src/auto", "gstreamer-webrtc/src/auto", + "gstreamer-editing-services/src/auto", ] diff --git a/Cargo.toml b/Cargo.toml index d9da316bc..2c74db3a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ members = [ "gstreamer-pbutils", "gstreamer-webrtc", "gstreamer-check", + "gstreamer-editing-services", "examples", "tutorials", ] diff --git a/Gir_GstEditingServices.toml b/Gir_GstEditingServices.toml new file mode 100644 index 000000000..8526c2a95 --- /dev/null +++ b/Gir_GstEditingServices.toml @@ -0,0 +1,110 @@ +[options] +girs_dir = "gir-files" +library = "GES" +version = "1.0" +min_cfg_version = "1.8" +target_path = "gstreamer-editing-services" +work_mode = "normal" +generate_safety_asserts = true +single_version_file = true + +external_libraries = [ + "GLib", + "GObject", + "Gio", + "Gst", + "GstPbutils", +] + +manual = [ + "GLib.Error", + "GLib.Source", + "GLib.DateTime", + "Gio.Cancellable", + "Gio.AsyncReadyCallback", + "GObject.Object", + "Gst.Segment", + "Gst.StaticCaps", + "Gst.StaticPadTemplate", + "GstPbutils.EncodingProfile", + "GstPbutils.DiscovererInfo", + "GstPbutils.DiscovererStreamInfo", + "Gst.Object", + "Gst.Element", + "Gst.Pad", + "Gst.Pipeline", +] + +generate = [ + "GES.EditMode", + "GES.PipelineFlags", + "GES.Edge", + "GES.Effect", + "GES.TrackType", + "GES.Pipeline", + "GES.BaseEffect", + "GES.TimelineElement", + "GES.Group", + "GES.TrackElement", + "GES.Track", + "GES.Layer", + "GES.Clip", + "GES.UriClip", + "GES.Asset", + "GES.UriClipAsset", + "GES.UriSourceAsset", + "GES.Extractable", + "GES.Project", +] + +[[object]] +name = "Gst.Structure" +status = "manual" +ref_mode = "ref-mut" + +[[object]] +name = "Gst.Caps" +status = "manual" +ref_mode = "ref" + +[[object]] +name = "Gst.Buffer" +status = "manual" +ref_mode = "ref" + +[[object]] +name = "Gst.BufferList" +status = "manual" +ref_mode = "ref" + +[[object]] +name = "Gst.Sample" +status = "manual" +ref_mode = "ref" + +[[object]] +name = "Gst.ClockTime" +status = "manual" +conversion_type = "scalar" + +[[object]] +name = "GES.Timeline" +status = "generate" + [[object.function]] + name = "append_layer" + [object.function.return] + nullable = false + +[[object]] +name = "GES.Container" +status = "generate" +trait_name = "GESContainerExt" + [[object.function]] + name = "add" + [object.function.return] + bool_return_is_error = "Failed to add element" + + [[object.function]] + name = "remove" + [object.function.return] + bool_return_is_error = "Failed to remove element" \ No newline at end of file diff --git a/docs/gstreamer-editing-services/docs.md b/docs/gstreamer-editing-services/docs.md new file mode 100644 index 000000000..e69de29bb diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 00f7c5533..2f7237d64 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -11,6 +11,7 @@ gstreamer-audio = { path = "../gstreamer-audio" } gstreamer-video = { path = "../gstreamer-video" } gstreamer-pbutils = { path = "../gstreamer-pbutils" } gstreamer-player = { path = "../gstreamer-player", optional = true } +gstreamer-editing-services = { path = "../gstreamer-editing-services", optional = true } gstreamer-rtsp = { path = "../gstreamer-rtsp", optional = true } gstreamer-rtsp-server = { path = "../gstreamer-rtsp-server", optional = true } gstreamer-rtsp-server-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"], optional = true } @@ -27,6 +28,7 @@ pangocairo = { git = "https://github.com/gtk-rs/pangocairo", optional = true } [features] gst-player = ["gstreamer-player"] +ges = ["gstreamer-editing-services"] gtksink = ["gtk", "gio"] gtkvideooverlay = ["gtk", "gdk", "gio"] gtkvideooverlay-x11 = ["gtkvideooverlay"] @@ -121,3 +123,7 @@ name = "discoverer" [[bin]] name = "pango-cairo" required-features = ["pango-cairo"] + +[[bin]] +name = "ges" +required-features = ["ges"] diff --git a/examples/src/bin/ges.rs b/examples/src/bin/ges.rs new file mode 100644 index 000000000..19fe39f73 --- /dev/null +++ b/examples/src/bin/ges.rs @@ -0,0 +1,105 @@ +extern crate gstreamer as gst; +use gst::prelude::*; + +extern crate gstreamer_editing_services as ges; +use ges::prelude::*; +use ges::PipelineExt; + +use std::env; + +#[allow(unused_imports)] +#[path = "../examples-common.rs"] +mod examples_common; + +extern crate failure; +#[allow(unused_imports)] +use failure::Error; + +extern crate glib; + +fn main_loop(uri: &str) -> Result<(), glib::BoolError> { + ges::init()?; + + let timeline = ges::Timeline::new_audio_video(); + let layer = timeline.append_layer(); + let pipeline = ges::Pipeline::new(); + pipeline.set_timeline(&timeline); + + let clip = ges::UriClip::new(uri); + layer.add_clip(&clip); + + let effect = ges::Effect::new("agingtv"); + clip.add(&effect).unwrap(); + + println!( + "Agingtv scratch-lines: {}", + clip.get_child_property("scratch-lines") + .unwrap() + .serialize() + .unwrap() + ); + + let asset = clip.get_asset().unwrap(); + let duration = asset + .downcast::() + .unwrap() + .get_duration(); + println!( + "Clip duration: {} - playing file from {} for {}", + duration, + duration / 2, + duration / 4 + ); + + clip.set_inpoint(duration / 2); + clip.set_duration(duration / 4); + + let ret = pipeline.set_state(gst::State::Playing); + assert_ne!(ret, gst::StateChangeReturn::Failure); + + let bus = pipeline.get_bus().unwrap(); + while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) { + use gst::MessageView; + + match msg.view() { + MessageView::Eos(..) => break, + MessageView::Error(err) => { + println!( + "Error from {:?}: {} ({:?})", + err.get_src().map(|s| s.get_path_string()), + err.get_error(), + err.get_debug() + ); + break; + } + _ => (), + } + } + + let ret = pipeline.set_state(gst::State::Null); + assert_ne!(ret, gst::StateChangeReturn::Failure); + + Ok(()) +} + +#[allow(unused_variables)] +fn example_main() { + let args: Vec<_> = env::args().collect(); + let uri: &str = if args.len() == 2 { + args[1].as_ref() + } else { + println!("Usage: ges launch"); + std::process::exit(-1) + }; + + match main_loop(uri) { + Ok(r) => r, + Err(e) => eprintln!("Error! {}", e), + } +} + +fn main() { + // tutorials_common::run is only required to set up the application environent on macOS + // (but not necessary in normal Cocoa applications where this is set up autmatically) + examples_common::run(example_main); +} diff --git a/gir-files/GES-1.0.gir b/gir-files/GES-1.0.gir new file mode 100644 index 000000000..a26735ff3 --- /dev/null +++ b/gir-files/GES-1.0.gir @@ -0,0 +1,13220 @@ + + + + + + + + + + + + + The Assets in the GStreamer Editing Services represent the resources +that can be used. You can create assets for any type that implements the #GESExtractable +interface, for example #GESClips, #GESFormatter, and #GESTrackElement do implement it. +This means that assets will represent for example a #GESUriClips, #GESBaseEffect etc, +and then you can extract objects of those types with the appropriate parameters from the asset +using the #ges_asset_extract method: + +|[ +GESAsset *effect_asset; +GESEffect *effect; + +// You create an asset for an effect +effect_asset = ges_asset_request (GES_TYPE_EFFECT, "agingtv", NULL); + +// And now you can extract an instance of GESEffect from that asset +effect = GES_EFFECT (ges_asset_extract (effect_asset)); + +]| + +In that example, the advantages of having a #GESAsset are that you can know what effects +you are working with and let your user know about the avalaible ones, you can add metadata +to the #GESAsset through the #GESMetaContainer interface and you have a model for your +custom effects. Note that #GESAsset management is making easier thanks to the #GESProject class. + +Each asset is represented by a pair of @extractable_type and @id (string). Actually the @extractable_type +is the type that implements the #GESExtractable interface, that means that for example for a #GESUriClip, +the type that implements the #GESExtractable interface is #GESClip. +The identifier represents different things depending on the @extractable_type and you should check +the documentation of each type to know what the ID of #GESAsset actually represents for that type. By default, +we only have one #GESAsset per type, and the @id is the name of the type, but this behaviour is overriden +to be more useful. For example, for GESTransitionClips, the ID is the vtype of the transition +you will extract from it (ie crossfade, box-wipe-rc etc..) For #GESEffect the ID is the +@bin-description property of the extracted objects (ie the gst-launch style description of the bin that +will be used). + +Each and every #GESAsset is cached into GES, and you can query those with the #ges_list_assets function. +Also the system will automatically register #GESAssets for #GESFormatters and #GESTransitionClips +and standard effects (actually not implemented yet) and you can simply query those calling: +|[ + GList *formatter_assets, *tmp; + + // List all the transitions + formatter_assets = ges_list_assets (GES_TYPE_FORMATTER); + + // Print some infos about the formatter GESAsset + for (tmp = formatter_assets; tmp; tmp = tmp->next) { + g_print ("Name of the formatter: %s, file extension it produces: %s", + ges_meta_container_get_string (GES_META_CONTAINER (tmp->data), GES_META_FORMATTER_NAME), + ges_meta_container_get_string (GES_META_CONTAINER (tmp->data), GES_META_FORMATTER_EXTENSION)); + } + + g_list_free (transition_assets); + +]| + +You can request the creation of #GESAssets using either ges_asset_request() or +ges_asset_request_async(). All the #GESAssets are cached and thus any asset that has already +been created can be requested again without overhead. + + + + + Sets an asset from the internal cache as needing reload. An asset needs reload +in the case where, for example, we were missing a GstPlugin to use it and that +plugin has been installed, or, that particular asset content as changed +meanwhile (in the case of the usage of proxies). + +Once an asset has been set as "needs reload", requesting that asset again +will lead to it being re discovered, and reloaded as if it was not in the +cache before. + + %TRUE if the asset was in the cache and could be set as needing reload, +%FALSE otherwise. + + + + + The #GType of the object that can be extracted from the + asset to be reloaded. + + + + The identifier of the asset to mark as needing reload + + + + + + Create a #GESAsset in the most simple cases, you should look at the @extractable_type +documentation to see if that constructor can be called for this particular type + +As it is recommanded not to instanciate assets for GESUriClip synchronously, +it will not work with this method, but you can instead use the specific +#ges_uri_clip_asset_request_sync method if you really want to. + + A reference to the wanted #GESAsset or %NULL + + + + + The #GType of the object that can be extracted from the new asset. + + + + The Identifier or %NULL + + + + + + Request a new #GESAsset asyncronously, @callback will be called when the materail is +ready to be used or if an error occured. + +Example of request of a GESAsset async: +|[ +// The request callback +static void +asset_loaded_cb (GESAsset * source, GAsyncResult * res, gpointer user_data) +{ + GESAsset *asset; + GError *error = NULL; + + asset = ges_asset_request_finish (res, &error); + if (asset) { + g_print ("The file: %s is usable as a FileSource", + ges_asset_get_id (asset)); + } else { + g_print ("The file: %s is *not* usable as a FileSource because: %s", + ges_asset_get_id (source), error->message); + } + + gst_object_unref (mfs); +} + +// The request: +ges_asset_request_async (GES_TYPE_URI_CLIP, some_uri, NULL, + (GAsyncReadyCallback) asset_loaded_cb, user_data); +]| + + + + + + The #GType of the object that can be extracted from the + new asset. The class must implement the #GESExtractable interface. + + + + The Identifier of the asset we want to create. This identifier depends of the extractable, +type you want. By default it is the name of the class itself (or %NULL), but for example for a +GESEffect, it will be the pipeline description, for a GESUriClip it +will be the name of the file, etc... You should refer to the documentation of the #GESExtractable +type you want to create a #GESAsset for. + + + + optional %GCancellable object, %NULL to ignore. + + + + a #GAsyncReadyCallback to call when the initialization is finished, +Note that the @source of the callback will be the #GESAsset, but you need to +make sure that the asset is properly loaded using the #ges_asset_request_finish +method. This asset can not be used as is. + + + + The user data to pass when @callback is called + + + + + + Finalize the request of an async #GESAsset + + The #GESAsset previously requested + + + + + The #GAsyncResult from which to get the newly created #GESAsset + + + + + + Extracts a new #GObject from @asset. The type of the object is +defined by the extractable-type of @asset, you can check what +type will be extracted from @asset using +#ges_asset_get_extractable_type + + A newly created #GESExtractable + + + + + The #GESAsset to get extract an object from + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Extracts a new #GObject from @asset. The type of the object is +defined by the extractable-type of @asset, you can check what +type will be extracted from @asset using +#ges_asset_get_extractable_type + + A newly created #GESExtractable + + + + + The #GESAsset to get extract an object from + + + + + + + The #GError of the asset or %NULL if +the asset was loaded without issue + + + + + The asset to retrieve the error from + + + + + + Gets the type of object that can be extracted from @self + + the type of object that can be extracted from @self + + + + + The #GESAsset + + + + + + Gets the ID of a #GESAsset + + The ID of @self + + + + + The #GESAsset to get ID from + + + + + + + The proxy in use for @asset + + + + + The #GESAsset to get currenlty used proxy + + + + + + + The #GESAsset that is proxied by @proxy + + + + + The #GESAsset from which to get the the asset it proxies. + + + + + + + The list of proxies @asset has. Note that the default asset to be +used is always the first in that list. + + + + + + + The #GESAsset to get proxies from + + + + + + A proxying asset is an asset that can substitue the real @asset. For example if you +have a full HD #GESUriClipAsset you might want to set a lower resolution (HD version +of the same file) as proxy. Note that when an asset is proxied, calling +#ges_asset_request will actually return the proxy asset. + + %TRUE if @proxy has been set on @asset, %FALSE otherwise. + + + + + The #GESAsset to set proxy on + + + + The #GESAsset that should be used as default proxy for @asset or +%NULL if you want to use the currently set proxy. Note that an asset can proxy one and only +one other asset. + + + + + + Removes @proxy from the list of known proxies for @asset. +If @proxy was the current proxy for @asset, stop using it. + + %TRUE if @proxy was a known proxy for @asset, %FALSE otherwise. + + + + + The #GESAsset to stop proxying with @proxy + + + + The #GESAsset to stop considering as a proxy for @asset + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A newly created #GESExtractable + + + + + The #GESAsset to get extract an object from + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ## Children Properties + +You can use the following children properties through the +#ges_track_element_set_child_property and alike set of methods: + +<informaltable frame="none"> +<tgroup cols="3"> +<colspec colname="properties_type" colwidth="150px"/> +<colspec colname="properties_name" colwidth="200px"/> +<colspec colname="properties_flags" colwidth="400px"/> +<tbody> +<row> + <entry role="property_type"><link linkend="gdouble"><type>double</type></link></entry> + <entry role="property_name"><link linkend="GESAudioSource--volume">volume</link></entry> + <entry>volume factor, 1.0=100%.</entry> +</row> +<row> + <entry role="property_type"><link linkend="gboolean"><type>gboolean</type></link></entry> + <entry role="property_name"><link linkend="GESAudioSource--mute">mute</link></entry> + <entry>mute channel.</entry> +</row> +</tbody> +</tgroup> +</informaltable> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Outputs a test audio stream using audiotestsrc. The default property values +output silence. Useful for testing pipelines, or to fill gaps in an audio +track. + + + + Get the current frequency of @self. + + The current frequency of @self. + + + + + a #GESAudioTestSource + + + + + + Get the current volume of @self. + + The current volume of @self + + + + + a #GESAudioTestSource + + + + + + Lets you set the frequency applied on the track element + + + + + + a #GESAudioTestSource + + + + The frequency you want to apply on @self + + + + + + Sets the volume of the test audio signal. + + + + + + a #GESAudioTestSource + + + + The volume you want to apply on @self + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sane default properties to specify and fixate the output stream are +set as restriction-caps. +It is advised, to modify these properties, to use +#ges_track_update_restriction_caps, setting them directly is +possible through #ges_track_set_restriction_caps, but not specifying +one of them can lead to negotiation issues, only use that function +if you actually know what you're doing :) + +The default properties are: +- format: S32LE +- channels: 2 +- rate: 44100 +- layout: interleaved + + + + Creates a new #GESAudioTrack of type #GES_TRACK_TYPE_AUDIO and with generic +raw audio caps ("audio/x-raw"); + + A new #GESTrack + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creates a new #GESAudioTransition. + + The newly created #GESAudioTransition. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The location of the file/resource to use. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + parent class + + + + + + + + + + The effect will be applied on the sources that have lower priorities +(higher number) between the inpoint and the end of it. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A #GESClip is a 'natural' object which controls one or more +#GESTrackElement(s) in one or more #GESTrack(s). + +Keeps a reference to the #GESTrackElement(s) it created and +sets/updates their properties. + + + + + the #GESTrackElement to be used, or %NULL if it can't provide one +for the given @track. + + + + + a #GESClip + + + + a #GESTrackType + + + + + + + %TRUE on success %FALSE on failure. + + + + + + + a #GESClip + + + + a #GESTrackType + + + + + + Extracts a #GESTrackElement from @asset and adds it to the @clip. +Should only be called in order to add operations to a #GESClip, +ni other cases TrackElement are added automatically when adding the +#GESClip/#GESAsset to a layer. + +Takes a reference on @track_element. + + Created #GESTrackElement or NULL +if an error happened + + + + + a #GESClip + + + + a #GESAsset with #GES_TYPE_TRACK_ELEMENT as extractable_type + + + + + + Finds the #GESTrackElement controlled by @clip that is used in @track. You +may optionally specify a GType to further narrow search criteria. + +Note: If many objects match, then the one with the highest priority will be +returned. + + The #GESTrackElement used by @track, +else %NULL. Unref after usage + + + + + a #GESClip + + + + a #GESTrack or NULL + + + + a #GType indicating the type of track element you are looking +for or %G_TYPE_NONE if you do not care about the track type. + + + + + + Finds all the #GESTrackElement controlled by @clip that is used in @track. You +may optionally specify a GType to further narrow search criteria. + + a #GList of the +#GESTrackElement contained in @clip. +The refcount of the objects will be increased. The user will have to +unref each #GESTrackElement and free the #GList. + + + + + + + a #GESClip + + + + a #GESTrack or NULL + + + + a #GESTrackType indicating the type of tracks in which elements +should be searched. + + + + a #GType indicating the type of track element you are looking +for or %G_TYPE_NONE if you do not care about the track type. + + + + + + Get the #GESLayer to which this clip belongs. + + The #GESLayer where this @clip is being +used, or %NULL if it is not used on any layer. The caller should unref it +usage. + + + + + a #GESClip + + + + + + Get the formats supported by @clip. + + The formats supported by @clip. + + + + + the #GESClip + + + + + + Gets the index position of an effect. + + The top index of the effect, -1 if something went wrong. + + + + + The origin #GESClip + + + + The #GESBaseEffect we want to get the top index from + + + + + + + + + + + + + + + + + + + Get effects applied on @clip + + a #GList of the +#GESBaseEffect that are applied on @clip order by ascendant priorities. +The refcount of the objects will be increased. The user will have to +unref each #GESBaseEffect and free the #GList. + + + + + + + The origin #GESClip + + + + + + Moves @clip to @layer. If @clip is not in any layer, it adds it to +@layer, else, it removes it from its current layer, and adds it to @layer. + + %TRUE if @clip could be moved %FALSE otherwize + + + + + a #GESClip + + + + the new #GESLayer + + + + + + Sets the formats supported by the file. + + + + + + the #GESClip to set supported formats on + + + + the #GESTrackType defining formats supported by @clip + + + + + + This is a convenience method that lets you set the index of a top effect. + + %TRUE if @effect was successfuly moved, %FALSE otherwise. + + + + + The origin #GESClip + + + + The #GESBaseEffect to move + + + + the new index at which to move the @effect inside this +#GESClip + + + + + + + + + + + + + + + + + + + + + + The function modifies @clip, and creates another #GESClip so we have two +clips at the end, splitted at the time specified by @position, as a position +in the timeline (not in the clip to be split). For example, if +ges_clip_split is called on a 4-second clip playing from 0:01.00 until +0:05.00, with a split position of 0:02.00, this will result in one clip of 1 +second and one clip of 3 seconds, not in two clips of 2 seconds. + +The newly created clip will be added to the same layer as @clip is in. This +implies that @clip must be in a #GESLayer for the operation to be possible. + +This method supports clips playing at a different tempo than one second per +second. For example, splitting a clip with a #GESEffect 'pitch tempo=1.5' +four seconds after it starts, will set the inpoint of the new clip to six +seconds after that of the clip to split. For this, the rate-changing +property must be registered using @ges_effect_class_register_rate_property; +for the 'pitch' plugin, this is already done. + + The newly created #GESClip resulting +from the splitting or %NULL if the clip can't be split. + + + + + the #GESClip to split + + + + a #GstClockTime representing the timeline position at which to split + + + + + + The GESLayer where this clip is being used. If you want to connect to its +notify signal you should connect to it with g_signal_connect_after as the +signal emission can be stop in the first fase. + + + + The formats supported by the clip. + + + + + + + + + + + + + + + + The #GESUriClipAsset is a special #GESAsset specilized in #GESClip. +it is mostly used to get information about the #GESTrackType-s the objects extracted +from it can potentialy create #GESTrackElement for. + + + + + Gets track types for which objects extracted from @self can create #GESTrackElement + + The track types on which @self will create TrackElement when added to +a layer + + + + + a #GESClipAsset + + + + + + Sets track types for which objects extracted from @self can create #GESTrackElement + + + + + + a #GESClipAsset + + + + The track types supported by the GESClipAsset + + + + + + The formats supported by the asset. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Subclasses can override the @create_track_element. + + + + + method to create a single #GESTrackElement for a given #GESTrack. + + + + method to create multiple #GESTrackElements for a +#GESTrack. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The #GESContainer base class. + + + + Groups the #GESContainer-s provided in @containers. It creates a subclass +of #GESContainer, depending on the containers provided in @containers. +Basically, if all the containers in @containers should be contained in a same +clip (all the #GESTrackElement they contain have the exact same +start/inpoint/duration and are in the same layer), it will create a #GESClip +otherwise a #GESGroup will be created + + The #GESContainer (subclass) resulting of the +grouping + + + + + The +#GESContainer to group, they must all be in a same #GESTimeline + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Edit @container in the different exisiting #GESEditMode modes. In the case of +slide, and roll, you need to specify a #GESEdge + + %TRUE if the container as been edited properly, %FALSE if an error +occured + + + + + the #GESClip to edit + + + + The layers you want the edit to + happen in, %NULL means that the edition is done in all the + #GESLayers contained in the current timeline. + + + + + + The priority of the layer @container should land in. + If the layer you're trying to move the container to doesn't exist, it will + be created automatically. -1 means no move. + + + + The #GESEditMode in which the editition will happen. + + + + The #GESEdge the edit should happen on. + + + + The position at which to edit @container (in nanosecond) + + + + + + + + + + + + + + + + + + + Ungroups the #GESTimelineElement contained in this GESContainer, +creating new #GESContainer containing those #GESTimelineElement +apropriately. + + The list of +#GESContainer resulting from the ungrouping operation +The user is responsible for unreffing the contained objects +and freeing the list. + + + + + + + The #GESContainer to ungroup + + + + Wether to recursively ungroup @container + + + + + + Add the #GESTimelineElement to the container. + + %TRUE on success, %FALSE on failure. + + + + + a #GESContainer + + + + the #GESTimelineElement + + + + + + Edit @container in the different exisiting #GESEditMode modes. In the case of +slide, and roll, you need to specify a #GESEdge + + %TRUE if the container as been edited properly, %FALSE if an error +occured + + + + + the #GESClip to edit + + + + The layers you want the edit to + happen in, %NULL means that the edition is done in all the + #GESLayers contained in the current timeline. + + + + + + The priority of the layer @container should land in. + If the layer you're trying to move the container to doesn't exist, it will + be created automatically. -1 means no move. + + + + The #GESEditMode in which the editition will happen. + + + + The #GESEdge the edit should happen on. + + + + The position at which to edit @container (in nanosecond) + + + + + + Get the list of #GESTimelineElement contained in @container +The user is responsible for unreffing the contained objects +and freeing the list. + + The list of +timeline element contained in @container. + + + + + + + a #GESContainer + + + + Whether to recursively get children in @container + + + + + + Release the @child from the control of @container. + + %TRUE if the @child was properly released, else %FALSE. + + + + + a #GESContainer + + + + the #GESTimelineElement to release + + + + + + Ungroups the #GESTimelineElement contained in this GESContainer, +creating new #GESContainer containing those #GESTimelineElement +apropriately. + + The list of +#GESContainer resulting from the ungrouping operation +The user is responsible for unreffing the contained objects +and freeing the list. + + + + + + + The #GESContainer to ungroup + + + + Wether to recursively ungroup @container + + + + + + The span of priorities which this container occupies. + + + + + + + A list of TimelineElement +controlled by this Container. NOTE: Do not modify. + + + + + + The span of priorities this container occupies + + + + + + + + + + + + + + + + + + Will be emitted after a child was added to @container. +Usually you should connect with #g_signal_connect_after +as in the first emission stage, the signal emission might +get stopped internally. + + + + + + the #GESTimelineElement that was added. + + + + + + Will be emitted after a child was removed from @container. + + + + + + the #GESTimelineElement that was removed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The list of +#GESContainer resulting from the ungrouping operation +The user is responsible for unreffing the contained objects +and freeing the list. + + + + + + + The #GESContainer to ungroup + + + + Wether to recursively ungroup @container + + + + + + + + + + + + + + + + + + + + + + + %TRUE if the container as been edited properly, %FALSE if an error +occured + + + + + the #GESClip to edit + + + + The layers you want the edit to + happen in, %NULL means that the edition is done in all the + #GESLayers contained in the current timeline. + + + + + + The priority of the layer @container should land in. + If the layer you're trying to move the container to doesn't exist, it will + be created automatically. -1 means no move. + + + + The #GESEditMode in which the editition will happen. + + + + The #GESEdge the edit should happen on. + + + + The position at which to edit @container (in nanosecond) + + + + + + + + + + + + + + + + + + A function that will be called to create the #GstElement that will be used +as a source to fill the gaps in @track. + + A #GstElement (must be a source) that will be used to +fill the gaps (periods of time in @track that containes no source). + + + + + the #GESTrack + + + + + + Creates the 'primary' track element for this @clip. + +Subclasses should implement this method if they only provide a +single #GESTrackElement per track. + +If the subclass needs to create more than one #GESTrackElement for a +given track, then it should implement the 'create_track_elements' +method instead. + +The implementer of this function shall return the proper #GESTrackElement +that should be controlled by @clip for the given @track. + +The returned #GESTrackElement will be automatically added to the list +of objects controlled by the #GESClip. + + the #GESTrackElement to be used, or %NULL if it can't provide one +for the given @track. + + + + + a #GESClip + + + + a #GESTrackType + + + + + + Create all track elements this clip handles for this type of track. + +Subclasses should implement this method if they potentially need to +return more than one #GESTrackElement(s) for a given #GESTrack. + + %TRUE on success %FALSE on failure. + + + + + + + a #GESClip + + + + a #GESTrackType + + + + + + The edges of an object contain in a #GESTimeline or #GESTrack + + Represents the start of an object. + + + Represents the end of an object. + + + Represent the fact we are not workin with any edge of an + object. + + + + You can also find more explanation about the behaviour of those modes at: +<ulink url="http://pitivi.org/manual/trimming.html"> trim, ripple and roll</ulink> +and <ulink url="http://pitivi.org/manual/usingclips.html">clip management</ulink>. + + The object is edited the normal way (default). + + + The objects are edited in ripple mode. + The Ripple mode allows you to modify the beginning/end of a clip + and move the neighbours accordingly. This will change the overall + timeline duration. In the case of ripple end, the duration of the + clip being rippled can't be superior to its max_duration - inpoint + otherwise the action won't be executed. + + + The object is edited in roll mode. + The Roll mode allows you to modify the position of an editing point + between two clips without modifying the inpoint of the first clip + nor the out-point of the second clip. This will not change the + overall timeline duration. + + + The object is edited in trim mode. + The Trim mode allows you to modify the in-point/duration of a clip + without modifying its position in the timeline. + + + The object is edited in slide mode. + The Slide mode allows you to modify the position of a clip in a + timeline without modifying its duration or its in-point, but will + modify the duration of the previous clip and in-point of the + following clip so does not modify the overall timeline duration. + (not implemented yet) + + + + + + + Creates a new #GESEffect from the description of the bin. It should be +possible to determine the type of the effect through the element +'klass' metadata of the GstElements that will be created. +In that corner case, you should use: +#ges_asset_request (GES_TYPE_EFFECT, "audio your ! bin ! description", NULL); +and extract that asset to be in full control. + + a newly created #GESEffect, or %NULL if something went +wrong. + + + + + The gst-launch like bin description of the effect + + + + + + The description of the effect bin with a gst-launch-style +pipeline description. + +Example: "videobalance saturation=1.5 hue=+0.5" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + parent class + + + + + + + + + + + + + + Register an element that can change the rate at which media is playing. The +property type must be float or double, and must be a factor of the rate, +i.e. a value of 2.0 must mean that the media plays twice as fast. For +example, this is true for the properties 'rate' and 'tempo' of the element +'pitch', which is already registered by default. By registering the element, +timeline duration can be correctly converted into media duration, allowing +the right segment seeks to be sent to the sources. + +A reference to the GESEffectClass can be obtained as follows: + GES_EFFECT_CLASS (g_type_class_ref (GES_TYPE_EFFECT)); + + whether the rate property was succesfully registered. When this +method returns false, a warning is emitted with more information. + + + + + Instance of the GESEffectClass + + + + Name of the GstElement that changes the rate + + + + Name of the property that changes the rate + + + + + + + The effect will be applied on the sources that have lower priorities +(higher number) between the inpoint and the end of it. + + + + Creates a new #GESEffectClip from the description of the bin. + + a newly created #GESEffectClip, or +%NULL if something went wrong. + + + + + The gst-launch like bin description of the effect + + + + The gst-launch like bin description of the effect + + + + + + The description of the audio track of the effect bin with a gst-launch-style +pipeline description. This should be used for test purposes. + +Example: "audiopanorama panorama=1.0" + + + + The description of the video track of the effect bin with a gst-launch-style +pipeline description. This should be used for test purposes. + +Example: "videobalance saturation=1.5 hue=+0.5" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The ID passed is malformed + + + An error happened while loading the asset + + + The formatted files was malformed + + + + FIXME: Long description needed + + + + The #id of the associated #GESAsset, free with #g_free + + + + + The #GESExtractable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Method for getting an asset from a #GESExtractable + + The #GESAsset or %NULL if none has +been set + + + + + The #GESExtractable from which to retrieve a #GESAsset + + + + + + + The #id of the associated #GESAsset, free with #g_free + + + + + The #GESExtractable + + + + + + Method to set the asset which instantiated the specified object + + %TRUE if @asset could be set %FALSE otherwize + + + + + Target object + + + + The #GESAsset to set + + + + + + + + The ID to use for the asset or %NULL if @id is not valid + + + + + The #GType to check @id for: + + + + The id to check + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The #id of the associated #GESAsset, free with #g_free + + + + + The #GESExtractable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A function that will be called when the GNonLin object of a corresponding +track element needs to be filled. + +The implementer of this function shall add the proper #GstElement to @nleobj +using gst_bin_add(). + + TRUE if the implementer succesfully filled the @nleobj, else #FALSE. + + + + + the #GESClip controlling the track elements + + + + the #GESTrackElement + + + + the GNonLin object that needs to be filled. + + + + + + Base class for timeline data serialization and deserialization. + + + Checks if there is a #GESFormatter available which can load a #GESTimeline +from the given URI. + + TRUE if there is a #GESFormatter that can support the given uri +or FALSE if not. + + + + + a #gchar * pointing to the URI + + + + + + Returns TRUE if there is a #GESFormatter available which can save a +#GESTimeline to the given URI. + + TRUE if the given @uri is supported, else FALSE. + + + + + a #gchar * pointing to a URI + + + + + + Get the default #GESAsset to use as formatter. It will return +the asset for the #GESFormatter that has the highest @rank + + The #GESAsset for the formatter with highest @rank + + + + + + + + + + + + + + + + + + Load data from the given URI into timeline. + + TRUE if the timeline data was successfully loaded from the URI, +else FALSE. + + + + + a #GESFormatter + + + + a #GESTimeline + + + + a #gchar * pointing to a URI + + + + + + Save data from timeline to the given URI. + + TRUE if the timeline data was successfully saved to the URI +else FALSE. + + + + + a #GESFormatter + + + + a #GESTimeline + + + + a #gchar * pointing to a URI + + + + %TRUE to overwrite file if it exists + + + + + + Load data from the given URI into timeline. + + TRUE if the timeline data was successfully loaded from the URI, +else FALSE. + + + + + a #GESFormatter + + + + a #GESTimeline + + + + a #gchar * pointing to a URI + + + + + + Save data from timeline to the given URI. + + TRUE if the timeline data was successfully saved to the URI +else FALSE. + + + + + a #GESFormatter + + + + a #GESTimeline + + + + a #gchar * pointing to a URI + + + + %TRUE to overwrite file if it exists + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GES Formatter class. Override the vmethods to implement the formatter functionnality. + + the parent class structure + + + + Whether the URI can be loaded + + + + class method to deserialize data from a URI + + + + class method to serialize data to a URI + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Virtual method for loading a timeline from a given URI. + +Every #GESFormatter subclass needs to implement this method. + + TRUE if the timeline data was successfully loaded from the URI, +else FALSE. + + + + + a #GESFormatter + + + + a #GESTimeline + + + + a #gchar * pointing to a URI + + + + + + + + Virtual method for saving a timeline to a uri. + +Every #GESFormatter subclass needs to implement this method. + + TRUE if the timeline data was successfully saved to the URI +else FALSE. + + + + + a #GESFormatter + + + + a #GESTimeline + + + + a #gchar * pointing to a URI + + + + %TRUE to overwrite file if it exists + + + + + + A #GESGroup is an object which controls one or more +#GESClips in one or more #GESLayer(s). + +To instanciate a group, you should use the ges_container_group method, +this will be responsible for deciding what subclass of #GESContainer +should be instaciated to group the various #GESTimelineElement passed +in parametter. + + + + Created a new empty #GESGroup, if you want to group several container +together, it is recommanded to use the #ges_container_group method so the +proper subclass is selected. + + The new empty group. + + + + + The duration (in nanoseconds) which will be used in the container + + + + The in-point at which this #GESGroup will start outputting data +from its contents (in nanoseconds). + +Ex : an in-point of 5 seconds means that the first outputted buffer will +be the one located 5 seconds in the controlled resource. + + + + The maximum duration (in nanoseconds) of the #GESGroup. + + + + + + + The position of the object in its container (in nanoseconds). + + + + + + + + + + + + + + + + + + + + + + + + + + + + Outputs the video stream from a given file as a still frame. The frame +chosen will be determined by the in-point property on the track element. For +image files, do not set the in-point property. + + + + The location of the file/resource to use. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Responsible for the ordering of the various contained Clip(s). A +timeline layer has a "priority" property, which is used to manage the +priorities of individual Clips. Two layers should not have the +same priority within a given timeline. + + + + Creates a new #GESLayer. + + A new #GESLayer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creates Clip from asset, adds it to layer and +returns a reference to it. + + Created #GESClip + + + + + a #GESLayer + + + + The asset to add to + + + + The start value to set on the new #GESClip, +if @start == GST_CLOCK_TIME_NONE, it will be set to +the current duration of @layer + + + + The inpoint value to set on the new #GESClip + + + + The duration value to set on the new #GESClip + + + + The #GESTrackType to set on the the new #GESClip + + + + + + Adds the given clip to the layer. Sets the clip's parent, and thus +takes ownership of the clip. + +An clip can only be added to one layer. + +Calling this method will construct and properly set all the media related +elements on @clip. If you need to know when those objects (actually #GESTrackElement) +are constructed, you should connect to the container::child-added signal which +is emited right after those elements are ready to be used. + + %TRUE if the clip was properly added to the layer, or %FALSE +if the @layer refuses to add the clip. + + + + + a #GESLayer + + + + the #GESClip to add. + + + + + + Gets whether transitions are automatically added when objects +overlap or not. + + %TRUE if transitions are automatically added, else %FALSE. + + + + + a #GESLayer + + + + + + Get the clips this layer contains. + + a #GList of +clips. The user is responsible for +unreffing the contained objects and freeing the list. + + + + + + + a #GESLayer + + + + + + Gets the clips which appear between @start and @end on @layer. + + a #GList of clips intersecting [@start, @end) interval on @layer. + + + + + + + a #GESLayer + + + + start of the interval + + + + end of the interval + + + + + + Lets you retrieve the duration of the layer, which means +the end time of the last clip inside it + + The duration of a layer + + + + + The #GESLayer to get the duration from + + + + + + Get the priority of @layer within the timeline. + + The priority of the @layer within the timeline. + + + + + a #GESLayer + + + + + + Get the #GESTimeline in which #GESLayer currently is. + + the #GESTimeline in which #GESLayer +currently is or %NULL if not in any timeline yet. + + + + + The #GESLayer to get the parent #GESTimeline from + + + + + + Convenience method to check if @layer is empty (doesn't contain any clip), +or not. + + %TRUE if @layer is empty, %FALSE if it already contains at least +one #GESClip + + + + + The #GESLayer to check + + + + + + Removes the given @clip from the @layer and unparents it. +Unparenting it means the reference owned by @layer on the @clip will be +removed. If you wish to use the @clip after this function, make sure you +call gst_object_ref() before removing it from the @layer. + + %TRUE if the clip could be removed, %FALSE if the layer does +not want to remove the clip. + + + + + a #GESLayer + + + + the #GESClip to remove + + + + + + Sets the layer to the given @auto_transition. See the documentation of the +property auto_transition for more information. + + + + + + a #GESLayer + + + + whether the auto_transition is active + + + + + + Sets the layer to the given @priority. See the documentation of the +priority property for more information. + use #ges_timeline_move_layer instead. This deprecation means +that you will not need to handle layer priorities at all yourself, GES +will make sure there is never 'gaps' between layer priorities. + + + + + + a #GESLayer + + + + the priority to set + + + + + + + + + + + + + + + + + + + Sets whether transitions are added automagically when clips overlap. + + + + The priority of the layer in the #GESTimeline. 0 is the highest +priority. Conceptually, a #GESTimeline is a stack of GESLayers, +and the priority of the layer represents its position in the stack. Two +layers should not have the same priority within a given GESTimeline. + +Note that the timeline needs to be commited (with #ges_timeline_commit) +for the change to be taken into account. + use #ges_timeline_move_layer instead. This deprecation means +that you will not need to handle layer priorities at all yourself, GES +will make sure there is never 'gaps' between layer priorities. + + + + + + + the #GESTimeline where this layer is being used. + + + + + + + + + + + + + + + + + + Will be emitted after the clip was added to the layer. + + + + + + the #GESClip that was added. + + + + + + Will be emitted after the clip was removed from the layer. + + + + + + the #GESClip that was removed + + + + + + + Subclasses can override the @get_objects if they can provide a more +efficient way of providing the list of contained #GESClip(s). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The description of an object, can be used in various context (string) + +The description + + + + The extension of the files produced by a formatter (string) + + + + Mimetype used for the file produced by a formatter (string) + +The mime type + + + + Name of a formatter it is used as ID of Formater assets (string) + +The name of the formatter + + + + The rank of a formatter (GstRank) + +The rank of a formatter + + + + The version of a formatter (double) + +The formatter version + + + + The version of the format in which a project is serialized + + + + The volume, can be used for audio track or layers + +The volume for a track or a layer, it is register as a float + + + + The default volume + +The default volume for a track or a layer as a float + + + + + + + Interface that allows reading and writing meta + + Deserializes a meta container. + + TRUE on success, FALSE if there was an error. + + + + + Target container + + + + a string created with ges_meta_container_metas_to_string() + + + + + + + + + + + + + + + + + + + + + + + + + Calls the given function for each metadata inside the meta container. Note +that if there is no metadata, the function won't be called at all. + + + + + + container to iterate over + + + + function to be called for each metadata + + + + user specified data + + + + + + + + + + + Target container + + + + Name of the meta item to get + + + + Destination to which value of meta item will be copied +Gets the value of a given meta item, returns NULL if @meta_item +can not be found. + + + + + + + + + + + Target container + + + + Name of the meta item to get + + + + Destination to which value of meta item will be copied +Gets the value of a given meta item, returns NULL if @meta_item +can not be found. + + + + + + + + + + + Target container + + + + Name of the meta item to get + + + + Destination to which value of meta item will be copied +Gets the value of a given meta item, returns NULL if @meta_item +can not be found. + + + + + + + + + + + Target container + + + + Name of the meta item to get + + + + Destination to which value of meta item will be copied +Gets the value of a given meta item, returns NULL if @meta_item +can not be found. + + + + + + + + + + + Target container + + + + Name of the meta item to get + + + + Destination to which value of meta item will be copied +Gets the value of a given meta item, returns FALSE if @meta_item +can not be found. + + + + + + + + + + + Target container + + + + Name of the meta item to get + + + + Destination to which value of meta item will be copied +Gets the value of a given meta item, returns NULL if @meta_item +can not be found. + + + + + + + + + + + Target container + + + + Name of the meta item to get + + + + Destination to which value of meta item will be copied +Gets the value of a given meta item, returns %FALSE if @meta_item +can not be found. + + + + + + Gets the value of a given meta item, returns NULL if @key +can not be found. + + the #GValue corresponding to the meta with the given @key. + + + + + Target container + + + + The key name of the meta to retrieve + + + + + + + + + + + Target container + + + + Name of the meta item to get +Gets the value of a given meta item, returns NULL if @meta_item +can not be found. + + + + + + + + + + + Target container + + + + Name of the meta item to get + + + + Destination to which value of meta item will be copied +Gets the value of a given meta item, returns NULL if @meta_item +can not be found. + + + + + + + + + + + Target container + + + + Name of the meta item to get + + + + Destination to which value of meta item will be copied +Gets the value of a given meta item, returns NULL if @meta_item +can not be found. + + + + + + Serializes a meta container to a string. + + a newly-allocated string, or NULL in case of an error. +The string must be freed with g_free() when no longer needed. + + + + + a #GESMetaContainer + + + + + + Sets a static meta on @container. This method lets you define static +metadatas, which means that the type of the registered will be the only +type accepted for this meta on that particular @container. + + %TRUE if the static meta could be added, %FALSE otherwize + + + + + Target container + + + + The #GESMetaFlag to be used + + + + Name of the meta item to set + + + + Value to set + + + + + + + + + + + + + + + + + + + + + + + + + Sets a static meta on @container. This method lets you define static +metadatas, which means that the type of the registered will be the only +type accepted for this meta on that particular @container. + + %TRUE if the meta could be register, %FALSE otherwize + + + + + Target container + + + + The #GESMetaFlag to be used + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets a static meta on @container. This method lets you define static +metadatas, which means that the type of the registered will be the only +type accepted for this meta on that particular @container. + + %TRUE if the meta could be register, %FALSE otherwize + + + + + Target container + + + + The #GESMetaFlag to be used + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets a static meta on @container. This method lets you define static +metadatas, which means that the type of the registered will be the only +type accepted for this meta on that particular @container. + + %TRUE if the meta could be register, %FALSE otherwize + + + + + Target container + + + + The #GESMetaFlag to be used + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets a static meta on @container. This method lets you define static +metadatas, which means that the type of the registered will be the only +type accepted for this meta on that particular @container. + + %TRUE if the meta could be register, %FALSE otherwize + + + + + Target container + + + + The #GESMetaFlag to be used + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets a static meta on @container. This method lets you define static +metadatas, which means that the type of the registered will be the only +type accepted for this meta on that particular @container. + + %TRUE if the meta could be register, %FALSE otherwize + + + + + Target container + + + + The #GESMetaFlag to be used + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets a static meta on @container. This method lets you define static +metadatas, which means that the type of the registered will be the only +type accepted for this meta on that particular @container. + + %TRUE if the meta could be register, %FALSE otherwize + + + + + Target container + + + + The #GESMetaFlag to be used + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets a static meta on @container. This method lets you define static +metadatas, which means that the type of the registered will be the only +type accepted for this meta on that particular @container. + + %TRUE if the meta could be register, %FALSE otherwize + + + + + Target container + + + + The #GESMetaFlag to be used + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets a static meta on @container. This method lets you define static +metadatas, which means that the type of the registered will be the only +type accepted for this meta on that particular @container. + + %TRUE if the meta could be register, %FALSE otherwize + + + + + Target container + + + + The #GESMetaFlag to be used + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets a static meta on @container. This method lets you define static +metadatas, which means that the type of the registered will be the only +type accepted for this meta on that particular @container. + + %TRUE if the meta could be register, %FALSE otherwize + + + + + Target container + + + + The #GESMetaFlag to be used + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets the value of a given meta item + + %TRUE if the meta could be added, %FALSE otherwize + + + + + Target container + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets the value of a given meta item + + %TRUE if the meta could be added, %FALSE otherwize + + + + + Target container + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets the value of a given meta item + + %TRUE if the meta could be added, %FALSE otherwize + + + + + Target container + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets the value of a given meta item + + %TRUE if the meta could be added, %FALSE otherwize + + + + + Target container + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets the value of a given meta item + + %TRUE if the meta could be added, %FALSE otherwize + + + + + Target container + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets the value of a given meta item + + %TRUE if the meta could be added, %FALSE otherwize + + + + + Target container + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets the value of a given meta item + + %TRUE if the meta could be added, %FALSE otherwize + + + + + Target container + + + + Name of the meta item to set + + + + Value to set + + + + + + + %TRUE if the meta could be added, %FALSE otherwize + + + + + Target container + + + + Name of the meta item to set + + + + Value to set +Sets the value of a given meta item + + + + + + Sets the value of a given meta item + + %TRUE if the meta could be added, %FALSE otherwize + + + + + Target container + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets the value of a given meta item + + %TRUE if the meta could be added, %FALSE otherwize + + + + + Target container + + + + Name of the meta item to set + + + + Value to set + + + + + + Sets the value of a given meta item + + %TRUE if the meta could be added, %FALSE otherwize + + + + + Target container + + + + Name of the meta item to set + + + + Value to set + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The metadata is readable + + + The metadata is writable + + + The metadata is readable and writable + + + + + + + + + + + + + + + + + + + + + + + Outputs the video stream from a given image sequence. The start frame +chosen will be determined by the in-point property on the track element. + + + + Creates a new #GESMultiFileSource for the provided @uri. + + A new #GESMultiFileSource. + + + + + the URI the source should control + + + + + + The uri of the file/resource to use. You can set a start index, +a stop index and a sequence pattern. +The format is &lt;multifile://start:stop\@location-pattern&gt;. +The pattern uses printf string formating. + +Example uris: + +multifile:///home/you/image\%03d.jpg + +multifile://20:50@/home/you/sequence/\%04d.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base class for overlays, transitions, and effects + + + + + + + + + + + + + + + + + + + + + + + + + + Operations are any kind of object that both outputs AND consumes data. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Overlays are objects which modify the underlying layer(s). + +Examples of overlays include text, image watermarks, or audio dubbing. + +Transitions, which change from one source to another over time, are +not considered overlays. + + + + + + + + + + + + + + + + + parent class + + + + + + + + + + + + + + + + + + #GESPipeline allows developers to view and render #GESTimeline +in a simple fashion. +Its usage is inspired by the 'playbin' element from gst-plugins-base. + + + + Creates a new conveninence #GESPipeline. + + the new #GESPipeline. + + + + + + the #GESPipelineFlags currently in use. + + + + + a #GESPipeline + + + + + + Returns a #GstSample with the currently playing image in the format specified by +caps. The caller should free the sample with #gst_sample_unref when finished. If ANY +caps are specified, the information will be returned in the whatever format +is currently used by the sink. This information can be retrieve from caps +associated with the buffer. + + a #GstSample or %NULL + + + + + a #GESPipeline in %GST_STATE_PLAYING or %GST_STATE_PAUSED + + + + caps specifying current format. Use %GST_CAPS_ANY +for native size. + + + + + + A convenience method for @ges_pipeline_get_thumbnail which +returns a buffer in 24-bit RGB, optionally scaled to the specified width +and height. If -1 is specified for either dimension, it will be left at +native size. You can retreive this information from the caps associated +with the buffer. + +The caller is responsible for unreffing the returned sample with +#gst_sample_unref. + + a #GstSample or %NULL + + + + + a #GESPipeline in %GST_STATE_PLAYING or %GST_STATE_PAUSED + + + + the requested width or -1 for native size + + + + the requested height or -1 for native size + + + + + + Obtains a pointer to playsink's audio sink element that is used for +displaying audio when the #GESPipeline is in %GES_PIPELINE_MODE_PREVIEW + +The caller is responsible for unreffing the returned element with +#gst_object_unref. + + a pointer to the playsink audio sink #GstElement + + + + + a #GESPipeline + + + + + + Obtains a pointer to playsink's video sink element that is used for +displaying video when the #GESPipeline is in %GES_PIPELINE_MODE_PREVIEW + +The caller is responsible for unreffing the returned element with +#gst_object_unref. + + a pointer to the playsink video sink #GstElement + + + + + a #GESPipeline + + + + + + Sets playsink's audio sink element that is used for displaying audio when +the #GESPipeline is in %GES_PIPELINE_MODE_PREVIEW + + + + + + a #GESPipeline in %GST_STATE_NULL + + + + a audio sink #GstElement + + + + + + Sets playsink's video sink element that is used for displaying video when +the #GESPipeline is in %GES_PIPELINE_MODE_PREVIEW + + + + + + a #GESPipeline in %GST_STATE_NULL + + + + a video sink #GstElement + + + + + + Saves the current frame to the specified @location. + + %TRUE if the thumbnail was properly save, else %FALSE. + + + + + a #GESPipeline in %GST_STATE_PLAYING or %GST_STATE_PAUSED + + + + the requested width or -1 for native size + + + + the requested height or -1 for native size + + + + a string specifying the desired mime type (for example, +image/jpeg) + + + + the path to save the thumbnail + + + + + + switches the @pipeline to the specified @mode. The default mode when +creating a #GESPipeline is #GES_PIPELINE_MODE_PREVIEW. + +Note: The @pipeline will be set to #GST_STATE_NULL during this call due to +the internal changes that happen. The caller will therefore have to +set the @pipeline to the requested state after calling this method. + + %TRUE if the mode was properly set, else %FALSE. + + + + + a #GESPipeline + + + + the #GESPipelineFlags to use + + + + + + Specify where the pipeline shall be rendered and with what settings. + +A copy of @profile and @output_uri will be done internally, the caller can +safely free those values afterwards. + +This method must be called before setting the pipeline mode to +#GES_PIPELINE_MODE_RENDER + + %TRUE if the settings were aknowledged properly, else %FALSE + + + + + a #GESPipeline + + + + the URI to which the timeline will be rendered + + + + the #GstEncodingProfile to use to render the timeline. + + + + + + Sets the timeline to use in this pipeline. + +The reference to the @timeline will be stolen by the @pipeline. + + %TRUE if the @timeline could be successfully set on the @pipeline, +else %FALSE. + + + + + a #GESPipeline + + + + the #GESTimeline to set on the @pipeline. + + + + + + + + + Audio sink for the preview. + + + + Pipeline mode. See ges_pipeline_set_mode() for more +info. + + + + Timeline to use in this pipeline. See also +ges_pipeline_set_timeline() for more info. + + + + + + + Video sink for the preview. + + + + + + + + + + + + + + + + + parent class + + + + + + + + + + The various modes the #GESPipeline can be configured to. + + output audio to the soundcard + + + output video to the screen + + + output audio/video to soundcard/screen (default) + + + render timeline (forces decoding) + + + render timeline (tries to avoid decoding/reencoding) + + + + + + This is a legacy format and you should avoid to use it. The formatter +is really not in good shape and is deprecated. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The #GESProject is used to control a set of #GESAsset and is a +#GESAsset with #GES_TYPE_TIMELINE as @extractable_type itself. That +means that you can extract #GESTimeline from a project as followed: + +|[ + GESProject *project; + GESTimeline *timeline; + + project = ges_project_new ("file:///path/to/a/valid/project/uri"); + + // Here you can connect to the various signal to get more infos about + // what is happening and recover from errors if possible + ... + + timeline = ges_asset_extract (GES_ASSET (project)); +]| + +The #GESProject class offers a higher level API to handle #GESAsset-s. +It lets you request new asset, and it informs you about new assets through +a set of signals. Also it handles problem such as missing files/missing +#GstElement and lets you try to recover from those. + + + + + Creates a new #GESProject and sets its uri to @uri if provided. Note that +if @uri is not valid or %NULL, the uri of the project will then be set +the first time you save the project. If you then save the project to +other locations, it will never be updated again and the first valid URI is +the URI it will keep refering to. + + A newly created #GESProject + + + + + The uri to be set after creating the project. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Adds a #Asset to @project, the project will keep a reference on +@asset. + + %TRUE if the asset could be added %FALSE it was already +in the project + + + + + A #GESProject + + + + A #GESAsset to add to @project + + + + + + 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. + + %TRUE if @profile could be added, %FALSE otherwize + + + + + A #GESProject + + + + A #GstEncodingProfile to add to the project. If a profile with +the same name already exists, it will be replaced + + + + + + Create and add a #GESAsset to @project. You should connect to the +"asset-added" signal to get the asset when it finally gets added to +@project + + %TRUE if the asset started to be added %FALSE it was already +in the project + + + + + A #GESProject + + + + The id of the asset to create and add to @project + + + + The #GType of the asset to create + + + + + + Create and add a #GESAsset to @project. You should connect to the +"asset-added" signal to get the asset when it finally gets added to +@project + + The newly created #GESAsset or %NULL. + + + + + A #GESProject + + + + The id of the asset to create and add to @project + + + + The #GType of the asset to create + + + + + + + The #GESAsset with +@id or %NULL if no asset with @id as an ID + + + + + A #GESProject + + + + The id of the asset to retrieve + + + + The extractable_type of the asset +to retrieve from @object + + + + + + Get the assets that are being loaded + + A set of loading asset +that will be added to @project. Note that those Asset are *not* loaded yet, +and thus can not be used + + + + + + + A #GESProject + + + + + + Retrieve the uri that is currently set on @project + + a newly allocated string representing uri. + + + + + A #GESProject + + + + + + List all @asset contained in @project filtering per extractable_type +as defined by @filter. It copies the asset and thus will not be updated +in time. + + The list of +#GESAsset the object contains + + + + + + + A #GESProject + + + + Type of assets to list, #GES_TYPE_EXTRACTABLE will list +all assets + + + + + + Lists the encoding profile that have been set to @project. The first one +is the latest added. + + The +list of #GstEncodingProfile used in @project + + + + + + + A #GESProject + + + + + + Loads @project into @timeline + + %TRUE if the project could be loaded %FALSE otherwize. + + + + + A #GESProject that has an @uri set already + + + + A blank timeline to load @project into + + + + + + remove a @asset to from @project. + + %TRUE if the asset could be removed %FALSE otherwise + + + + + A #GESProject + + + + A #GESAsset to remove from @project + + + + + + Save the timeline of @project to @uri. You should make sure that @timeline +is one of the timelines that have been extracted from @project +(using ges_asset_extract (@project);) + + %TRUE if the project could be save, %FALSE otherwize + + + + + A #GESProject to save + + + + The #GESTimeline to save, it must have been extracted from @project + + + + The uri where to save @project and @timeline + + + + The formatter asset to use or %NULL. If %NULL, +will try to save in the same format as the one from which the timeline as been loaded +or default to the formatter with highest rank + + + + %TRUE to overwrite file if it exists + + + + + + + + + + + + + + + + + + + + + + + + + The #GESAsset that has been added to @project + + + + + + + + + + + The #GESAsset that started loading + + + + + + + + + + + The #GESAsset that has been removed from @project + + + + + + Informs you that a #GESAsset could not be created. In case of +missing GStreamer plugins, the error will be set to #GST_CORE_ERROR +#GST_CORE_ERROR_MISSING_PLUGIN + + + + + + The #GError defining the error that accured, might be %NULL + + + + The @id of the asset that failed loading + + + + The @extractable_type of the asset that +failed loading + + + + + + + + + + + The #GESTimeline that complete loading + + + + + + |[ +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)); +} +]| + + The new URI of @wrong_asset + + + + + The error that happened + + + + The asset with the wrong ID, you should us it and its content +only to find out what the new location is. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base class for single-media sources + + + + + + + + + + + + + + + + + + + + + + + + + + Base class for sources of a #GESLayer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Useful for testing purposes. + +You can use the ges_asset_request_simple API to create an Asset +capable of extracting GESTestClip-s + + + + Creates a new #GESTestClip. + + The newly created #GESTestClip, +or %NULL if there was an error. + + + + + Creates a new #GESTestClip for the provided @nick. + + The newly created #GESTestClip, +or %NULL if there was an error. + + + + + the nickname for which to create the #GESTestClip + + + + + + Get the frequency @self generates. + + The frequency @self generates. See audiotestsrc element. + + + + + a #GESTestClip + + + + + + Get the volume of the test audio signal applied on @self. + + The volume of the test audio signal applied on @self. + + + + + a #GESTestClip + + + + + + Get the #GESVideoTestPattern which is applied on @self. + + The #GESVideoTestPattern which is applied on @self. + + + + + a #GESTestClip + + + + + + Let you know if the audio track of @self is muted or not. + + Whether the audio track of @self is muted or not. + + + + + a #GESTestClip + + + + + + Sets the frequency to generate. See audiotestsrc element. + + + + + + the #GESTestClip to set the frequency on + + + + the frequency you want to use on @self + + + + + + Sets whether the audio track of this clip is muted or not. + + + + + + the #GESTestClip on which to mute or unmute the audio track + + + + %TRUE to mute the audio track, %FALSE to unmute it + + + + + + Sets the volume of the test audio signal. + + + + + + the #GESTestClip to set the volume on + + + + the volume of the audio signal you want to use on @self + + + + + + Sets which video pattern to display on @self. + + + + + + the #GESTestClip to set the pattern on + + + + the #GESVideoTestPattern to use on @self + + + + + + The frequency to generate for audio track elements. + + + + Whether the sound will be played or not. + + + + The volume for the audio track elements. + + + + Video pattern to display in video track elements. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Horizontal alignment of the text. + + align text left + + + align text center + + + align text right + + + align text on xpos position + + + + + + + + + Creates a new #GESTextOverlay. + + The newly created #GESTextOverlay or +%NULL if something went wrong. + + + + + Get the color used by @source. + + The color used by @source. + + + + + a GESTextOverlay + + + + + + Get the pango font description currently set on @source. + + The pango font description currently set on @source. + + + + + a GESTextOverlay + + + + + + Get the horizontal aligment used by @source. + + The horizontal aligment used by @source. + + + + + a GESTextOverlay + + + + + + Get the text currently set on @source. + + The text currently set on @source. + + + + + a GESTextOverlay + + + + + + Get the vertical aligment used by @source. + + The vertical aligment used by @source. + + + + + a GESTextOverlay + + + + + + Get the horizontal position used by @source. + + The horizontal position used by @source. + + + + + a GESTextOverlay + + + + + + Get the vertical position used by @source. + + The vertical position used by @source. + + + + + a GESTextOverlay + + + + + + Sets the color of the text. + + + + + + the #GESTextOverlay* to set + + + + The color @self is being set to + + + + + + Sets the pango font description of the text this track element +will render. + + + + + + the #GESTextOverlay + + + + the pango font description + + + + + + Sets the horizontal aligment of the text. + + + + + + the #GESTextOverlay* to set text on + + + + The #GESTextHAlign defining the horizontal alignment +of the text render by @self. + + + + + + Sets the text this track element will render. + + + + + + the #GESTextOverlay* to set text on + + + + the text to render. an internal copy of this text will be +made. + + + + + + Sets the vertical aligment of the text. + + + + + + the #GESTextOverlay* to set text on + + + + The #GESTextVAlign defining the vertical alignment +of the text render by @self. + + + + + + Sets the horizontal position of the text. + + + + + + the #GESTextOverlay* to set + + + + The horizontal position @self is being set to + + + + + + Sets the vertical position of the text. + + + + + + the #GESTextOverlay* to set + + + + The vertical position @self is being set to + + + + + + + + + + + + + + + + + + + + + + + + + + + + Renders text onto the next lower priority stream using textrender. + + + + Creates a new #GESTextOverlayClip + + The newly created +#GESTextOverlayClip, or %NULL if there was an error. + + + + + Get the color used by @source. + + The color used by @source. + + + + + a #GESTextOverlayClip + + + + + + Get the pango font description used by @self. + + The pango font description used by @self. + + + + + a #GESTextOverlayClip + + + + + + Get the horizontal aligment used by @self. + + The horizontal aligment used by @self. + + + + + a #GESTextOverlayClip + + + + + + Get the text currently set on @self. + + The text currently set on @self. + + + + + a #GESTextOverlayClip + + + + + + Get the vertical aligment used by @self. + + The vertical aligment used by @self. + + + + + a #GESTextOverlayClip + + + + + + Get the horizontal position used by @source. + + The horizontal position used by @source. + + + + + a #GESTextOverlayClip + + + + + + Get the vertical position used by @source. + + The vertical position used by @source. + + + + + a #GESTextOverlayClip + + + + + + Sets the color of the text. + + + + + + the #GESTextOverlayClip* to set + + + + The color @self is being set to + + + + + + Sets the pango font description of the text + + + + + + the #GESTextOverlayClip* + + + + the pango font description + + + + + + Sets the horizontal aligment of the text. + + + + + + the #GESTextOverlayClip* to set horizontal alignement of text on + + + + #GESTextHAlign + + + + + + Sets the text this clip will render. + + + + + + the #GESTextOverlayClip* to set text on + + + + the text to render. an internal copy of this text will be +made. + + + + + + Sets the vertical aligment of the text. + + + + + + the #GESTextOverlayClip* to set vertical alignement of text on + + + + #GESTextVAlign + + + + + + Sets the horizontal position of the text. + + + + + + the #GESTextOverlayClip* to set + + + + The horizontal position @self is being set to + + + + + + Sets the vertical position of the text. + + + + + + the #GESTextOverlayClip* to set + + + + The vertical position @self is being set to + + + + + + The color of the text + + + + Pango font description string + + + + Horizontal alignment of the text + + + + The text to diplay + + + + Vertical alignent of the text + + + + The horizontal position of the text + + + + The vertical position of the text + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Vertical alignment of the text. + + draw text on the baseline + + + draw text on the bottom + + + draw text on top + + + draw text on ypos position + + + draw text on the center + + + + + + #GESTimeline is the central object for any multimedia timeline. + +Contains a list of #GESLayer which users should use to arrange the +various clips through time. + +The output type is determined by the #GESTrack that are set on +the #GESTimeline. + +To save/load a timeline, you can use the ges_timeline_load_from_uri() and +ges_timeline_save_to_uri() methods to use the default format. If you wish + +Note that any change you make in the timeline will not actually be taken +into account until you call the #ges_timeline_commit method. + + + + + Creates a new empty #GESTimeline. + + The new timeline. + + + + + Creates a new #GESTimeline containing a raw audio and a +raw video track. + + The newly created #GESTimeline. + + + + + Creates a timeline from the given URI. + + A new timeline if the uri was loaded +successfully, or %NULL if the uri could not be loaded. + + + + + the URI to load from + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add the layer to the timeline. The reference to the @layer will be stolen +by the @timeline. + + %TRUE if the layer was properly added, else %FALSE. + + + + + a #GESTimeline + + + + the #GESLayer to add + + + + + + Add a track to the timeline. The reference to the track will be stolen by the +pipeline. + + %TRUE if the track was properly added, else %FALSE. + + + + + a #GESTimeline + + + + the #GESTrack to add + + + + + + Append a newly created #GESLayer to @timeline +Note that you do not own any reference to the returned layer. + + The newly created #GESLayer, or the last (empty) +#GESLayer of @timeline. + + + + + a #GESTimeline + + + + + + Commit all the pending changes of the clips contained in the +@timeline. + +When changes happen in a timeline, they are not +directly executed in the non-linear engine. Call this method once you are +done with a set of changes and want it to be executed. + +The #GESTimeline::commited signal will be emitted when the (possibly updated) +#GstPipeline is ready to output data again, except if the state of the +timeline was #GST_STATE_READY or #GST_STATE_NULL. + +Note that all the pending changes will automatically be executed when the +timeline goes from #GST_STATE_READY to #GST_STATE_PAUSED, which usually is +triggered by corresponding state changes in a containing #GESPipeline. + +You should not try to change the state of the timeline, seek it or add +tracks to it during a commit operation, that is between a call to this +function and after receiving the #GESTimeline::commited signal. + +See #ges_timeline_commit_sync if you don't want to bother with waiting +for the signal. + + %TRUE if pending changes were commited or %FALSE if nothing needed +to be commited + + + + + a #GESTimeline + + + + + + Commit all the pending changes of the #GESClips contained in the +@timeline. + +Will return once the update is complete, that is when the +(possibly updated) #GstPipeline is ready to output data again, or if the +state of the timeline was #GST_STATE_READY or #GST_STATE_NULL. + +This function will wait for any pending state change of the timeline by +calling #gst_element_get_state with a #GST_CLOCK_TIME_NONE timeout, you +should not try to change the state from another thread before this function +has returned. + +See #ges_timeline_commit for more information. + + %TRUE if pending changes were commited or %FALSE if nothing needed +to be commited + + + + + a #GESTimeline + + + + + + Gets whether transitions are automatically added when objects +overlap or not. + + %TRUE if transitions are automatically added, else %FALSE. + + + + + a #GESTimeline + + + + + + Get the current duration of @timeline + + The current duration of @timeline + + + + + a #GESTimeline + + + + + + Gets a #GESTimelineElement contained in the timeline + + The #GESTimelineElement or %NULL if +not found. + + + + + a #GESTimeline + + + + + + + + + Get the list of #GESGroup present in the Timeline. + + the list of +#GESGroup that contain clips present in the timeline's layers. +Must not be changed. + + + + + + + a #GESTimeline + + + + + + Retrieve the layer with @priority as a priority + + A #GESLayer or %NULL if no layer with +@priority was found + +Since 1.6 + + + + + The #GESTimeline to retrive a layer from + + + + The priority of the layer to find + + + + + + Get the list of #GESLayer present in the Timeline. + + the list of +#GESLayer present in the Timeline sorted by priority. +The caller should unref each Layer once he is done with them. + + + + + + + a #GESTimeline + + + + + + Search the #GstPad corresponding to the given @timeline's @track. + + The corresponding #GstPad if it is +found, or %NULL if there is an error. + + + + + The #GESTimeline + + + + The #GESTrack + + + + + + Gets the configured snapping distance of the timeline. See +the documentation of the property snapping_distance for more +information. + + The @snapping_distance property of the timeline + + + + + a #GESTimeline + + + + + + Search the #GESTrack corresponding to the given @timeline's @pad. + + The corresponding #GESTrack if it is +found, or %NULL if there is an error. + + + + + The #GESTimeline + + + + The #GstPad + + + + + + Returns the list of #GESTrack used by the Timeline. + + A list of #GESTrack. +The caller should unref each track once he is done with them. + + + + + + + a #GESTimeline + + + + + + Check whether a #GESTimeline is empty or not + + %TRUE if the timeline is empty %FALSE otherwize + + + + + a #GESTimeline + + + + + + Loads the contents of URI into the given timeline. + + %TRUE if the timeline was loaded successfully, or %FALSE if the uri +could not be loaded. + + + + + an empty #GESTimeline into which to load the formatter + + + + The URI to load from + + + + + + Moves @layer at @new_layer_priority meaning that @layer +we land at that position in the stack of layers inside +the timeline. If @new_layer_priority is superior than the number +of layers present in the time, it will move to the end of the +stack of layers. + + + + + + The timeline in which @layer must be + + + + The layer to move at @new_layer_priority + + + + The index at which @layer should land + + + + + + Paste @element inside the timeline. @element must have been +created using ges_timeline_element_copy with deep=TRUE set, +i.e. it must be a deep copy, otherwise it will fail. + + Shallow copy of the @element pasted + + + + + The #GESTimeline onto which the #GESTimelineElement should be pasted + + + + The #GESTimelineElement to paste + + + + The position in the timeline the element should +be pasted to, meaning it will become the start of @element + + + + The #GESLayer to which the element should be pasted to. +-1 means paste to the same layer from which the @element has been copied from. + + + + + + Removes the layer from the timeline. The reference that the @timeline holds on +the layer will be dropped. If you wish to use the @layer after calling this +method, you need to take a reference before calling. + + %TRUE if the layer was properly removed, else %FALSE. + + + + + a #GESTimeline + + + + the #GESLayer to remove + + + + + + Remove the @track from the @timeline. The reference stolen when adding the +@track will be removed. If you wish to use the @track after calling this +function you must ensure that you have a reference to it. + + %TRUE if the @track was properly removed, else %FALSE. + + + + + a #GESTimeline + + + + the #GESTrack to remove + + + + + + Saves the timeline to the given location + + %TRUE if the timeline was successfully saved to the given location, +else %FALSE. + + + + + a #GESTimeline + + + + The location to save to + + + + The formatter asset to use or %NULL. If %NULL, +will try to save in the same format as the one from which the timeline as been loaded +or default to the formatter with highest rank + + + + %TRUE to overwrite file if it exists + + + + + + Sets the layer to the given @auto_transition. See the documentation of the +property auto_transition for more information. + + + + + + a #GESLayer + + + + whether the auto_transition is active + + + + + + Sets the @snapping_distance of the timeline. See the documentation of the +property snapping_distance for more information. + + + + + + a #GESLayer + + + + whether the snapping_distance is active + + + + + + Sets whether transitions are added automagically when clips overlap. + + + + Current duration (in nanoseconds) of the #GESTimeline + + + + Distance (in nanoseconds) from which a moving object will snap +with it neighboors. 0 means no snapping. + + + + + + + A list of #GESLayer sorted by priority NOTE: Do not modify. + + + + + + A list of #GESTrack sorted by priority NOTE: Do not modify. + + + + + + + + + + + + + + This signal will be emitted once the changes initiated by #ges_timeline_commit +have been executed in the backend. Use #ges_timeline_commit_sync if you +don't need to do anything in the meantime. + + + + + + Will be emitted after a new group is added to to the timeline. + + + + + + the #GESGroup + + + + + + Will be emitted after a group has been removed from the timeline. + + + + + + the #GESGroup + + + + a list of #GESContainer + + + + + + + + Will be emitted after a new layer is added to the timeline. + + + + + + the #GESLayer that was added to the timeline + + + + + + Will be emitted after the layer was removed from the timeline. + + + + + + the #GESLayer that was removed from the timeline + + + + + + + a #GPtrArray of #GESTrack-s where that object should be added + + + + + + + The #GESClip on which @track_element will land + + + + The #GESTrackElement for which to choose the tracks it should land into + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Will be emitted after the track was added to the timeline. + + + + + + the #GESTrack that was added to the timeline + + + + + + Will be emitted after the track was removed from the timeline. + + + + + + the #GESTrack that was removed from the timeline + + + + + + + + parent class + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The GESTimelineElement base class implements the notion of timing as well +as priority. A GESTimelineElement can have a parent object which will be +responsible for controlling its timing properties. + + + + + + + + + + + + + + + + + Gets all the TrackTypes @self will interact with + + + + + + A #GESTimelineElement + + + + + + + + + + + + + + + + + + + Looks up which @element and @pspec would be effected by the given @name. If various +contained elements have this property name you will get the first one, unless you +specify the class name in @name. + + TRUE if @element and @pspec could be found. FALSE otherwise. In that +case the values for @pspec and @element are not modified. Unref @element after +usage. + + + + + object to lookup the property in + + + + name of the property to look up. You can specify the name of the + class as such: "ClassName::property-name", to guarantee that you get the + proper GParamSpec in case various GstElement-s contain the same property + name. If you don't do so, you will get the first element found, having + this property and the and the corresponding GParamSpec. + + + + pointer to a #GstElement that + takes the real object to set property on + + + + pointer to take the #GParamSpec + describing the property + + + + + + + + + + + + + + + + + + + + + + Edits @self in ripple mode. It allows you to modify the +start of @self and move the following neighbours accordingly. +This will change the overall timeline duration. + + %TRUE if the self as been rippled properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to ripple. + + + + The new start of @self in ripple mode. + + + + + + Edits @self in ripple mode. It allows you to modify the +duration of a @self and move the following neighbours accordingly. +This will change the overall timeline duration. + + %TRUE if the self as been rippled properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to ripple. + + + + The new end (start + duration) of @self in ripple mode. It will + basically only change the duration of @self. + + + + + + Edits @self in roll mode. It allows you to modify the +duration of a @self and trim (basicly change the start + inpoint +in this case) the following neighbours accordingly. +This will not change the overall timeline duration. + + %TRUE if the self as been rolled properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to roll. + + + + The new end (start + duration) of @self in roll mode + + + + + + Edits @self in roll mode. It allows you to modify the +start and inpoint of a @self and "resize" (basicly change the duration +in this case) of the previous neighbours accordingly. +This will not change the overall timeline duration. + + %TRUE if the self as been roll properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to roll + + + + The new start of @self in roll mode, it will also adapat +the in-point of @self according + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the parent of @self to @parent. The parents needs to already +own a hard reference on @self. + + %TRUE if @parent could be set or %FALSE when @self +already had a parent or @self and @parent are the same. + + + + + a #GESTimelineElement + + + + new parent of self + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Edits @self in trim mode. It allows you to modify the +inpoint and start of @self. +This will not change the overall timeline duration. + +Note that to trim the end of an self you can just set its duration. The same way +as this method, it will take into account the snapping-distance property of the +timeline in which @self is. + + %TRUE if the self as been trimmed properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to trim. + + + + The new start of @self in trim mode, will adapt the inpoint +of @self accordingly + + + + + + + + + + + + + + + + + + + + + + Copies @self + + The newly create #GESTimelineElement, copied from @self + + + + + The #GESTimelineElement to copy + + + + whether we want to create the elements @self contains or not + + + + + + Gets properties of a child of @self. + + + + + + The origin #GESTimelineElement + + + + The name of the first property to get + + + + return location for the first property, followed optionally by more +name/return location pairs, followed by NULL + + + + + + In general, a copy is made of the property contents and +the caller is responsible for freeing the memory by calling +g_value_unset(). + +Gets a property of a GstElement contained in @object. + +Note that #ges_timeline_element_get_child_property is really +intended for language bindings, #ges_timeline_element_get_child_properties +is much more convenient for C programming. + + %TRUE if the property was found, %FALSE otherwize + + + + + The origin #GESTimelineElement + + + + The name of the property + + + + return location for the property value, it will +be initialized if it is initialized with 0 + + + + + + Gets a property of a child of @self. + + + + + + a #GESTrackElement + + + + The #GParamSpec that specifies the property you want to get + + + + return location for the value + + + + + + Gets a property of a child of @self. If there are various child elements +that have the same property name, you can distinguish them using the following +syntax: 'ClasseName::property_name' as property name. If you don't, the +corresponding property of the first element found will be set. + + + + + + The #GESTimelineElement parent object + + + + The name of the first property to get + + + + value for the first property, followed optionally by more +name/return location pairs, followed by NULL + + + + + + + The @duration of @self + + + + + a #GESTimelineElement + + + + + + + The @inpoint of @self + + + + + a #GESTimelineElement + + + + + + + The @maxduration of @self + + + + + a #GESTimelineElement + + + + + + Returns a copy of the name of @self. +Caller should g_free() the return value after usage. + + The name of @self + + + + + a #GESTimelineElement + + + + + + Returns the parent of @self. This function increases the refcount +of the parent object so you should gst_object_unref() it after usage. + + parent of @self, this can be %NULL if +@self has no parent. unref after usage. + + + + + a #GESTimelineElement + + + + + + + The @priority of @self + + + + + a #GESTimelineElement + + + + + + + The @start of @self + + + + + a #GESTimelineElement + + + + + + Returns the timeline of @self. This function increases the refcount +of the timeline so you should gst_object_unref() it after usage. + + timeline of @self, this can be %NULL if +@self has no timeline. unref after usage. + + + + + a #GESTimelineElement + + + + + + Gets the toplevel #GESTimelineElement controlling @self + + The toplevel controlling parent of @self + + + + + The #GESTimelineElement to get the toplevel parent from + + + + + + Gets all the TrackTypes @self will interact with + + + + + + A #GESTimelineElement + + + + + + Gets an array of #GParamSpec* for all configurable properties of the +children of @self. + + an array of #GParamSpec* which should be freed after use or +%NULL if something went wrong + + + + + + + The #GESTimelineElement to get the list of children properties from + + + + return location for the length of the returned array + + + + + + Looks up which @element and @pspec would be effected by the given @name. If various +contained elements have this property name you will get the first one, unless you +specify the class name in @name. + + TRUE if @element and @pspec could be found. FALSE otherwise. In that +case the values for @pspec and @element are not modified. Unref @element after +usage. + + + + + object to lookup the property in + + + + name of the property to look up. You can specify the name of the + class as such: "ClassName::property-name", to guarantee that you get the + proper GParamSpec in case various GstElement-s contain the same property + name. If you don't do so, you will get the first element found, having + this property and the and the corresponding GParamSpec. + + + + pointer to a #GstElement that + takes the real object to set property on + + + + pointer to take the #GParamSpec + describing the property + + + + + + Paste @self inside the timeline. @self must have been created +using ges_timeline_element_copy with recurse=TRUE set, +otherwise it will fail. + + Paste @self copying the element + + + + + The #GESTimelineElement to paste + + + + The position in the timeline the element should +be copied to, meaning it will become the start of @self + + + + + + + + + + + + + + + + + + + Edits @self in ripple mode. It allows you to modify the +start of @self and move the following neighbours accordingly. +This will change the overall timeline duration. + + %TRUE if the self as been rippled properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to ripple. + + + + The new start of @self in ripple mode. + + + + + + Edits @self in ripple mode. It allows you to modify the +duration of a @self and move the following neighbours accordingly. +This will change the overall timeline duration. + + %TRUE if the self as been rippled properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to ripple. + + + + The new end (start + duration) of @self in ripple mode. It will + basically only change the duration of @self. + + + + + + Edits @self in roll mode. It allows you to modify the +duration of a @self and trim (basicly change the start + inpoint +in this case) the following neighbours accordingly. +This will not change the overall timeline duration. + + %TRUE if the self as been rolled properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to roll. + + + + The new end (start + duration) of @self in roll mode + + + + + + Edits @self in roll mode. It allows you to modify the +start and inpoint of a @self and "resize" (basicly change the duration +in this case) of the previous neighbours accordingly. +This will not change the overall timeline duration. + + %TRUE if the self as been roll properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to roll + + + + The new start of @self in roll mode, it will also adapat +the in-point of @self according + + + + + + Sets a property of a child of @self. If there are various child elements +that have the same property name, you can distinguish them using the following +syntax: 'ClasseName::property_name' as property name. If you don't, the +corresponding property of the first element found will be set. + + + + + + The #GESTimelineElement parent object + + + + The name of the first property to set + + + + value for the first property, followed optionally by more +name/return location pairs, followed by NULL + + + + + + Sets a property of a child of @self + +Note that #ges_timeline_element_set_child_property is really +intended for language bindings, #ges_timeline_element_set_child_properties +is much more convenient for C programming. + + %TRUE if the property was set, %FALSE otherwize + + + + + The origin #GESTimelineElement + + + + The name of the property + + + + the value + + + + + + Sets a property of a child of @self. + + + + + + a #GESTimelineElement + + + + The #GParamSpec that specifies the property you want to set + + + + the value + + + + + + Sets a property of a child of @self. If there are various child elements +that have the same property name, you can distinguish them using the following +syntax: 'ClasseName::property_name' as property name. If you don't, the +corresponding property of the first element found will be set. + + + + + + The #GESTimelineElement parent object + + + + The name of the first property to set + + + + value for the first property, followed optionally by more +name/return location pairs, followed by NULL + + + + + + Set the duration of the object + +Note that if the timeline snap-distance property of the timeline containing +@self is set, @self will properly snap to its neighboors. + + + + + + a #GESTimelineElement + + + + the duration in #GstClockTime + + + + + + Set the in-point, that is the moment at which the @self will start +outputting data from its contents. + + + + + + a #GESTimelineElement + + + + the in-point in #GstClockTime + + + + + + Set the maximun duration of the object + + + + + + a #GESTimelineElement + + + + the maximum duration in #GstClockTime + + + + + + Sets the name of object, or gives @self a guaranteed unique name (if name is NULL). +This function makes a copy of the provided name, so the caller retains ownership +of the name it sent. + + + + + + a #GESTimelineElement + + + + The name @self should take (if avalaible<) + + + + + + Sets the parent of @self to @parent. The parents needs to already +own a hard reference on @self. + + %TRUE if @parent could be set or %FALSE when @self +already had a parent or @self and @parent are the same. + + + + + a #GESTimelineElement + + + + new parent of self + + + + + + Sets the priority of the object within the containing layer + All priority management is done by GES itself now. +To set #GESEffect priorities #ges_clip_set_top_effect_index should +be used. + + + + + + a #GESTimelineElement + + + + the priority + + + + + + Set the position of the object in its containing layer. + +Note that if the snapping-distance property of the timeline containing +@self is set, @self will properly snap to the edges around @start. + + + + + + a #GESTimelineElement + + + + the position in #GstClockTime + + + + + + Sets the timeline of @self to @timeline. + + %TRUE if @timeline could be set or %FALSE when @timeline +already had a timeline. + + + + + a #GESTimelineElement + + + + The #GESTimeline @self is in + + + + + + Edits @self in trim mode. It allows you to modify the +inpoint and start of @self. +This will not change the overall timeline duration. + +Note that to trim the end of an self you can just set its duration. The same way +as this method, it will take into account the snapping-distance property of the +timeline in which @self is. + + %TRUE if the self as been trimmed properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to trim. + + + + The new start of @self in trim mode, will adapt the inpoint +of @self accordingly + + + + + + The duration (in nanoseconds) which will be used in the container + + + + The in-point at which this #GESTimelineElement will start outputting data +from its contents (in nanoseconds). + +Ex : an in-point of 5 seconds means that the first outputted buffer will +be the one located 5 seconds in the controlled resource. + + + + The maximum duration (in nanoseconds) of the #GESTimelineElement. + + + + The name of the object + + + + The parent container of the object + + + + The priority of the object. + +Setting GESTimelineElement priorities is deprecated +as all priority management is done by GES itself now. + + + + Whether the element should be serialized. + + + + The position of the object in its container (in nanoseconds). + + + + The timeline in which @element is + + + + + + + The #GESTimelineElement that controls the object + + + + The #GESAsset from which the object has been extracted + + + + position (in time) of the object + + + + Position in the media from which the object should be used + + + + duration of the object to be used + + + + The maximum duration the object can have + + + + priority of the object in the layer (0:top priority) + + + + + + + + + + + + + + + + + + The deep notify signal is used to be notified of property changes of all +the childs of @timeline_element + + + + + + the object that originated the signal + + + + the property that changed + + + + + + + The GESTimelineElement base class. Subclasses should override at least +@set_start @set_inpoint @set_duration @ripple @ripple_end @roll_start +@roll_end and @trim. + +Vmethods in subclasses should apply all the operation they need to but +the real method implementation is in charge of setting the proper field, +and emit the notify signal. + + + + + + + %TRUE if @parent could be set or %FALSE when @self +already had a parent or @self and @parent are the same. + + + + + a #GESTimelineElement + + + + new parent of self + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %TRUE if the self as been rippled properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to ripple. + + + + The new start of @self in ripple mode. + + + + + + + + + %TRUE if the self as been rippled properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to ripple. + + + + The new end (start + duration) of @self in ripple mode. It will + basically only change the duration of @self. + + + + + + + + + %TRUE if the self as been roll properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to roll + + + + The new start of @self in roll mode, it will also adapat +the in-point of @self according + + + + + + + + + %TRUE if the self as been rolled properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to roll. + + + + The new end (start + duration) of @self in roll mode + + + + + + + + + %TRUE if the self as been trimmed properly, %FALSE if an error +occured + + + + + The #GESTimelineElement to trim. + + + + The new start of @self in trim mode, will adapt the inpoint +of @self accordingly + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TRUE if @element and @pspec could be found. FALSE otherwise. In that +case the values for @pspec and @element are not modified. Unref @element after +usage. + + + + + object to lookup the property in + + + + name of the property to look up. You can specify the name of the + class as such: "ClassName::property-name", to guarantee that you get the + proper GParamSpec in case various GstElement-s contain the same property + name. If you don't do so, you will get the first element found, having + this property and the and the corresponding GParamSpec. + + + + pointer to a #GstElement that + takes the real object to set property on + + + + pointer to take the #GParamSpec + describing the property + + + + + + + + + + + + + A #GESTimelineElement + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Renders the given text in the specified font, at specified position, and +with the specified background pattern. + + + + Creates a new #GESTitleClip + + The newly created #GESTitleClip, +or %NULL if there was an error. + + + + + Get the background used by @self. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + The color used by @self. + + + + + a #GESTitleClip + + + + + + Get the pango font description used by @self. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + The pango font description used by @self. + + + + + a #GESTitleClip + + + + + + Get the horizontal aligment used by @self. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + The horizontal aligment used by @self. + + + + + a #GESTitleClip + + + + + + Get the text currently set on @self. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + The text currently set on @self. + + + + + a #GESTitleClip + + + + + + Get the color used by @self. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + The color used by @self. + + + + + a #GESTitleClip + + + + + + Get the vertical aligment used by @self. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + The vertical aligment used by @self. + + + + + a #GESTitleClip + + + + + + Get the horizontal position used by @self. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + The horizontal position used by @self. + + + + + a #GESTitleClip + + + + + + Get the vertical position used by @self. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + The vertical position used by @self. + + + + + a #GESTitleClip + + + + + + Sets the background of the text. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + + + the #GESTitleClip* to set + + + + The color @self is being set to + + + + + + Sets the color of the text. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + + + the #GESTitleClip* to set + + + + The color @self is being set to + + + + + + Sets the pango font description of the text. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + + + the #GESTitleClip* + + + + the pango font description + + + + + + Sets the horizontal aligment of the text. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + + + the #GESTitleClip* to set horizontal alignement of text on + + + + #GESTextHAlign + + + + + + Sets the text this clip will render. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + + + the #GESTitleClip* to set text on + + + + the text to render. an internal copy of this text will be +made. + + + + + + Sets the vertical aligment of the text. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + + + the #GESTitleClip* to set vertical alignement of text on + + + + #GESTextVAlign + + + + + + Sets the horizontal position of the text. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + + + the #GESTitleClip* to set + + + + The horizontal position @self is being set to + + + + + + Sets the vertical position of the text. + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + + + the #GESTitleClip* to set + + + + The vertical position @self is being set to + + + + + + The background of the text + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + The color of the text + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + Pango font description string + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + Horizontal alignment of the text + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + The text to diplay + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + Vertical alignent of the text + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + The horizontal position of the text + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + The vertical position of the text + use ges_track_element_get/set_children_properties on the +underlying GESTrackElement instead + + + + + + + + + + + + + + + + + + + + + + + + + + + + #GESTitleSource is a GESTimelineElement that implements the notion +of titles in GES. + +## Children Properties + +You can use the following children properties through the +#ges_track_element_set_child_property and alike set of methods: +<informaltable frame="none"> +<tgroup cols="3"> +<colspec colname="properties_type" colwidth="150px"/> +<colspec colname="properties_name" colwidth="200px"/> +<colspec colname="properties_flags" colwidth="400px"/> +<tbody> +<row> + <entry role="property_type"><link linkend="guint"><type>guint</type></link></entry> + <entry role="property_name"><link linkend="GESTileSource--background">background</link></entry> + <entry>The color of the background</entry> +</row> +<row> + <entry role="property_type"><link linkend="guint"><type>guint</type></link></entry> + <entry role="property_name"><link linkend="GESTileSource--color">color</link></entry> + <entry>The color of the text</entry> +</row> +<row> + <entry role="property_type"><link linkend="gchar"><type>gchar</type></link></entry> + <entry role="property_name"><link linkend="GESTileSource--font-desc">font-desc</link></entry> + <entry>Pango font description string</entry> +</row> +<row> + <entry role="property_type"><link linkend="GESTextHAlign"><type>GESTextHAlign</type></link></entry> + <entry role="property_name"><link linkend="GESTileSource--halignment">halignment</link></entry> + <entry>Horizontal alignment of the text</entry> +</row> +<row> + <entry role="property_type"><link linkend="gchar"><type>gchar</type></link></entry> + <entry role="property_name"><link linkend="GESTileSource--text">text</link></entry> + <entry>The text to be rendered</entry> +</row> +<row> + <entry role="property_type"><link linkend="GESTextVAlign"><type>GESTextVAlign</type></link> + </entry><entry role="property_name"><link linkend="GESTileSource--valignment">valignment</link> + </entry><entry>Vertical alignent of the text</entry> +</row> +<row> + <entry role="property_type"><link linkend="gdouble"><type>gdouble</type></link></entry> + <entry role="property_name"><link linkend="GESTileSource--xpos">xpos</link></entry> + <entry>The horizontal position of the text</entry> +</row> +<row><entry role="property_type"><link linkend="gdouble"><type>gdouble</type></link></entry> + <entry role="property_name"><link linkend="GESTileSource--ypos">ypos</link></entry> + <entry>The vertical position of the text</entry> +</row> +<row><entry role="property_type"><link linkend="gboolean"><type>gboolean</type></link></entry> + <entry role="property_name"><link linkend="GESTileSource--shaded-background">shaded-background</link></entry> + <entry>Whether to shade the background under the text area</entry> +</row> +<row><entry role="property_type"><link linkend="guint"><type>guint</type></link></entry> + <entry role="property_name"><link linkend="GESTileSource--outline-color">outline-color</link></entry> + <entry>Color to use for outline the text (big-endian ARGB).</entry> +</row> +</tbody> +</tgroup> +</informaltable> + + + + Get the background used by @source. + + The background used by @source. + + + + + a #GESTitleSource + + + + + + Get the pango font description used by @source. + + The pango font description used by this +@source. + + + + + a #GESTitleSource + + + + + + Get the horizontal aligment used by @source. + + The horizontal aligment used by @source. + + + + + a #GESTitleSource + + + + + + Get the text currently set on the @source. + + The text currently set on the @source. + + + + + a #GESTitleSource + + + + + + Get the color used by @source. + + The color used by @source. + + + + + a #GESTitleSource + + + + + + Get the vertical aligment used by @source. + + The vertical aligment used by @source. + + + + + a #GESTitleSource + + + + + + Get the horizontal position used by @source. + + The horizontal position used by @source. + + + + + a #GESTitleSource + + + + + + Get the vertical position used by @source. + + The vertical position used by @source. + + + + + a #GESTitleSource + + + + + + Sets the color of the background + + + + + + the #GESTitleSource* to set + + + + the color @self is being set to + + + + + + Set the pango font description this source will use to render +the text. + + + + + + the #GESTitleSource + + + + the pango font description + + + + + + Sets the vertical aligment of the text. + + + + + + the #GESTitleSource* to set text on + + + + #GESTextHAlign + + + + + + Sets the text this track element will render. + use ges_track_element_get/set_children_properties on the +GESTrackElement instead + + + + + + the #GESTitleSource* to set text on + + + + the text to render. an internal copy of this text will be +made. + + + + + + Sets the color of the text. + + + + + + the #GESTitleSource* to set + + + + the color @self is being set to + + + + + + Sets the vertical aligment of the text. + + + + + + the #GESTitleSource* to set text on + + + + #GESTextVAlign + + + + + + Sets the horizontal position of the text. + + + + + + the #GESTitleSource* to set + + + + the horizontal position @self is being set to + + + + + + Sets the vertical position of the text. + + + + + + the #GESTitleSource* to set + + + + the color @self is being set to + + + + + + + + + + + + + + + + + + + parent class + + + + + + + + + + + + Corresponds to one output format (i.e. audio OR video). + +Contains the compatible TrackElement(s). + + + + Creates a new #GESTrack with the given @type and @caps. + +The newly created track will steal a reference to the caps. If you wish to +use those caps elsewhere, you will have to take an extra reference. + + A new #GESTrack. + + + + + The type of track + + + + The caps to restrict the output of the track to. + + + + + + + + + + + + + + + + Adds the given object to the track. Sets the object's controlling track, +and thus takes ownership of the @object. + +An object can only be added to one track. + + #TRUE if the object was properly added. #FALSE if the track does not +want to accept the object. + + + + + a #GESTrack + + + + the #GESTrackElement to add + + + + + + Commits all the pending changes of the TrackElement contained in the +track. + +When timing changes happen in a timeline, the changes are not +directly done inside NLE. This method needs to be called so any changes +on a clip contained in the timeline actually happen at the media +processing level. + + %TRUE if something as been commited %FALSE if nothing needed +to be commited + + + + + a #GESTrack + + + + + + Get the #GstCaps this track is configured to output. + + The #GstCaps this track is configured to output. + + + + + a #GESTrack + + + + + + Gets the #GESTrackElement contained in @track + + the list of +#GESTrackElement present in the Track sorted by priority and start. + + + + + + + a #GESTrack + + + + + + Gets if the underlying #NleComposition contains an expandable mixer. + + #True if there is a mixer, #False otherwise. + + + + + a #GESTrack + + + + + + Get the #GESTimeline this track belongs to. Can be %NULL. + + The #GESTimeline this track belongs to. Can be %NULL. + + + + + a #GESTrack + + + + + + Removes the object from the track and unparents it. +Unparenting it means the reference owned by @track on the @object will be +removed. If you wish to use the @object after this function, make sure you +call gst_object_ref() before removing it from the @track. + + #TRUE if the object was removed, else #FALSE if the track +could not remove the object (like if it didn't belong to the track). + + + + + a #GESTrack + + + + the #GESTrackElement to remove + + + + + + Sets the function that should be used to create the GstElement used to fill gaps. +To avoid to provide such a function we advice you to use the +#ges_audio_track_new and #ges_video_track_new constructor when possible. + + + + + + a #GESTrack + + + + The #GESCreateElementForGapFunc that will be used +to create #GstElement to fill gaps + + + + + + Sets if the #GESTrack should be mixing. + + + + + + a #GESTrack + + + + TRUE if the track should be mixing, FALSE otherwise. + + + + + + Sets the given @caps as the caps the track has to output. + + + + + + a #GESTrack + + + + the #GstCaps to set + + + + + + Sets @timeline as the timeline controlling @track. + + + + + + a #GESTrack + + + + a #GESTimeline + + + + + + Updates the restriction caps by modifying all the fields present in @caps +in the original restriction caps. If for example the current restriction caps +are video/x-raw, format=I420, width=360 and @caps is video/x-raw, format=RGB, +the restriction caps will be updated to video/x-raw, format=RGB, width=360. + +Modification happens for each structure in the new caps, and +one can add new fields or structures through that function. + + + + + + a #GESTrack + + + + the #GstCaps to update with + + + + + + Caps used to filter/choose the output stream. This is generally set to +a generic set of caps like 'video/x-raw' for raw video. + +Default value: #GST_CAPS_ANY. + + + + Current duration of the track + +Default value: O + + + + Whether layer mixing is activated or not on the track. + + + + Caps used to filter/choose the output stream. + +Default value: #GST_CAPS_ANY. + + + + Type of stream the track outputs. This is used when creating the #GESTrack +to specify in generic terms what type of content will be outputted. + +It also serves as a 'fast' way to check what type of data will be outputted +from the #GESTrack without having to actually check the #GESTrack's caps +property. + + + + + + + a #GESTrackType indicting the basic type of the track. + + + + + + + + + + + + + + + + + Will be emitted after a track element was added to the track. + + + + + + the #GESTrackElement that was added. + + + + + + Will be emitted after a track element was removed from the track. + + + + + + the #GESTrackElement that was removed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #GESTrackElement is the Base Class for any object that can be contained in a +#GESTrack. + +It contains the basic information as to the location of the object within +its container, like the start position, the inpoint, the duration and the +priority. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Looks up which @element and @pspec would be effected by the given @name. If various +contained elements have this property name you will get the first one, unless you +specify the class name in @name. + Use #ges_timeline_element_lookup_child + + TRUE if @element and @pspec could be found. FALSE otherwise. In that +case the values for @pspec and @element are not modified. Unref @element after +usage. + + + + + object to lookup the property in + + + + name of the property to look up. You can specify the name of the + class as such: "ClassName::property-name", to guarantee that you get the + proper GParamSpec in case various GstElement-s contain the same property + name. If you don't do so, you will get the first element found, having + this property and the and the corresponding GParamSpec. + + + + pointer to a #GstElement that + takes the real object to set property on + + + + pointer to take the #GParamSpec + describing the property + + + + + + Looks for the properties defines with the various parametters and add +them to the hashtable of children properties. + +To be used by subclasses only + + + + + + The #GESTrackElement to set chidlren props on + + + + The GstElement to retrieve properties from + + + + +An array of categories of GstElement to +take into account (as defined in the factory meta "klass" field) + + + + + + A +blacklist of elements factory names to not take into account + + + + + + A list +of propery names to add as children properties + + + + + + + + Edit @object in the different exisiting #GESEditMode modes. In the case of +slide, and roll, you need to specify a #GESEdge + + %TRUE if the object as been edited properly, %FALSE if an error +occured + + + + + the #GESTrackElement to edit + + + + The layers you want the edit to + happen in, %NULL means that the edition is done in all the + #GESLayers contained in the current timeline. + FIXME: This is not implemented yet. + + + + + + The #GESEditMode in which the edition will happen. + + + + The #GESEdge the edit should happen on. + + + + The position at which to edit @object (in nanosecond) + + + + + + + A +#GHashTable containing all property_name: GstControlBinding + + + + + + + + The #TrackElement from which to get all set bindings + + + + + + Gets properties of a child of @object. + Use #ges_timeline_element_get_child_properties + + + + + + The origin #GESTrackElement + + + + The name of the first property to get + + + + return location for the first property, followed optionally by more +name/return location pairs, followed by NULL + + + + + + In general, a copy is made of the property contents and +the caller is responsible for freeing the memory by calling +g_value_unset(). + +Gets a property of a GstElement contained in @object. + +Note that #ges_track_element_get_child_property is really +intended for language bindings, #ges_track_element_get_child_properties +is much more convenient for C programming. + Use #ges_timeline_element_get_child_property + + %TRUE if the property was found, %FALSE otherwize + + + + + The origin #GESTrackElement + + + + The name of the property + + + + return location for the property value, it will +be initialized if it is initialized with 0 + + + + + + Gets a property of a child of @object. + Use #ges_timeline_element_get_child_property_by_pspec + + + + + + a #GESTrackElement + + + + The #GParamSpec that specifies the property you want to get + + + + return location for the value + + + + + + Gets a property of a child of @object. If there are various child elements +that have the same property name, you can distinguish them using the following +syntax: 'ClasseName::property_name' as property name. If you don't, the +corresponding property of the first element found will be set. + Use #ges_timeline_element_get_child_property_valist + + + + + + The #GESTrackElement parent object + + + + The name of the first property to get + + + + value for the first property, followed optionally by more +name/return location pairs, followed by NULL + + + + + + Looks up the various controlled properties for that #GESTrackElement, +and returns the #GstControlBinding which controls @property_name. + + the #GstControlBinding associated with +@property_name, or %NULL if that property is not controlled. + + + + + the #GESTrackElement in which to lookup the bindings. + + + + The property_name to which the binding is associated. + + + + + + Get the #GstElement this track element is controlling within GNonLin. + + the #GstElement this track element is controlling +within GNonLin. + + + + + a #GESTrackElement + + + + + + Get the NleObject object this object is controlling. + use #ges_track_element_get_nleobject instead. + + the NleObject object this object is controlling. + + + + + a #GESTrackElement + + + + + + Get the GNonLin object this object is controlling. + + the GNonLin object this object is controlling. + + + + + a #GESTrackElement + + + + + + Get the #GESTrack to which this object belongs. + + The #GESTrack to which this object +belongs. Can be %NULL if it is not in any track + + + + + a #GESTrackElement + + + + + + + + + + + + + + + + Lets you know if @object will be used for playback and rendering, +or not. + + %TRUE if @object is active, %FALSE otherwize + + + + + a #GESTrackElement + + + + + + Gets an array of #GParamSpec* for all configurable properties of the +children of @object. + Use #ges_timeline_element_list_children_properties + + an array of #GParamSpec* which should be freed after use or +%NULL if something went wrong + + + + + + + The #GESTrackElement to get the list of children properties from + + + + return location for the length of the returned array + + + + + + Looks up which @element and @pspec would be effected by the given @name. If various +contained elements have this property name you will get the first one, unless you +specify the class name in @name. + Use #ges_timeline_element_lookup_child + + TRUE if @element and @pspec could be found. FALSE otherwise. In that +case the values for @pspec and @element are not modified. Unref @element after +usage. + + + + + object to lookup the property in + + + + name of the property to look up. You can specify the name of the + class as such: "ClassName::property-name", to guarantee that you get the + proper GParamSpec in case various GstElement-s contain the same property + name. If you don't do so, you will get the first element found, having + this property and the and the corresponding GParamSpec. + + + + pointer to a #GstElement that + takes the real object to set property on + + + + pointer to take the #GParamSpec + describing the property + + + + + + Removes a #GstControlBinding from @object. + + %TRUE if the binding could be removed, %FALSE if an error +occured + + + + + the #GESTrackElement on which to set a control binding + + + + The name of the property to control. + + + + + + Sets the usage of the @object. If @active is %TRUE, the object will be used for +playback and rendering, else it will be ignored. + + %TRUE if the property was toggled, else %FALSE + + + + + a #GESTrackElement + + + + visibility + + + + + + Sets a property of a child of @object. If there are various child elements +that have the same property name, you can distinguish them using the following +syntax: 'ClasseName::property_name' as property name. If you don't, the +corresponding property of the first element found will be set. + Use #ges_timeline_element_set_child_properties + + + + + + The #GESTrackElement parent object + + + + The name of the first property to set + + + + value for the first property, followed optionally by more +name/return location pairs, followed by NULL + + + + + + Sets a property of a GstElement contained in @object. + +Note that #ges_track_element_set_child_property is really +intended for language bindings, #ges_track_element_set_child_properties +is much more convenient for C programming. + use #ges_timeline_element_set_child_property instead + + %TRUE if the property was set, %FALSE otherwize + + + + + The origin #GESTrackElement + + + + The name of the property + + + + the value + + + + + + Sets a property of a child of @object. + Use #ges_timeline_element_set_child_property_by_spec + + + + + + a #GESTrackElement + + + + The #GParamSpec that specifies the property you want to set + + + + the value + + + + + + Sets a property of a child of @object. If there are various child elements +that have the same property name, you can distinguish them using the following +syntax: 'ClasseName::property_name' as property name. If you don't, the +corresponding property of the first element found will be set. + Use #ges_timeline_element_set_child_property_valist + + + + + + The #GESTrackElement parent object + + + + The name of the first property to set + + + + value for the first property, followed optionally by more +name/return location pairs, followed by NULL + + + + + + Creates a #GstControlBinding and adds it to the #GstElement concerned by the +property. Use the same syntax as #ges_track_element_lookup_child for +the property name. + + %TRUE if the binding could be created and added, %FALSE if an error +occured + + + + + the #GESTrackElement on which to set a control binding + + + + the #GstControlSource to set on the binding. + + + + The name of the property to control. + + + + The type of binding to create. Only "direct" is available for now. + + + + + + + + + + + + + + + + + + + Whether the object should be taken into account in the #GESTrack output. +If #FALSE, then its contents will not be used in the resulting track. + + + + + + + + + + + + + + + + + + + + + + + + + + + The control-binding-added signal is emitted each time a control binding +is added for a child property of @track_element + + + + + + the #GstControlBinding that has been added + + + + + + The control-binding-removed signal is emitted each time a control binding +is removed for a child property of @track_element + + + + + + the #GstControlBinding that has been removed + + + + + + + + + + + Get the GESAssetTrackType the #GESTrackElement extracted from @self +should get into + + a #GESTrackType + + + + + A #GESAssetObject + + + + + + Set the #GESAssetTrackType the #GESTrackElement extracted from @self +should get into + + + + + + A #GESAssetObject + + + + A #GESTrackType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Subclasses can override the @create_gnl_object method to override what type +of GNonLin object will be created. + + + + + name of the GNonLin GStElementFactory type to use. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TRUE if @element and @pspec could be found. FALSE otherwise. In that +case the values for @pspec and @element are not modified. Unref @element after +usage. + + + + + object to lookup the property in + + + + name of the property to look up. You can specify the name of the + class as such: "ClassName::property-name", to guarantee that you get the + proper GParamSpec in case various GstElement-s contain the same property + name. If you don't do so, you will get the first element found, having + this property and the and the corresponding GParamSpec. + + + + pointer to a #GstElement that + takes the real object to set property on + + + + pointer to take the #GParamSpec + describing the property + + + + + + + + + + + + + + + + + Types of content handled by a track. If the content is not one of +@GES_TRACK_TYPE_AUDIO, @GES_TRACK_TYPE_VIDEO or @GES_TRACK_TYPE_TEXT, +the user of the #GESTrack must set the type to @GES_TRACK_TYPE_CUSTOM. + +@GES_TRACK_TYPE_UNKNOWN is for internal purposes and should not be used +by users + + A track of unknown type (i.e. invalid) + + + An audio track + + + A video track + + + A text (subtitle) track + + + A custom-content track + + + + + + + + + + + + + + Base class for media transitions. + + + + + + + + + + + + + + + + + + + + + + + + + + Creates an object that mixes together the two underlying objects, A and B. +The A object is assumed to have a higher prioirity (lower number) than the +B object. At the transition in point, only A will be visible, and by the +end only B will be visible. + +The shape of the video transition depends on the value of the "vtype" +property. The default value is "crossfade". For audio, only "crossfade" is +supported. + +The ID of the ExtractableType is the nickname of the vtype property value. Note +that this value can be changed after creation and the GESExtractable.asset value +will be updated when needed. + + + + Creates a new #GESTransitionClip. + + a newly created #GESTransitionClip, +or %NULL if something went wrong. + + + + + the type of transition to create + + + + + + Creates a new #GESTransitionClip for the provided @nick. + + The newly created #GESTransitionClip, +or %NULL if something went wrong + + + + + a string representing the type of transition to create + + + + + + a #GESVideoStandardTransitionType representing the wipe to use + + + + + + + a #GESVideoStandardTransitionType indicating the type of video transition +to apply. + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents all the output streams from a particular uri. It is assumed that +the URI points to a file of some type. + + + + Creates a new #GESUriClip for the provided @uri. + + The newly created #GESUriClip, or +%NULL if there was an error. + + + + + the URI the source should control + + + + + + Get the location of the resource. + + The location of the resource. + + + + + the #GESUriClip + + + + + + Lets you know if @self is an image or not. + + %TRUE if @self is a still image %FALSE otherwise. + + + + + the #GESUriClip + + + + + + Lets you know if the audio track of @self is muted or not. + + %TRUE if the audio track of @self is muted, %FALSE otherwise. + + + + + the #GESUriClip + + + + + + Sets whether the clip is a still image or not. + + + + + + the #GESUriClip + + + + %TRUE if @self is a still image, %FALSE otherwise + + + + + + Sets whether the audio track of this clip is muted or not. + + + + + + the #GESUriClip on which to mute or unmute the audio track + + + + %TRUE to mute @self audio track, %FALSE to unmute it + + + + + + Whether this uri clip represents a still image or not. This must be set +before create_track_elements is called. + + + + Whether the sound will be played or not. + + + + + + + The location of the file/resource to use. + + + + + + + + + + + + + + + + The #GESUriClipAsset is a special #GESAsset that lets you handle +the media file to use inside the GStreamer Editing Services. It has APIs that +let you get information about the medias. Also, the tags found in the media file are +set as Metadatas of the Asser. + + + + + Creates a #GESUriClipAsset for @uri + +Example of request of a GESUriClipAsset: +|[ +// The request callback +static void +filesource_asset_loaded_cb (GESAsset * source, GAsyncResult * res, gpointer user_data) +{ + GError *error = NULL; + GESUriClipAsset *filesource_asset; + + filesource_asset = GES_URI_CLIP_ASSET (ges_asset_request_finish (res, &error)); + if (filesource_asset) { + g_print ("The file: %s is usable as a FileSource, it is%s an image and lasts %" GST_TIME_FORMAT, + ges_asset_get_id (GES_ASSET (filesource_asset)) + ges_uri_clip_asset_is_image (filesource_asset) ? "" : " not", + GST_TIME_ARGS (ges_uri_clip_asset_get_duration (filesource_asset)); + } else { + g_print ("The file: %s is *not* usable as a FileSource because: %s", + ges_asset_get_id (source), error->message); + } + + gst_object_unref (mfs); +} + +// The request: +ges_uri_clip_asset_new (uri, (GAsyncReadyCallback) filesource_asset_loaded_cb, user_data); +]| + + + + + + The URI of the file for which to create a #GESUriClipAsset + + + + optional %GCancellable object, %NULL to ignore. + + + + a #GAsyncReadyCallback to call when the initialization is finished + + + + The user data to pass when @callback is called + + + + + + Creates a #GESUriClipAsset for @uri syncronously. You should avoid +to use it in application, and rather create #GESUriClipAsset asynchronously + + A reference to the requested asset or +%NULL if an error happened + + + + + The URI of the file for which to create a #GESUriClipAsset. +You can also use multi file uris for #GESMultiFileSource. + + + + + + Gets duration of the file represented by @self + + The duration of @self + + + + + a #GESUriClipAsset + + + + + + Gets #GstDiscovererInfo about the file + + #GstDiscovererInfo of specified asset + + + + + Target asset + + + + + + Get the GESUriSourceAsset @self containes + + a +#GList of #GESUriSourceAsset + + + + + + + A #GESUriClipAsset + + + + + + Gets Whether the file represented by @self is an image or not + + Whether the file represented by @self is an image or not + + + + + a #indent: Standard input:311: Error:Unexpected end of file +GESUriClipAsset + + + + + + The duration (in nanoseconds) of the media file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sets the timeout of #GESUriClipAsset loading + + + + + + The #GESUriClipAssetClass on which to set the discoverer timeout + + + + The timeout to set + + + + + + + + + + + + + + + + + + + + + NOTE: You should never request such a #GESAsset as they will be created automatically +by #GESUriClipAsset-s. + + + + + Get the #GESUriClipAsset @self is contained in + + a #GESUriClipAsset + + + + + A #GESUriClipAsset + + + + + + Get the #GstDiscovererStreamInfo user by @asset + + a #GESUriClipAsset + + + + + A #GESUriClipAsset + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # Children Properties: +You can use the following children properties through the +#ges_track_element_set_child_property and alike set of methods: + +<informaltable frame="none"> +<tgroup cols="3"> +<colspec colname="properties_type" colwidth="150px"/> +<colspec colname="properties_name" colwidth="200px"/> +<colspec colname="properties_flags" colwidth="400px"/> +<tbody> +<row> + <entry role="property_type"><link linkend="gdouble"><type>double</type></link></entry> + <entry role="property_name"><link linkend="GESVideoSource--alpha">alpha</link></entry> + <entry>The desired alpha for the stream.</entry> +</row> +<row> + <entry role="property_type"><link linkend="gint"><type>gint</type></link></entry> + <entry role="property_name"><link linkend="GESVideoSource--posx">posx</link></entry> + <entry>The desired x position for the stream.</entry> +</row> +<row> + <entry role="property_type"><link linkend="gint"><type>gint</type></link></entry> + <entry role="property_name"><link linkend="GESVideoSource--posy">posy</link></entry> + <entry>The desired y position for the stream</entry> +</row> +<row> + <entry role="property_type"><link linkend="gint"><type>gint</type></link></entry> + <entry role="property_name"><link linkend="GESVideoSource--width">width</link></entry> + <entry>The desired width for that source. Set to 0 if size is not mandatory, will be set to width of the current track.</entry> +</row> +<row> + <entry role="property_type"><link linkend="gint"><type>gint</type></link></entry> + <entry role="property_name"><link linkend="GESVideoSource--height">height</link></entry> + <entry>The desired height for that source. Set to 0 if size is not mandatory, will be set to height of the current track.</entry> +</row> +<row> + <entry role="property_type"><link linkend="GstDeinterlaceModes"><type>GstDeinterlaceModes</type></link></entry> + <entry role="property_name"><link linkend="GESVideoSource--deinterlace-mode">deinterlace-mode</link></entry> + <entry>Deinterlace Mode</entry> +</row> +<row> + <entry role="property_type"><link linkend="GstDeinterlaceFields"><type>GstDeinterlaceFields</type></link></entry> + <entry role="property_name"><link linkend="GESVideoSource--deinterlace-fields">deinterlace-fields</link></entry> + <entry>Fields to use for deinterlacing</entry> +</row> +<row> + <entry role="property_type"><link linkend="GstDeinterlaceFieldLayout"><type>GstDeinterlaceFieldLayout</type></link></entry> + <entry role="property_name"><link linkend="GESVideoSource--deinterlace-tff">deinterlace-tff</link></entry> + <entry>Deinterlace top field first</entry> +</row> +</tbody> +</tgroup> +</informaltable> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Transition type has not been set, + + + A bar moves from left to right, + + + A bar moves from top to bottom, + + + A box expands from the upper-left corner to the lower-right corner, + + + A box expands from the upper-right corner to the lower-left corner, + + + A box expands from the lower-right corner to the upper-left corner, + + + A box expands from the lower-left corner to the upper-right corner, + + + A box shape expands from each of the four corners toward the center, + + + A box shape expands from the center of each quadrant toward the corners of each quadrant, + + + A central, vertical line splits and expands toward the left and right edges, + + + A central, horizontal line splits and expands toward the top and bottom edges, + + + A box expands from the top edge's midpoint to the bottom corners, + + + A box expands from the right edge's midpoint to the left corners, + + + A box expands from the bottom edge's midpoint to the top corners, + + + A box expands from the left edge's midpoint to the right corners, + + + A diagonal line moves from the upper-left corner to the lower-right corner, + + + A diagonal line moves from the upper right corner to the lower-left corner, + + + Two wedge shapes slide in from the top and bottom edges toward the center, + + + Two wedge shapes slide in from the left and right edges toward the center, + + + A diagonal line from the lower-left to upper-right corners splits and expands toward the opposite corners, + + + A diagonal line from upper-left to lower-right corners splits and expands toward the opposite corners, + + + Four wedge shapes split from the center and retract toward the four edges, + + + A diamond connecting the four edge midpoints simultaneously contracts toward the center and expands toward the edges, + + + A wedge shape moves from top to bottom, + + + A wedge shape moves from right to left, + + + A wedge shape moves from bottom to top, + + + A wedge shape moves from left to right, + + + A 'V' shape extending from the bottom edge's midpoint to the opposite corners contracts toward the center and expands toward the edges, + + + A 'V' shape extending from the left edge's midpoint to the opposite corners contracts toward the center and expands toward the edges, + + + A 'V' shape extending from the top edge's midpoint to the opposite corners contracts toward the center and expands toward the edges, + + + A 'V' shape extending from the right edge's midpoint to the opposite corners contracts toward the center and expands toward the edges, + + + A rectangle expands from the center., + + + A radial hand sweeps clockwise from the twelve o'clock position, + + + A radial hand sweeps clockwise from the three o'clock position, + + + A radial hand sweeps clockwise from the six o'clock position, + + + A radial hand sweeps clockwise from the nine o'clock position, + + + Two radial hands sweep clockwise from the twelve and six o'clock positions, + + + Two radial hands sweep clockwise from the nine and three o'clock positions, + + + Four radial hands sweep clockwise, + + + A fan unfolds from the top edge, the fan axis at the center, + + + A fan unfolds from the right edge, the fan axis at the center, + + + Two fans, their axes at the center, unfold from the top and bottom, + + + Two fans, their axes at the center, unfold from the left and right, + + + A radial hand sweeps clockwise from the top edge's midpoint, + + + A radial hand sweeps clockwise from the right edge's midpoint, + + + A radial hand sweeps clockwise from the bottom edge's midpoint, + + + A radial hand sweeps clockwise from the left edge's midpoint, + + + Two radial hands sweep clockwise and counter-clockwise from the top and bottom edges' midpoints, + + + Two radial hands sweep clockwise and counter-clockwise from the left and right edges' midpoints, + + + Two radial hands attached at the top and bottom edges' midpoints sweep from right to left, + + + Two radial hands attached at the left and right edges' midpoints sweep from top to bottom, + + + A fan unfolds from the bottom, the fan axis at the top edge's midpoint, + + + A fan unfolds from the left, the fan axis at the right edge's midpoint, + + + A fan unfolds from the top, the fan axis at the bottom edge's midpoint, + + + A fan unfolds from the right, the fan axis at the left edge's midpoint, + + + Two fans, their axes at the top and bottom, unfold from the center, + + + Two fans, their axes at the left and right, unfold from the center, + + + A radial hand sweeps clockwise from the upper-left corner, + + + A radial hand sweeps counter-clockwise from the lower-left corner., + + + A radial hand sweeps clockwise from the lower-right corner, + + + A radial hand sweeps counter-clockwise from the upper-right corner, + + + Two radial hands attached at the upper-left and lower-right corners sweep down and up, + + + Two radial hands attached at the lower-left and upper-right corners sweep down and up, + + + Two radial hands attached at the upper-left and upper-right corners sweep down, + + + Two radial hands attached at the upper-left and lower-left corners sweep to the right, + + + Two radial hands attached at the lower-left and lower-right corners sweep up, + + + Two radial hands attached at the upper-right and lower-right corners sweep to the left, + + + Two radial hands attached at the midpoints of the top and bottom halves sweep from right to left, + + + Two radial hands attached at the midpoints of the left and right halves sweep from top to bottom, + + + Two sets of radial hands attached at the midpoints of the top and bottom halves sweep from top to bottom and bottom to top, + + + Two sets of radial hands attached at the midpoints of the left and right halves sweep from left to right and right to left, + + + Crossfade + + + + The test pattern to produce + + A standard SMPTE test pattern + + + Random noise + + + A black image + + + A white image + + + A red image + + + A green image + + + A blue image + + + Checkers pattern (1px) + + + Checkers pattern (2px) + + + Checkers pattern (4px) + + + Checkers pattern (8px) + + + Circular pattern + + + Alternate between black and white + + + SMPTE test pattern (75% color bars) + + + Zone plate + + + Gamut checkers + + + Chroma zone plate + + + Solid color + + + + + + + Get the video pattern used by the @source. + + The video pattern used by the @source. + + + + + a #GESVideoTestPattern + + + + + + Sets the source to use the given @pattern. + + + + + + a #GESVideoTestSource + + + + a #GESVideoTestPattern + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creates a new #GESVideoTrack of type #GES_TRACK_TYPE_VIDEO and with generic +raw video caps ("video/x-raw"); + + A new #GESTrack. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creates a new #GESVideoTransition. + + The newly created +#GESVideoTransition, or %NULL if there was an error. + + + + + Get the border property of @self, this value represents +the border width of the transition. + + The border values of @self or -1 if not meaningful +(this will happen when not using a smpte transition). + + + + + The #GESVideoTransition to get the border from + + + + + + Get the transition type used by @trans. + + The transition type used by @trans. + + + + + a #GESVideoTransition + + + + + + Get the invert property of @self, this value represents +the direction of the transition. + + The invert value of @self + + + + + The #GESVideoTransition to get the inversion from + + + + + + Set the border property of @self, this value represents +the border width of the transition. In case this value does +not make sense for the current transition type, it is cached +for later use. + + + + + + The #GESVideoTransition to set the border to + + + + The value of the border to set on @object + + + + + + Set the invert property of @self, this value represents +the direction of the transition. In case this value does +not make sense for the current transition type, it is cached +for later use. + + + + + + The #GESVideoTransition to set invert on + + + + %TRUE if the transition should be inverted %FALSE otherwise + + + + + + Sets the transition being used to @type. + + %TRUE if the transition type was properly changed, else %FALSE. + + + + + a #GESVideoTransition + + + + a #GESVideoStandardTransitionType + + + + + + This value represents the border width of the transition. + + + + This value represents the direction of the transition. + + + + + + + + + + + + + + + + + + + + parent class + + + + + + + + + + + + + + + The location of the file/resource to use. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Clean up any resources created by GES in ges_init(). + +It is normally not needed to call this function in a normal application as the +resources will automatically be freed when the program terminates. +This function is therefore mostly used by testsuites and other memory profiling tools. + +After this call GES (including this method) should not be used anymore. + + + + + + Initialize the GStreamer Editing Service. Call this before any usage of +GES. You should take care of initilizing GStreamer before calling this +function. + + + + + + Initializes the GStreamer Editing Services library, setting up internal path lists, +and loading evrything needed. + +This function will return %FALSE if GES could not be initialized +for some reason. + + %TRUE if GES could be initialized. + + + + + pointer to application's argc + + + + pointer to application's argv + + + + + + + + Returns a #GOptionGroup with GES's argument specifications. The +group is set up to use standard GOption callbacks, so when using this +group in combination with GOption parsing methods, all argument parsing +and initialization is automated. + +This function is useful if you want to integrate GES with other +libraries that use GOption (see g_option_context_add_group() ). + +If you use this function, you should make sure you initialise the GStreamer +as one of the very first things in your program. That means you need to +use gst_init_get_option_group() and add it to the option context before +using the ges_init_get_option_group() result. + + a pointer to GES's option group. + + + + + List all @asset filtering per filter as defined by @filter. +It copies the asset and thus will not be updated in time. + + The list of +#GESAsset the object contains + + + + + + + Type of assets to list, #GES_TYPE_EXTRACTABLE will list +all assets + + + + + + Get the last buffer @playsink showed + + A #GstSample containing the last frame from +@playsink in the format defined by the @caps + + + + + The playsink to get last frame from + + + + The caps defining the format the return value will have + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Gets the version number of the GStreamer Editing Services library. + + + + + + pointer to a guint to store the major version number + + + + pointer to a guint to store the minor version number + + + + pointer to a guint to store the micro version number + + + + pointer to a guint to store the nano version number + + + + + + diff --git a/gstreamer-editing-services/Cargo.toml b/gstreamer-editing-services/Cargo.toml new file mode 100644 index 000000000..78f11f070 --- /dev/null +++ b/gstreamer-editing-services/Cargo.toml @@ -0,0 +1,47 @@ +[package] +name = "gstreamer-editing-services" +version = "0.13.0" +authors = ["Thibault Saunier ", "Sebastian Dröge "] +categories = ["api-bindings", "multimedia"] +description = "Rust bindings for GStreamer Editing Services" +repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs" +license = "MIT/Apache-2.0" +readme = "README.md" +homepage = "https://gstreamer.freedesktop.org" +documentation = "https://sdroege.github.io/rustdoc/gstreamer/gstreamer_editing_services" +keywords = ["gstreamer", "multimedia", "gnome", "nle", "video editing"] +build = "build.rs" + +[dependencies] +libc = "0.2" +bitflags = "1.0" +glib-sys = { git = "https://github.com/gtk-rs/sys" } +gio-sys = { git = "https://github.com/gtk-rs/sys" } +gobject-sys = { git = "https://github.com/gtk-rs/sys" } +gstreamer-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys" } +gstreamer-base-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys" } +gstreamer-pbutils-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys" } +gstreamer-editing-services-sys = { git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys", features = ["v1_8"]} + +glib = { git = "https://github.com/gtk-rs/glib" } +gio = { git = "https://github.com/gtk-rs/gio" } +gstreamer = { path = "../gstreamer" } +gstreamer-base = { path = "../gstreamer-base" } +gstreamer-pbutils = { path = "../gstreamer-pbutils" } + +[build-dependencies.rustdoc-stripper] +version = "0.1" +optional = true + +[features] +v1_8 = ["gstreamer-editing-services-sys/v1_8"] +v1_10 = ["gstreamer-editing-services-sys/v1_10"] +v1_12 = ["gstreamer-editing-services-sys/v1_12", "v1_10"] +v1_14 = ["gstreamer-editing-services-sys/v1_14", "v1_12"] +v1_16 = ["gstreamer-editing-services-sys/v1_16", "v1_14"] +embed-lgpl-docs = ["rustdoc-stripper"] +purge-lgpl-docs = ["rustdoc-stripper"] +dox = ["gstreamer-editing-services-sys/dox", "glib/dox", "gstreamer/dox"] + +[badges] +gitlab = { repository = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "master" } diff --git a/gstreamer-editing-services/README.md b/gstreamer-editing-services/README.md new file mode 100644 index 000000000..1802fa412 --- /dev/null +++ b/gstreamer-editing-services/README.md @@ -0,0 +1,175 @@ +# gstreamer-rs [![crates.io](https://img.shields.io/crates/v/gstreamer-editing-services.svg)](https://crates.io/crates/gstreamer-editing-services) [![pipeline status](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/badges/master/pipeline.svg)](https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/commits/master) + +[GStreamer Editing Services](https://gstreamer.freedesktop.org/) bindings for Rust. +Documentation can be found [here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/). + +NOTE: The GStreamer Editing Services API is not Thread Safe and before the 1.16 +release this was not properly expressed in the code, leading to possible data +unsafety even in the rust bindings. We strongly encourage you to run with +GES >= 1.16. + +These bindings are providing a safe API that can be used to interface with +GStreamer, e.g. for writing GStreamer-based applications. + +For background and motivation, see the [announcement blogpost](https://coaxion.net/blog/2017/07/writing-gstreamer-applications-in-rust/). + +The bindings (since 0.8.0) are autogenerated with [gir](https://github.com/gtk-rs/gir/) +based on the [GObject-Introspection](https://wiki.gnome.org/Projects/GObjectIntrospection/) +API metadata provided by the GStreamer project. Older versions before 0.8.0 were manually +written and the repository can be found [here](https://github.com/arturoc/gstreamer1.0-rs). +The API of the two is incompatible. + +A crate for writing GStreamer plugins in Rust can be found here: https://github.com/sdroege/gst-plugin-rs + +## Table of Contents +1. [Installation](#installation) + 1. [Linux/BSDs](#installation-linux) + 1. [macOS](#installation-macos) + 1. [Windows](#installation-windows) +1. [Getting Started](#getting-started) +1. [License](#license) +1. [Contribution](#contribution) + + + +## Installation + +To build the GStreamer bindings or anything depending on them, you need to +have at least GStreamer 1.8, gst-plugins-base 1.8 and gstreamer-editing-services +1.8 installed. + + + +### Linux/BSDs + +You need to install the above mentioned packages with your distributions +package manager, or build them from source. + +On Debian/Ubuntu they can be installed with + +``` +$ apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \ + gstreamer1.0-libav libges-1.0 +``` + +Package names on other distributions should be similar. +Please submit a pull request with instructions for yours. + + + +### macOS + +You can install GStreamer and the plugins via [Homebrew](https://brew.sh/) or +by installing the [binaries](https://gstreamer.freedesktop.org/data/pkg/osx/) +provided by the GStreamer project. + +#### Homebrew + +``` +$ brew install gstreamer gst-plugins-base gst-plugins-good \ + gst-plugins-bad gst-plugins-ugly gst-libav gst-editing-services +``` + +#### GStreamer Binaries + +You need to download the *two* `.pkg` files from the GStreamer website and +install them, e.g. `gstreamer-1.0-1.12.3-x86_64.pkg` and +`gstreamer-1.0-devel-1.12.3-x86_64.pkg`. + +After installation, you also need to install `pkg-config` (e.g. via Homebrew) +and set the `PKG_CONFIG_PATH` environment variable + +``` +$ export PKG_CONFIG_PATH="/Frameworks/GStreamer.framework/Versions/Current/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" +``` + + + +### Windows + +You can install GStreamer and the plugins via [MSYS2](http://www.msys2.org/) +with `pacman` or by installing the +[binaries](https://gstreamer.freedesktop.org/data/pkg/windows/) provided by +the GStreamer project. + +#### MSYS2 / pacman + +``` +$ pacman -S pkg-config mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-plugins-base \ + mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gst-plugins-bad \ + mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav \ + mingw-w64-x86_64-gst-editing-services +``` + +#### GStreamer Binaries + +You need to download the *two* `.msi` files for your platform from the +GStreamer website and install them, e.g. `gstreamer-1.0-x86_64-1.12.3.msi` and +`gstreamer-1.0-devel-x86_64-1.12.3.msi`. + +After installation, you also need to install `pkg-config` (e.g. via MSYS2 or +from [here](https://sourceforge.net/projects/pkgconfiglite/)) +and set the `PKG_CONFIG_PATH` environment variable + +``` +$ export PKG_CONFIG_PATH="c:\\gstreamer\\1.0\\x86_64\\lib\\pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" +``` + + + +## Getting Started + +The API reference can be found +[here](https://sdroege.github.io/rustdoc/gstreamer/gstreamer/), however it is +only the Rust API reference and does not explain any of the concepts. + +For getting started with GStreamer development, the best would be to follow +the [documentation](https://gstreamer.freedesktop.org/documentation/) on the +GStreamer website, especially the [Application Development +Manual](https://gstreamer.freedesktop.org/documentation/application-development/). +While being C-centric, it explains all the fundamental concepts of GStreamer +and the code examples should be relatively easily translatable to Rust. The +API is basically the same, function/struct names are the same and everything +is only more convenient (hopefully) and safer. + +In addition there are +[tutorials](https://gstreamer.freedesktop.org/documentation/tutorials/) on the +GStreamer website. Many of them were ported to Rust already and the code can +be found in the +[tutorials](https://github.com/sdroege/gstreamer-rs/tree/master/tutorials) +directory. + +Some further examples for various aspects of GStreamer and how to use it from +Rust can be found in the +[examples](https://github.com/sdroege/gstreamer-rs/tree/master/examples) +directory. + + + +## LICENSE + +gstreamer-rs and all crates contained in here are licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or + http://opensource.org/licenses/MIT) + +at your option. + +GStreamer itself is licensed under the Lesser General Public License version +2.1 or (at your option) any later version: +https://www.gnu.org/licenses/lgpl-2.1.html + + + +## Contribution + +Any kinds of contributions are welcome as a pull request. + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in gstreamer-rs by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. + diff --git a/gstreamer-editing-services/build.rs b/gstreamer-editing-services/build.rs new file mode 100644 index 000000000..e5c0fcfe1 --- /dev/null +++ b/gstreamer-editing-services/build.rs @@ -0,0 +1,34 @@ +fn main() { + manage_docs(); +} + +#[cfg(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs"))] +fn manage_docs() { + extern crate stripper_lib; + use std::io; + + let path = "src"; + let ignores: &[&str] = &[]; + + stripper_lib::loop_over_files( + path.as_ref(), + &mut |w, s| stripper_lib::strip_comments(w, s, &mut io::sink(), true), + &ignores, + false, + ); + + #[cfg(feature = "embed-lgpl-docs")] + { + let docs = include_str!("../docs/gstreamer-editing-services/docs.md"); + let mut infos = stripper_lib::parse_cmts(docs.lines(), true); + stripper_lib::loop_over_files( + path.as_ref(), + &mut |w, s| stripper_lib::regenerate_comments(w, s, &mut infos, true, true), + &ignores, + false, + ); + } +} + +#[cfg(not(any(feature = "embed-lgpl-docs", feature = "purge-lgpl-docs")))] +fn manage_docs() {} diff --git a/gstreamer-editing-services/src/auto/asset.rs b/gstreamer-editing-services/src/auto/asset.rs new file mode 100644 index 000000000..44337a392 --- /dev/null +++ b/gstreamer-editing-services/src/auto/asset.rs @@ -0,0 +1,245 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Error; +use Extractable; +use ffi; +#[cfg(feature = "futures")] +use futures_core; +use gio; +use gio_ffi; +use glib; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct Asset(Object); + + match fn { + get_type => || ffi::ges_asset_get_type(), + } +} + +impl Asset { + pub fn needs_reload(extractable_type: glib::types::Type, id: &str) -> bool { + assert_initialized_main_thread!(); + unsafe { + from_glib(ffi::ges_asset_needs_reload(extractable_type.to_glib(), id.to_glib_none().0)) + } + } + + pub fn request<'a, P: Into>>(extractable_type: glib::types::Type, id: P) -> Result, Error> { + assert_initialized_main_thread!(); + let id = id.into(); + let id = id.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::ges_asset_request(extractable_type.to_glib(), id.0, &mut error); + if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } + } + } + + pub fn request_async<'a, P: Into>, Q: FnOnce(Result) + Send + 'static>(extractable_type: glib::types::Type, id: &str, cancellable: P, callback: Q) { + assert_initialized_main_thread!(); + let cancellable = cancellable.into(); + let cancellable = cancellable.to_glib_none(); + let user_data: Box> = Box::new(Box::new(callback)); + unsafe extern "C" fn request_async_trampoline) + Send + 'static>(_source_object: *mut gobject_ffi::GObject, res: *mut gio_ffi::GAsyncResult, user_data: glib_ffi::gpointer) + { + let mut error = ptr::null_mut(); + let ret = ffi::ges_asset_request_finish(res, &mut error); + let result = if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }; + let callback: Box> = Box::from_raw(user_data as *mut _); + callback(result); + } + let callback = request_async_trampoline::; + unsafe { + ffi::ges_asset_request_async(extractable_type.to_glib(), id.to_glib_none().0, cancellable.0, Some(callback), Box::into_raw(user_data) as *mut _); + } + } + + #[cfg(feature = "futures")] + pub fn request_async_future(extractable_type: glib::types::Type, id: &str) -> Box_> { + use gio::GioFuture; + use fragile::Fragile; + + let id = String::from(id); + GioFuture::new(&(), move |_obj, send| { + let cancellable = gio::Cancellable::new(); + let send = Fragile::new(send); + Self::request_async( + extractable_type, + &id, + Some(&cancellable), + move |res| { + let _ = send.into_inner().send(res); + }, + ); + + cancellable + }) + } +} + +pub trait AssetExt { + fn extract(&self) -> Result, Error>; + + fn get_error(&self) -> Option; + + fn get_extractable_type(&self) -> glib::types::Type; + + fn get_id(&self) -> Option; + + fn get_proxy(&self) -> Option; + + fn get_proxy_target(&self) -> Option; + + fn list_proxies(&self) -> Vec; + + fn set_proxy<'a, P: IsA + 'a, Q: Into>>(&self, proxy: Q) -> bool; + + fn unproxy>(&self, proxy: &P) -> bool; + + fn set_property_proxy_target + IsA + glib::value::SetValueOptional>(&self, proxy_target: Option<&P>); + + fn connect_property_extractable_type_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_id_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_proxy_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_proxy_target_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> AssetExt for O { + fn extract(&self) -> Result, Error> { + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::ges_asset_extract(self.to_glib_none().0, &mut error); + if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) } + } + } + + fn get_error(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_asset_get_error(self.to_glib_none().0)) + } + } + + fn get_extractable_type(&self) -> glib::types::Type { + unsafe { + from_glib(ffi::ges_asset_get_extractable_type(self.to_glib_none().0)) + } + } + + fn get_id(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_asset_get_id(self.to_glib_none().0)) + } + } + + fn get_proxy(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_asset_get_proxy(self.to_glib_none().0)) + } + } + + fn get_proxy_target(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_asset_get_proxy_target(self.to_glib_none().0)) + } + } + + fn list_proxies(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_none(ffi::ges_asset_list_proxies(self.to_glib_none().0)) + } + } + + fn set_proxy<'a, P: IsA + 'a, Q: Into>>(&self, proxy: Q) -> bool { + let proxy = proxy.into(); + let proxy = proxy.to_glib_none(); + unsafe { + from_glib(ffi::ges_asset_set_proxy(self.to_glib_none().0, proxy.0)) + } + } + + fn unproxy>(&self, proxy: &P) -> bool { + unsafe { + from_glib(ffi::ges_asset_unproxy(self.to_glib_none().0, proxy.to_glib_none().0)) + } + } + + fn set_property_proxy_target + IsA + glib::value::SetValueOptional>(&self, proxy_target: Option<&P>) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "proxy-target".to_glib_none().0, Value::from(proxy_target).to_glib_none().0); + } + } + + fn connect_property_extractable_type_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::extractable-type", + transmute(notify_extractable_type_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_id_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::id", + transmute(notify_id_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_proxy_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::proxy", + transmute(notify_proxy_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_proxy_target_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::proxy-target", + transmute(notify_proxy_target_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn notify_extractable_type_trampoline

(this: *mut ffi::GESAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Asset::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_id_trampoline

(this: *mut ffi::GESAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Asset::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_proxy_trampoline

(this: *mut ffi::GESAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Asset::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_proxy_target_trampoline

(this: *mut ffi::GESAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Asset::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/base_effect.rs b/gstreamer-editing-services/src/auto/base_effect.rs new file mode 100644 index 000000000..a2bd4206e --- /dev/null +++ b/gstreamer-editing-services/src/auto/base_effect.rs @@ -0,0 +1,23 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Extractable; +use TimelineElement; +use TrackElement; +use ffi; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct BaseEffect(Object): TrackElement, TimelineElement, Extractable; + + match fn { + get_type => || ffi::ges_base_effect_get_type(), + } +} + +impl BaseEffect {} diff --git a/gstreamer-editing-services/src/auto/clip.rs b/gstreamer-editing-services/src/auto/clip.rs new file mode 100644 index 000000000..960c701c5 --- /dev/null +++ b/gstreamer-editing-services/src/auto/clip.rs @@ -0,0 +1,178 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Asset; +use BaseEffect; +use Container; +use Extractable; +use Layer; +use TimelineElement; +use Track; +use TrackElement; +use TrackType; +use ffi; +use glib; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct Clip(Object): Container, TimelineElement, Extractable; + + match fn { + get_type => || ffi::ges_clip_get_type(), + } +} + +pub trait ClipExt { + fn add_asset>(&self, asset: &P) -> Option; + + fn find_track_element<'a, P: IsA + 'a, Q: Into>>(&self, track: Q, type_: glib::types::Type) -> Option; + + fn find_track_elements<'a, P: IsA + 'a, Q: Into>>(&self, track: Q, track_type: TrackType, type_: glib::types::Type) -> Vec; + + fn get_layer(&self) -> Option; + + fn get_supported_formats(&self) -> TrackType; + + fn get_top_effect_index>(&self, effect: &P) -> i32; + + fn get_top_effect_position>(&self, effect: &P) -> i32; + + fn get_top_effects(&self) -> Vec; + + fn move_to_layer(&self, layer: &Layer) -> bool; + + fn set_supported_formats(&self, supportedformats: TrackType); + + fn set_top_effect_index>(&self, effect: &P, newindex: u32) -> bool; + + fn set_top_effect_priority>(&self, effect: &P, newpriority: u32) -> bool; + + fn split(&self, position: u64) -> Option; + + fn connect_property_layer_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_supported_formats_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> ClipExt for O { + fn add_asset>(&self, asset: &P) -> Option { + unsafe { + from_glib_none(ffi::ges_clip_add_asset(self.to_glib_none().0, asset.to_glib_none().0)) + } + } + + fn find_track_element<'a, P: IsA + 'a, Q: Into>>(&self, track: Q, type_: glib::types::Type) -> Option { + let track = track.into(); + let track = track.to_glib_none(); + unsafe { + from_glib_full(ffi::ges_clip_find_track_element(self.to_glib_none().0, track.0, type_.to_glib())) + } + } + + fn find_track_elements<'a, P: IsA + 'a, Q: Into>>(&self, track: Q, track_type: TrackType, type_: glib::types::Type) -> Vec { + let track = track.into(); + let track = track.to_glib_none(); + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ges_clip_find_track_elements(self.to_glib_none().0, track.0, track_type.to_glib(), type_.to_glib())) + } + } + + fn get_layer(&self) -> Option { + unsafe { + from_glib_full(ffi::ges_clip_get_layer(self.to_glib_none().0)) + } + } + + fn get_supported_formats(&self) -> TrackType { + unsafe { + from_glib(ffi::ges_clip_get_supported_formats(self.to_glib_none().0)) + } + } + + fn get_top_effect_index>(&self, effect: &P) -> i32 { + unsafe { + ffi::ges_clip_get_top_effect_index(self.to_glib_none().0, effect.to_glib_none().0) + } + } + + fn get_top_effect_position>(&self, effect: &P) -> i32 { + unsafe { + ffi::ges_clip_get_top_effect_position(self.to_glib_none().0, effect.to_glib_none().0) + } + } + + fn get_top_effects(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ges_clip_get_top_effects(self.to_glib_none().0)) + } + } + + fn move_to_layer(&self, layer: &Layer) -> bool { + unsafe { + from_glib(ffi::ges_clip_move_to_layer(self.to_glib_none().0, layer.to_glib_none().0)) + } + } + + fn set_supported_formats(&self, supportedformats: TrackType) { + unsafe { + ffi::ges_clip_set_supported_formats(self.to_glib_none().0, supportedformats.to_glib()); + } + } + + fn set_top_effect_index>(&self, effect: &P, newindex: u32) -> bool { + unsafe { + from_glib(ffi::ges_clip_set_top_effect_index(self.to_glib_none().0, effect.to_glib_none().0, newindex)) + } + } + + fn set_top_effect_priority>(&self, effect: &P, newpriority: u32) -> bool { + unsafe { + from_glib(ffi::ges_clip_set_top_effect_priority(self.to_glib_none().0, effect.to_glib_none().0, newpriority)) + } + } + + fn split(&self, position: u64) -> Option { + unsafe { + from_glib_none(ffi::ges_clip_split(self.to_glib_none().0, position)) + } + } + + fn connect_property_layer_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::layer", + transmute(notify_layer_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_supported_formats_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::supported-formats", + transmute(notify_supported_formats_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn notify_layer_trampoline

(this: *mut ffi::GESClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Clip::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_supported_formats_trampoline

(this: *mut ffi::GESClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Clip::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/container.rs b/gstreamer-editing-services/src/auto/container.rs new file mode 100644 index 000000000..ed925bdf9 --- /dev/null +++ b/gstreamer-editing-services/src/auto/container.rs @@ -0,0 +1,143 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Edge; +use EditMode; +use Extractable; +use Layer; +use TimelineElement; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct Container(Object): TimelineElement, Extractable; + + match fn { + get_type => || ffi::ges_container_get_type(), + } +} + +impl Container { + pub fn group(containers: &[Container]) -> Option { + assert_initialized_main_thread!(); + unsafe { + from_glib_none(ffi::ges_container_group(containers.to_glib_none().0)) + } + } +} + +pub trait GESContainerExt { + fn add>(&self, child: &P) -> Result<(), glib::error::BoolError>; + + fn edit(&self, layers: &[Layer], new_layer_priority: i32, mode: EditMode, edge: Edge, position: u64) -> bool; + + fn get_children(&self, recursive: bool) -> Vec; + + fn remove>(&self, child: &P) -> Result<(), glib::error::BoolError>; + + fn ungroup(&self, recursive: bool) -> Vec; + + fn get_property_height(&self) -> u32; + + fn connect_child_added(&self, f: F) -> SignalHandlerId; + + fn connect_child_removed(&self, f: F) -> SignalHandlerId; + + fn connect_property_height_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> GESContainerExt for O { + fn add>(&self, child: &P) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::ges_container_add(self.to_glib_none().0, child.to_glib_none().0), "Failed to add element") + } + } + + fn edit(&self, layers: &[Layer], new_layer_priority: i32, mode: EditMode, edge: Edge, position: u64) -> bool { + unsafe { + from_glib(ffi::ges_container_edit(self.to_glib_none().0, layers.to_glib_none().0, new_layer_priority, mode.to_glib(), edge.to_glib(), position)) + } + } + + fn get_children(&self, recursive: bool) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ges_container_get_children(self.to_glib_none().0, recursive.to_glib())) + } + } + + fn remove>(&self, child: &P) -> Result<(), glib::error::BoolError> { + unsafe { + glib::error::BoolError::from_glib(ffi::ges_container_remove(self.to_glib_none().0, child.to_glib_none().0), "Failed to remove element") + } + } + + fn ungroup(&self, recursive: bool) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ges_container_ungroup(self.to_glib_full(), recursive.to_glib())) + } + } + + fn get_property_height(&self) -> u32 { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "height".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn connect_child_added(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "child-added", + transmute(child_added_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_child_removed(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "child-removed", + transmute(child_removed_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_height_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::height", + transmute(notify_height_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn child_added_trampoline

(this: *mut ffi::GESContainer, element: *mut ffi::GESTimelineElement, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &TimelineElement) + 'static) = transmute(f); + f(&Container::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(element)) +} + +unsafe extern "C" fn child_removed_trampoline

(this: *mut ffi::GESContainer, element: *mut ffi::GESTimelineElement, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &TimelineElement) + 'static) = transmute(f); + f(&Container::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(element)) +} + +unsafe extern "C" fn notify_height_trampoline

(this: *mut ffi::GESContainer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Container::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/effect.rs b/gstreamer-editing-services/src/auto/effect.rs new file mode 100644 index 000000000..a25e9dd5e --- /dev/null +++ b/gstreamer-editing-services/src/auto/effect.rs @@ -0,0 +1,70 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use BaseEffect; +use Extractable; +use TimelineElement; +use TrackElement; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct Effect(Object): BaseEffect, TrackElement, TimelineElement, Extractable; + + match fn { + get_type => || ffi::ges_effect_get_type(), + } +} + +impl Effect { + pub fn new(bin_description: &str) -> Effect { + assert_initialized_main_thread!(); + unsafe { + from_glib_none(ffi::ges_effect_new(bin_description.to_glib_none().0)) + } + } +} + +pub trait EffectExt { + fn get_property_bin_description(&self) -> Option; + + fn connect_property_bin_description_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> EffectExt for O { + fn get_property_bin_description(&self) -> Option { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "bin-description".to_glib_none().0, value.to_glib_none_mut().0); + value.get() + } + } + + fn connect_property_bin_description_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::bin-description", + transmute(notify_bin_description_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn notify_bin_description_trampoline

(this: *mut ffi::GESEffect, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Effect::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/enums.rs b/gstreamer-editing-services/src/auto/enums.rs new file mode 100644 index 000000000..1193220ba --- /dev/null +++ b/gstreamer-editing-services/src/auto/enums.rs @@ -0,0 +1,142 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use ffi; +use glib::StaticType; +use glib::Type; +use glib::translate::*; +use glib::value::FromValue; +use glib::value::FromValueOptional; +use glib::value::SetValue; +use glib::value::Value; +use gobject_ffi; + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum Edge { + EdgeStart, + EdgeEnd, + EdgeNone, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for Edge { + type GlibType = ffi::GESEdge; + + fn to_glib(&self) -> ffi::GESEdge { + match *self { + Edge::EdgeStart => ffi::GES_EDGE_START, + Edge::EdgeEnd => ffi::GES_EDGE_END, + Edge::EdgeNone => ffi::GES_EDGE_NONE, + Edge::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for Edge { + fn from_glib(value: ffi::GESEdge) -> Self { + skip_assert_initialized!(); + match value { + 0 => Edge::EdgeStart, + 1 => Edge::EdgeEnd, + 2 => Edge::EdgeNone, + value => Edge::__Unknown(value), + } + } +} + +impl StaticType for Edge { + fn static_type() -> Type { + unsafe { from_glib(ffi::ges_edge_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for Edge { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for Edge { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for Edge { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + +#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[derive(Clone, Copy)] +pub enum EditMode { + EditNormal, + EditRipple, + EditRoll, + EditTrim, + EditSlide, + #[doc(hidden)] + __Unknown(i32), +} + +#[doc(hidden)] +impl ToGlib for EditMode { + type GlibType = ffi::GESEditMode; + + fn to_glib(&self) -> ffi::GESEditMode { + match *self { + EditMode::EditNormal => ffi::GES_EDIT_MODE_NORMAL, + EditMode::EditRipple => ffi::GES_EDIT_MODE_RIPPLE, + EditMode::EditRoll => ffi::GES_EDIT_MODE_ROLL, + EditMode::EditTrim => ffi::GES_EDIT_MODE_TRIM, + EditMode::EditSlide => ffi::GES_EDIT_MODE_SLIDE, + EditMode::__Unknown(value) => value + } + } +} + +#[doc(hidden)] +impl FromGlib for EditMode { + fn from_glib(value: ffi::GESEditMode) -> Self { + skip_assert_initialized!(); + match value { + 0 => EditMode::EditNormal, + 1 => EditMode::EditRipple, + 2 => EditMode::EditRoll, + 3 => EditMode::EditTrim, + 4 => EditMode::EditSlide, + value => EditMode::__Unknown(value), + } + } +} + +impl StaticType for EditMode { + fn static_type() -> Type { + unsafe { from_glib(ffi::ges_edit_mode_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for EditMode { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for EditMode { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_enum(value.to_glib_none().0)) + } +} + +impl SetValue for EditMode { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib()) + } +} + diff --git a/gstreamer-editing-services/src/auto/extractable.rs b/gstreamer-editing-services/src/auto/extractable.rs new file mode 100644 index 000000000..ec4fdeede --- /dev/null +++ b/gstreamer-editing-services/src/auto/extractable.rs @@ -0,0 +1,48 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Asset; +use ffi; +use glib::object::IsA; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct Extractable(Object); + + match fn { + get_type => || ffi::ges_extractable_get_type(), + } +} + +pub trait ExtractableExt { + fn get_asset(&self) -> Option; + + fn get_id(&self) -> Option; + + fn set_asset>(&self, asset: &P) -> bool; +} + +impl> ExtractableExt for O { + fn get_asset(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_extractable_get_asset(self.to_glib_none().0)) + } + } + + fn get_id(&self) -> Option { + unsafe { + from_glib_full(ffi::ges_extractable_get_id(self.to_glib_none().0)) + } + } + + fn set_asset>(&self, asset: &P) -> bool { + unsafe { + from_glib(ffi::ges_extractable_set_asset(self.to_glib_none().0, asset.to_glib_none().0)) + } + } +} diff --git a/gstreamer-editing-services/src/auto/flags.rs b/gstreamer-editing-services/src/auto/flags.rs new file mode 100644 index 000000000..29909f240 --- /dev/null +++ b/gstreamer-editing-services/src/auto/flags.rs @@ -0,0 +1,116 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use ffi; +use glib::StaticType; +use glib::Type; +use glib::translate::*; +use glib::value::FromValue; +use glib::value::FromValueOptional; +use glib::value::SetValue; +use glib::value::Value; +use gobject_ffi; + +bitflags! { + pub struct PipelineFlags: u32 { + const AUDIO_PREVIEW = 1; + const VIDEO_PREVIEW = 2; + const FULL_PREVIEW = 3; + const RENDER = 4; + const SMART_RENDER = 8; + } +} + +#[doc(hidden)] +impl ToGlib for PipelineFlags { + type GlibType = ffi::GESPipelineFlags; + + fn to_glib(&self) -> ffi::GESPipelineFlags { + self.bits() + } +} + +#[doc(hidden)] +impl FromGlib for PipelineFlags { + fn from_glib(value: ffi::GESPipelineFlags) -> PipelineFlags { + skip_assert_initialized!(); + PipelineFlags::from_bits_truncate(value) + } +} + +impl StaticType for PipelineFlags { + fn static_type() -> Type { + unsafe { from_glib(ffi::ges_pipeline_flags_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for PipelineFlags { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for PipelineFlags { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0)) + } +} + +impl SetValue for PipelineFlags { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) + } +} + +bitflags! { + pub struct TrackType: u32 { + const UNKNOWN = 1; + const AUDIO = 2; + const VIDEO = 4; + const TEXT = 8; + const CUSTOM = 16; + } +} + +#[doc(hidden)] +impl ToGlib for TrackType { + type GlibType = ffi::GESTrackType; + + fn to_glib(&self) -> ffi::GESTrackType { + self.bits() + } +} + +#[doc(hidden)] +impl FromGlib for TrackType { + fn from_glib(value: ffi::GESTrackType) -> TrackType { + skip_assert_initialized!(); + TrackType::from_bits_truncate(value) + } +} + +impl StaticType for TrackType { + fn static_type() -> Type { + unsafe { from_glib(ffi::ges_track_type_get_type()) } + } +} + +impl<'a> FromValueOptional<'a> for TrackType { + unsafe fn from_value_optional(value: &Value) -> Option { + Some(FromValue::from_value(value)) + } +} + +impl<'a> FromValue<'a> for TrackType { + unsafe fn from_value(value: &Value) -> Self { + from_glib(gobject_ffi::g_value_get_flags(value.to_glib_none().0)) + } +} + +impl SetValue for TrackType { + unsafe fn set_value(value: &mut Value, this: &Self) { + gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) + } +} + diff --git a/gstreamer-editing-services/src/auto/group.rs b/gstreamer-editing-services/src/auto/group.rs new file mode 100644 index 000000000..d0f897c38 --- /dev/null +++ b/gstreamer-editing-services/src/auto/group.rs @@ -0,0 +1,219 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Container; +use Extractable; +use TimelineElement; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct Group(Object): Container, TimelineElement, Extractable; + + match fn { + get_type => || ffi::ges_group_get_type(), + } +} + +impl Group { + pub fn new() -> Group { + assert_initialized_main_thread!(); + unsafe { + from_glib_none(ffi::ges_group_new()) + } + } +} + +impl Default for Group { + fn default() -> Self { + Self::new() + } +} + +pub trait GroupExt { + fn get_property_duration(&self) -> u64; + + fn set_property_duration(&self, duration: u64); + + fn get_property_in_point(&self) -> u64; + + fn set_property_in_point(&self, in_point: u64); + + fn get_property_max_duration(&self) -> u64; + + fn set_property_max_duration(&self, max_duration: u64); + + fn get_property_priority(&self) -> u32; + + fn set_property_priority(&self, priority: u32); + + fn get_property_start(&self) -> u64; + + fn set_property_start(&self, start: u64); + + fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_in_point_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_max_duration_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_priority_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_start_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> GroupExt for O { + fn get_property_duration(&self) -> u64 { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "duration".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn set_property_duration(&self, duration: u64) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "duration".to_glib_none().0, Value::from(&duration).to_glib_none().0); + } + } + + fn get_property_in_point(&self) -> u64 { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "in-point".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn set_property_in_point(&self, in_point: u64) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "in-point".to_glib_none().0, Value::from(&in_point).to_glib_none().0); + } + } + + fn get_property_max_duration(&self) -> u64 { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "max-duration".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn set_property_max_duration(&self, max_duration: u64) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "max-duration".to_glib_none().0, Value::from(&max_duration).to_glib_none().0); + } + } + + fn get_property_priority(&self) -> u32 { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "priority".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn set_property_priority(&self, priority: u32) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "priority".to_glib_none().0, Value::from(&priority).to_glib_none().0); + } + } + + fn get_property_start(&self) -> u64 { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "start".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn set_property_start(&self, start: u64) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "start".to_glib_none().0, Value::from(&start).to_glib_none().0); + } + } + + fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::duration", + transmute(notify_duration_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_in_point_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::in-point", + transmute(notify_in_point_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_max_duration_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::max-duration", + transmute(notify_max_duration_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_priority_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::priority", + transmute(notify_priority_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_start_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::start", + transmute(notify_start_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn notify_duration_trampoline

(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Group::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_in_point_trampoline

(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Group::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_max_duration_trampoline

(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Group::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_priority_trampoline

(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Group::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_start_trampoline

(this: *mut ffi::GESGroup, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Group::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/layer.rs b/gstreamer-editing-services/src/auto/layer.rs new file mode 100644 index 000000000..acf9fd276 --- /dev/null +++ b/gstreamer-editing-services/src/auto/layer.rs @@ -0,0 +1,220 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Asset; +use Clip; +use Extractable; +use Timeline; +use TrackType; +use ffi; +use glib; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct Layer(Object): Extractable; + + match fn { + get_type => || ffi::ges_layer_get_type(), + } +} + +impl Layer { + pub fn new() -> Layer { + assert_initialized_main_thread!(); + unsafe { + from_glib_none(ffi::ges_layer_new()) + } + } +} + +impl Default for Layer { + fn default() -> Self { + Self::new() + } +} + +pub trait LayerExt { + fn add_asset>(&self, asset: &P, start: gst::ClockTime, inpoint: gst::ClockTime, duration: gst::ClockTime, track_types: TrackType) -> Option; + + fn add_clip>(&self, clip: &P) -> bool; + + fn get_auto_transition(&self) -> bool; + + fn get_clips(&self) -> Vec; + + fn get_clips_in_interval(&self, start: gst::ClockTime, end: gst::ClockTime) -> Vec; + + fn get_duration(&self) -> gst::ClockTime; + + fn get_priority(&self) -> u32; + + fn get_timeline(&self) -> Option; + + fn is_empty(&self) -> bool; + + fn remove_clip>(&self, clip: &P) -> bool; + + fn set_auto_transition(&self, auto_transition: bool); + + #[cfg_attr(feature = "v1_16", deprecated)] + fn set_priority(&self, priority: u32); + + fn set_timeline(&self, timeline: &Timeline); + + fn connect_clip_added(&self, f: F) -> SignalHandlerId; + + fn connect_clip_removed(&self, f: F) -> SignalHandlerId; + + fn connect_property_auto_transition_notify(&self, f: F) -> SignalHandlerId; + + #[cfg_attr(feature = "v1_16", deprecated)] + fn connect_property_priority_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> LayerExt for O { + fn add_asset>(&self, asset: &P, start: gst::ClockTime, inpoint: gst::ClockTime, duration: gst::ClockTime, track_types: TrackType) -> Option { + unsafe { + from_glib_none(ffi::ges_layer_add_asset(self.to_glib_none().0, asset.to_glib_none().0, start.to_glib(), inpoint.to_glib(), duration.to_glib(), track_types.to_glib())) + } + } + + fn add_clip>(&self, clip: &P) -> bool { + unsafe { + from_glib(ffi::ges_layer_add_clip(self.to_glib_none().0, clip.to_glib_none().0)) + } + } + + fn get_auto_transition(&self) -> bool { + unsafe { + from_glib(ffi::ges_layer_get_auto_transition(self.to_glib_none().0)) + } + } + + fn get_clips(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ges_layer_get_clips(self.to_glib_none().0)) + } + } + + fn get_clips_in_interval(&self, start: gst::ClockTime, end: gst::ClockTime) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ges_layer_get_clips_in_interval(self.to_glib_none().0, start.to_glib(), end.to_glib())) + } + } + + fn get_duration(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::ges_layer_get_duration(self.to_glib_none().0)) + } + } + + fn get_priority(&self) -> u32 { + unsafe { + ffi::ges_layer_get_priority(self.to_glib_none().0) + } + } + + fn get_timeline(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_layer_get_timeline(self.to_glib_none().0)) + } + } + + fn is_empty(&self) -> bool { + unsafe { + from_glib(ffi::ges_layer_is_empty(self.to_glib_none().0)) + } + } + + fn remove_clip>(&self, clip: &P) -> bool { + unsafe { + from_glib(ffi::ges_layer_remove_clip(self.to_glib_none().0, clip.to_glib_none().0)) + } + } + + fn set_auto_transition(&self, auto_transition: bool) { + unsafe { + ffi::ges_layer_set_auto_transition(self.to_glib_none().0, auto_transition.to_glib()); + } + } + + fn set_priority(&self, priority: u32) { + unsafe { + ffi::ges_layer_set_priority(self.to_glib_none().0, priority); + } + } + + fn set_timeline(&self, timeline: &Timeline) { + unsafe { + ffi::ges_layer_set_timeline(self.to_glib_none().0, timeline.to_glib_none().0); + } + } + + fn connect_clip_added(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "clip-added", + transmute(clip_added_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_clip_removed(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "clip-removed", + transmute(clip_removed_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_auto_transition_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::auto-transition", + transmute(notify_auto_transition_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_priority_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::priority", + transmute(notify_priority_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn clip_added_trampoline

(this: *mut ffi::GESLayer, clip: *mut ffi::GESClip, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &Clip) + 'static) = transmute(f); + f(&Layer::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(clip)) +} + +unsafe extern "C" fn clip_removed_trampoline

(this: *mut ffi::GESLayer, clip: *mut ffi::GESClip, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &Clip) + 'static) = transmute(f); + f(&Layer::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(clip)) +} + +unsafe extern "C" fn notify_auto_transition_trampoline

(this: *mut ffi::GESLayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Layer::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_priority_trampoline

(this: *mut ffi::GESLayer, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Layer::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/mod.rs b/gstreamer-editing-services/src/auto/mod.rs new file mode 100644 index 000000000..0dfe2234f --- /dev/null +++ b/gstreamer-editing-services/src/auto/mod.rs @@ -0,0 +1,98 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +mod asset; +pub use self::asset::Asset; +pub use self::asset::AssetExt; + +mod base_effect; +pub use self::base_effect::BaseEffect; + +mod clip; +pub use self::clip::Clip; +pub use self::clip::ClipExt; + +mod container; +pub use self::container::Container; +pub use self::container::GESContainerExt; + +mod effect; +pub use self::effect::Effect; +pub use self::effect::EffectExt; + +mod extractable; +pub use self::extractable::Extractable; +pub use self::extractable::ExtractableExt; + +mod group; +pub use self::group::Group; +pub use self::group::GroupExt; + +mod layer; +pub use self::layer::Layer; +pub use self::layer::LayerExt; + +mod pipeline; +pub use self::pipeline::Pipeline; +pub use self::pipeline::PipelineExt; + +mod project; +pub use self::project::Project; +pub use self::project::ProjectExt; + +mod timeline; +pub use self::timeline::Timeline; +pub use self::timeline::TimelineExt; + +mod timeline_element; +pub use self::timeline_element::TimelineElement; +pub use self::timeline_element::TimelineElementExt; + +mod track; +pub use self::track::Track; +pub use self::track::TrackExt; + +mod track_element; +pub use self::track_element::TrackElement; +pub use self::track_element::TrackElementExt; + +mod uri_clip; +pub use self::uri_clip::UriClip; +pub use self::uri_clip::UriClipExt; + +mod uri_clip_asset; +pub use self::uri_clip_asset::UriClipAsset; +pub use self::uri_clip_asset::UriClipAssetExt; + +mod uri_source_asset; +pub use self::uri_source_asset::UriSourceAsset; +pub use self::uri_source_asset::UriSourceAssetExt; + +mod enums; +pub use self::enums::Edge; +pub use self::enums::EditMode; + +mod flags; +pub use self::flags::PipelineFlags; +pub use self::flags::TrackType; + +#[doc(hidden)] +pub mod traits { + pub use super::AssetExt; + pub use super::ClipExt; + pub use super::GESContainerExt; + pub use super::EffectExt; + pub use super::ExtractableExt; + pub use super::GroupExt; + pub use super::LayerExt; + pub use super::PipelineExt; + pub use super::ProjectExt; + pub use super::TimelineExt; + pub use super::TimelineElementExt; + pub use super::TrackExt; + pub use super::TrackElementExt; + pub use super::UriClipExt; + pub use super::UriClipAssetExt; + pub use super::UriSourceAssetExt; +} diff --git a/gstreamer-editing-services/src/auto/pipeline.rs b/gstreamer-editing-services/src/auto/pipeline.rs new file mode 100644 index 000000000..f1b1417bc --- /dev/null +++ b/gstreamer-editing-services/src/auto/pipeline.rs @@ -0,0 +1,324 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Error; +use PipelineFlags; +use Timeline; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use gst_ffi; +use gst_pbutils; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct Pipeline(Object): [ + gst::Pipeline => gst_ffi::GstPipeline, + gst::Element => gst_ffi::GstElement, + gst::Object => gst_ffi::GstObject, + ]; + + match fn { + get_type => || ffi::ges_pipeline_get_type(), + } +} + +impl Pipeline { + pub fn new() -> Pipeline { + assert_initialized_main_thread!(); + unsafe { + from_glib_none(ffi::ges_pipeline_new()) + } + } +} + +impl Default for Pipeline { + fn default() -> Self { + Self::new() + } +} + +pub trait PipelineExt { + fn get_mode(&self) -> PipelineFlags; + + fn get_thumbnail(&self, caps: &gst::Caps) -> Option; + + fn get_thumbnail_rgb24(&self, width: i32, height: i32) -> Option; + + fn preview_get_audio_sink(&self) -> Option; + + fn preview_get_video_sink(&self) -> Option; + + fn preview_set_audio_sink>(&self, sink: &P); + + fn preview_set_video_sink>(&self, sink: &P); + + fn save_thumbnail(&self, width: i32, height: i32, format: &str, location: &str) -> Result<(), Error>; + + fn set_mode(&self, mode: PipelineFlags) -> bool; + + fn set_render_settings>(&self, output_uri: &str, profile: &P) -> bool; + + fn set_timeline(&self, timeline: &Timeline) -> bool; + + fn get_property_audio_filter(&self) -> Option; + + fn set_property_audio_filter + IsA + glib::value::SetValueOptional>(&self, audio_filter: Option<&P>); + + fn get_property_audio_sink(&self) -> Option; + + fn set_property_audio_sink + IsA + glib::value::SetValueOptional>(&self, audio_sink: Option<&P>); + + fn get_property_timeline(&self) -> Option; + + fn get_property_video_filter(&self) -> Option; + + fn set_property_video_filter + IsA + glib::value::SetValueOptional>(&self, video_filter: Option<&P>); + + fn get_property_video_sink(&self) -> Option; + + fn set_property_video_sink + IsA + glib::value::SetValueOptional>(&self, video_sink: Option<&P>); + + fn connect_property_audio_filter_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_audio_sink_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_mode_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_timeline_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_video_filter_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_video_sink_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> PipelineExt for O { + fn get_mode(&self) -> PipelineFlags { + unsafe { + from_glib(ffi::ges_pipeline_get_mode(self.to_glib_none().0)) + } + } + + fn get_thumbnail(&self, caps: &gst::Caps) -> Option { + unsafe { + from_glib_full(ffi::ges_pipeline_get_thumbnail(self.to_glib_none().0, caps.to_glib_none().0)) + } + } + + fn get_thumbnail_rgb24(&self, width: i32, height: i32) -> Option { + unsafe { + from_glib_full(ffi::ges_pipeline_get_thumbnail_rgb24(self.to_glib_none().0, width, height)) + } + } + + fn preview_get_audio_sink(&self) -> Option { + unsafe { + from_glib_full(ffi::ges_pipeline_preview_get_audio_sink(self.to_glib_none().0)) + } + } + + fn preview_get_video_sink(&self) -> Option { + unsafe { + from_glib_full(ffi::ges_pipeline_preview_get_video_sink(self.to_glib_none().0)) + } + } + + fn preview_set_audio_sink>(&self, sink: &P) { + unsafe { + ffi::ges_pipeline_preview_set_audio_sink(self.to_glib_none().0, sink.to_glib_none().0); + } + } + + fn preview_set_video_sink>(&self, sink: &P) { + unsafe { + ffi::ges_pipeline_preview_set_video_sink(self.to_glib_none().0, sink.to_glib_none().0); + } + } + + fn save_thumbnail(&self, width: i32, height: i32, format: &str, location: &str) -> Result<(), Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ges_pipeline_save_thumbnail(self.to_glib_none().0, width, height, format.to_glib_none().0, location.to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn set_mode(&self, mode: PipelineFlags) -> bool { + unsafe { + from_glib(ffi::ges_pipeline_set_mode(self.to_glib_none().0, mode.to_glib())) + } + } + + fn set_render_settings>(&self, output_uri: &str, profile: &P) -> bool { + unsafe { + from_glib(ffi::ges_pipeline_set_render_settings(self.to_glib_none().0, output_uri.to_glib_none().0, profile.to_glib_none().0)) + } + } + + fn set_timeline(&self, timeline: &Timeline) -> bool { + unsafe { + from_glib(ffi::ges_pipeline_set_timeline(self.to_glib_none().0, timeline.to_glib_full())) + } + } + + fn get_property_audio_filter(&self) -> Option { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "audio-filter".to_glib_none().0, value.to_glib_none_mut().0); + value.get() + } + } + + fn set_property_audio_filter + IsA + glib::value::SetValueOptional>(&self, audio_filter: Option<&P>) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "audio-filter".to_glib_none().0, Value::from(audio_filter).to_glib_none().0); + } + } + + fn get_property_audio_sink(&self) -> Option { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "audio-sink".to_glib_none().0, value.to_glib_none_mut().0); + value.get() + } + } + + fn set_property_audio_sink + IsA + glib::value::SetValueOptional>(&self, audio_sink: Option<&P>) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "audio-sink".to_glib_none().0, Value::from(audio_sink).to_glib_none().0); + } + } + + fn get_property_timeline(&self) -> Option { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "timeline".to_glib_none().0, value.to_glib_none_mut().0); + value.get() + } + } + + fn get_property_video_filter(&self) -> Option { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-filter".to_glib_none().0, value.to_glib_none_mut().0); + value.get() + } + } + + fn set_property_video_filter + IsA + glib::value::SetValueOptional>(&self, video_filter: Option<&P>) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "video-filter".to_glib_none().0, Value::from(video_filter).to_glib_none().0); + } + } + + fn get_property_video_sink(&self) -> Option { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "video-sink".to_glib_none().0, value.to_glib_none_mut().0); + value.get() + } + } + + fn set_property_video_sink + IsA + glib::value::SetValueOptional>(&self, video_sink: Option<&P>) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "video-sink".to_glib_none().0, Value::from(video_sink).to_glib_none().0); + } + } + + fn connect_property_audio_filter_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::audio-filter", + transmute(notify_audio_filter_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_audio_sink_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::audio-sink", + transmute(notify_audio_sink_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_mode_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::mode", + transmute(notify_mode_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_timeline_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::timeline", + transmute(notify_timeline_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_video_filter_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::video-filter", + transmute(notify_video_filter_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_video_sink_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::video-sink", + transmute(notify_video_sink_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn notify_audio_filter_trampoline

(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Pipeline::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_audio_sink_trampoline

(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Pipeline::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_mode_trampoline

(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Pipeline::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_timeline_trampoline

(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Pipeline::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_video_filter_trampoline

(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Pipeline::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_video_sink_trampoline

(this: *mut ffi::GESPipeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Pipeline::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/project.rs b/gstreamer-editing-services/src/auto/project.rs new file mode 100644 index 000000000..e6c6d4da0 --- /dev/null +++ b/gstreamer-editing-services/src/auto/project.rs @@ -0,0 +1,265 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Asset; +use Error; +use Timeline; +use ffi; +use glib; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst_pbutils; +use libc; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct Project(Object): Asset; + + match fn { + get_type => || ffi::ges_project_get_type(), + } +} + +impl Project { + pub fn new<'a, P: Into>>(uri: P) -> Project { + assert_initialized_main_thread!(); + let uri = uri.into(); + let uri = uri.to_glib_none(); + unsafe { + from_glib_full(ffi::ges_project_new(uri.0)) + } + } +} + +pub trait ProjectExt { + fn add_asset>(&self, asset: &P) -> bool; + + fn add_encoding_profile>(&self, profile: &P) -> bool; + + fn create_asset<'a, P: Into>>(&self, id: P, extractable_type: glib::types::Type) -> bool; + + fn create_asset_sync<'a, P: Into>>(&self, id: P, extractable_type: glib::types::Type) -> Result, Error>; + + fn get_asset(&self, id: &str, extractable_type: glib::types::Type) -> Option; + + fn get_loading_assets(&self) -> Vec; + + fn get_uri(&self) -> Option; + + fn list_assets(&self, filter: glib::types::Type) -> Vec; + + fn list_encoding_profiles(&self) -> Vec; + + fn load(&self, timeline: &Timeline) -> Result<(), Error>; + + fn remove_asset>(&self, asset: &P) -> bool; + + fn save<'a, P: IsA + 'a, Q: Into>>(&self, timeline: &Timeline, uri: &str, formatter_asset: Q, overwrite: bool) -> Result<(), Error>; + + fn connect_asset_added(&self, f: F) -> SignalHandlerId; + + fn connect_asset_loading(&self, f: F) -> SignalHandlerId; + + fn connect_asset_removed(&self, f: F) -> SignalHandlerId; + + fn connect_error_loading_asset(&self, f: F) -> SignalHandlerId; + + fn connect_loaded(&self, f: F) -> SignalHandlerId; + + fn connect_missing_uri Option + 'static>(&self, f: F) -> SignalHandlerId; + + fn connect_property_uri_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> ProjectExt for O { + fn add_asset>(&self, asset: &P) -> bool { + unsafe { + from_glib(ffi::ges_project_add_asset(self.to_glib_none().0, asset.to_glib_none().0)) + } + } + + fn add_encoding_profile>(&self, profile: &P) -> bool { + unsafe { + from_glib(ffi::ges_project_add_encoding_profile(self.to_glib_none().0, profile.to_glib_none().0)) + } + } + + fn create_asset<'a, P: Into>>(&self, id: P, extractable_type: glib::types::Type) -> bool { + let id = id.into(); + let id = id.to_glib_none(); + unsafe { + from_glib(ffi::ges_project_create_asset(self.to_glib_none().0, id.0, extractable_type.to_glib())) + } + } + + fn create_asset_sync<'a, P: Into>>(&self, id: P, extractable_type: glib::types::Type) -> Result, Error> { + let id = id.into(); + let id = id.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::ges_project_create_asset_sync(self.to_glib_none().0, id.0, extractable_type.to_glib(), &mut error); + if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } + } + } + + fn get_asset(&self, id: &str, extractable_type: glib::types::Type) -> Option { + unsafe { + from_glib_full(ffi::ges_project_get_asset(self.to_glib_none().0, id.to_glib_none().0, extractable_type.to_glib())) + } + } + + fn get_loading_assets(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ges_project_get_loading_assets(self.to_glib_none().0)) + } + } + + fn get_uri(&self) -> Option { + unsafe { + from_glib_full(ffi::ges_project_get_uri(self.to_glib_none().0)) + } + } + + fn list_assets(&self, filter: glib::types::Type) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ges_project_list_assets(self.to_glib_none().0, filter.to_glib())) + } + } + + fn list_encoding_profiles(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_none(ffi::ges_project_list_encoding_profiles(self.to_glib_none().0)) + } + } + + fn load(&self, timeline: &Timeline) -> Result<(), Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ges_project_load(self.to_glib_none().0, timeline.to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn remove_asset>(&self, asset: &P) -> bool { + unsafe { + from_glib(ffi::ges_project_remove_asset(self.to_glib_none().0, asset.to_glib_none().0)) + } + } + + fn save<'a, P: IsA + 'a, Q: Into>>(&self, timeline: &Timeline, uri: &str, formatter_asset: Q, overwrite: bool) -> Result<(), Error> { + let formatter_asset = formatter_asset.into(); + let formatter_asset = formatter_asset.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ges_project_save(self.to_glib_none().0, timeline.to_glib_none().0, uri.to_glib_none().0, formatter_asset.0, overwrite.to_glib(), &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn connect_asset_added(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "asset-added", + transmute(asset_added_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_asset_loading(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "asset-loading", + transmute(asset_loading_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_asset_removed(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "asset-removed", + transmute(asset_removed_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_error_loading_asset(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "error-loading-asset", + transmute(error_loading_asset_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_loaded(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "loaded", + transmute(loaded_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_missing_uri Option + 'static>(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_ Option + 'static>> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "missing-uri", + transmute(missing_uri_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_uri_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::uri", + transmute(notify_uri_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn asset_added_trampoline

(this: *mut ffi::GESProject, asset: *mut ffi::GESAsset, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &Asset) + 'static) = transmute(f); + f(&Project::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(asset)) +} + +unsafe extern "C" fn asset_loading_trampoline

(this: *mut ffi::GESProject, asset: *mut ffi::GESAsset, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &Asset) + 'static) = transmute(f); + f(&Project::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(asset)) +} + +unsafe extern "C" fn asset_removed_trampoline

(this: *mut ffi::GESProject, asset: *mut ffi::GESAsset, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &Asset) + 'static) = transmute(f); + f(&Project::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(asset)) +} + +unsafe extern "C" fn error_loading_asset_trampoline

(this: *mut ffi::GESProject, error: *mut glib_ffi::GError, id: *mut libc::c_char, extractable_type: glib_ffi::GType, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &Error, &str, glib::types::Type) + 'static) = transmute(f); + f(&Project::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(error), &String::from_glib_none(id), from_glib(extractable_type)) +} + +unsafe extern "C" fn loaded_trampoline

(this: *mut ffi::GESProject, timeline: *mut ffi::GESTimeline, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &Timeline) + 'static) = transmute(f); + f(&Project::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(timeline)) +} + +unsafe extern "C" fn missing_uri_trampoline

(this: *mut ffi::GESProject, error: *mut glib_ffi::GError, wrong_asset: *mut ffi::GESAsset, f: glib_ffi::gpointer) -> *mut libc::c_char +where P: IsA { + let f: &&(Fn(&P, &Error, &Asset) -> Option + 'static) = transmute(f); + f(&Project::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(error), &from_glib_borrow(wrong_asset)).to_glib_full() +} + +unsafe extern "C" fn notify_uri_trampoline

(this: *mut ffi::GESProject, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Project::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/timeline.rs b/gstreamer-editing-services/src/auto/timeline.rs new file mode 100644 index 000000000..86e2f2926 --- /dev/null +++ b/gstreamer-editing-services/src/auto/timeline.rs @@ -0,0 +1,460 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Asset; +use Error; +use Extractable; +use Group; +use Layer; +use TimelineElement; +use Track; +use TrackElement; +use ffi; +use glib; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use gst_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct Timeline(Object): [ + gst::Element => gst_ffi::GstElement, + gst::Object => gst_ffi::GstObject, + Extractable, + ]; + + match fn { + get_type => || ffi::ges_timeline_get_type(), + } +} + +impl Timeline { + pub fn new() -> Timeline { + assert_initialized_main_thread!(); + unsafe { + from_glib_none(ffi::ges_timeline_new()) + } + } + + pub fn new_audio_video() -> Timeline { + assert_initialized_main_thread!(); + unsafe { + from_glib_none(ffi::ges_timeline_new_audio_video()) + } + } + + pub fn new_from_uri(uri: &str) -> Result, Error> { + assert_initialized_main_thread!(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::ges_timeline_new_from_uri(uri.to_glib_none().0, &mut error); + if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) } + } + } +} + +impl Default for Timeline { + fn default() -> Self { + Self::new() + } +} + +pub trait TimelineExt { + fn add_layer(&self, layer: &Layer) -> bool; + + fn add_track>(&self, track: &P) -> bool; + + fn append_layer(&self) -> Layer; + + fn commit(&self) -> bool; + + fn commit_sync(&self) -> bool; + + fn get_auto_transition(&self) -> bool; + + fn get_duration(&self) -> gst::ClockTime; + + fn get_element(&self, name: &str) -> Option; + + fn get_groups(&self) -> Vec; + + fn get_layer(&self, priority: u32) -> Option; + + fn get_layers(&self) -> Vec; + + fn get_pad_for_track>(&self, track: &P) -> Option; + + fn get_snapping_distance(&self) -> gst::ClockTime; + + fn get_track_for_pad>(&self, pad: &P) -> Option; + + fn get_tracks(&self) -> Vec; + + fn is_empty(&self) -> bool; + + fn load_from_uri(&self, uri: &str) -> Result<(), Error>; + + fn move_layer(&self, layer: &Layer, new_layer_priority: u32) -> bool; + + fn paste_element>(&self, element: &P, position: gst::ClockTime, layer_priority: i32) -> Option; + + fn remove_layer(&self, layer: &Layer) -> bool; + + fn remove_track>(&self, track: &P) -> bool; + + fn save_to_uri<'a, P: IsA + 'a, Q: Into>>(&self, uri: &str, formatter_asset: Q, overwrite: bool) -> Result<(), Error>; + + fn set_auto_transition(&self, auto_transition: bool); + + fn set_snapping_distance(&self, snapping_distance: gst::ClockTime); + + fn connect_commited(&self, f: F) -> SignalHandlerId; + + fn connect_group_added(&self, f: F) -> SignalHandlerId; + + //fn connect_group_removed(&self, f: F) -> SignalHandlerId; + + fn connect_layer_added(&self, f: F) -> SignalHandlerId; + + fn connect_layer_removed(&self, f: F) -> SignalHandlerId; + + //fn connect_select_tracks_for_object(&self, f: F) -> SignalHandlerId; + + fn connect_snapping_ended(&self, f: F) -> SignalHandlerId; + + fn connect_snapping_started(&self, f: F) -> SignalHandlerId; + + fn connect_track_added(&self, f: F) -> SignalHandlerId; + + fn connect_track_removed(&self, f: F) -> SignalHandlerId; + + fn connect_property_auto_transition_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_snapping_distance_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> TimelineExt for O { + fn add_layer(&self, layer: &Layer) -> bool { + unsafe { + from_glib(ffi::ges_timeline_add_layer(self.to_glib_none().0, layer.to_glib_none().0)) + } + } + + fn add_track>(&self, track: &P) -> bool { + unsafe { + from_glib(ffi::ges_timeline_add_track(self.to_glib_none().0, track.to_glib_full())) + } + } + + fn append_layer(&self) -> Layer { + unsafe { + from_glib_none(ffi::ges_timeline_append_layer(self.to_glib_none().0)) + } + } + + fn commit(&self) -> bool { + unsafe { + from_glib(ffi::ges_timeline_commit(self.to_glib_none().0)) + } + } + + fn commit_sync(&self) -> bool { + unsafe { + from_glib(ffi::ges_timeline_commit_sync(self.to_glib_none().0)) + } + } + + fn get_auto_transition(&self) -> bool { + unsafe { + from_glib(ffi::ges_timeline_get_auto_transition(self.to_glib_none().0)) + } + } + + fn get_duration(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::ges_timeline_get_duration(self.to_glib_none().0)) + } + } + + fn get_element(&self, name: &str) -> Option { + unsafe { + from_glib_full(ffi::ges_timeline_get_element(self.to_glib_none().0, name.to_glib_none().0)) + } + } + + fn get_groups(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_none(ffi::ges_timeline_get_groups(self.to_glib_none().0)) + } + } + + fn get_layer(&self, priority: u32) -> Option { + unsafe { + from_glib_full(ffi::ges_timeline_get_layer(self.to_glib_none().0, priority)) + } + } + + fn get_layers(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ges_timeline_get_layers(self.to_glib_none().0)) + } + } + + fn get_pad_for_track>(&self, track: &P) -> Option { + unsafe { + from_glib_none(ffi::ges_timeline_get_pad_for_track(self.to_glib_none().0, track.to_glib_none().0)) + } + } + + fn get_snapping_distance(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::ges_timeline_get_snapping_distance(self.to_glib_none().0)) + } + } + + fn get_track_for_pad>(&self, pad: &P) -> Option { + unsafe { + from_glib_none(ffi::ges_timeline_get_track_for_pad(self.to_glib_none().0, pad.to_glib_none().0)) + } + } + + fn get_tracks(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ges_timeline_get_tracks(self.to_glib_none().0)) + } + } + + fn is_empty(&self) -> bool { + unsafe { + from_glib(ffi::ges_timeline_is_empty(self.to_glib_none().0)) + } + } + + fn load_from_uri(&self, uri: &str) -> Result<(), Error> { + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ges_timeline_load_from_uri(self.to_glib_none().0, uri.to_glib_none().0, &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn move_layer(&self, layer: &Layer, new_layer_priority: u32) -> bool { + unsafe { + from_glib(ffi::ges_timeline_move_layer(self.to_glib_none().0, layer.to_glib_none().0, new_layer_priority)) + } + } + + fn paste_element>(&self, element: &P, position: gst::ClockTime, layer_priority: i32) -> Option { + unsafe { + from_glib_none(ffi::ges_timeline_paste_element(self.to_glib_none().0, element.to_glib_none().0, position.to_glib(), layer_priority)) + } + } + + fn remove_layer(&self, layer: &Layer) -> bool { + unsafe { + from_glib(ffi::ges_timeline_remove_layer(self.to_glib_none().0, layer.to_glib_none().0)) + } + } + + fn remove_track>(&self, track: &P) -> bool { + unsafe { + from_glib(ffi::ges_timeline_remove_track(self.to_glib_none().0, track.to_glib_none().0)) + } + } + + fn save_to_uri<'a, P: IsA + 'a, Q: Into>>(&self, uri: &str, formatter_asset: Q, overwrite: bool) -> Result<(), Error> { + let formatter_asset = formatter_asset.into(); + let formatter_asset = formatter_asset.to_glib_none(); + unsafe { + let mut error = ptr::null_mut(); + let _ = ffi::ges_timeline_save_to_uri(self.to_glib_none().0, uri.to_glib_none().0, formatter_asset.0, overwrite.to_glib(), &mut error); + if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } + } + } + + fn set_auto_transition(&self, auto_transition: bool) { + unsafe { + ffi::ges_timeline_set_auto_transition(self.to_glib_none().0, auto_transition.to_glib()); + } + } + + fn set_snapping_distance(&self, snapping_distance: gst::ClockTime) { + unsafe { + ffi::ges_timeline_set_snapping_distance(self.to_glib_none().0, snapping_distance.to_glib()); + } + } + + fn connect_commited(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "commited", + transmute(commited_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_group_added(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "group-added", + transmute(group_added_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + //fn connect_group_removed(&self, f: F) -> SignalHandlerId { + // Empty ctype children: *.PtrArray TypeId { ns_id: 1, id: 51 } + //} + + fn connect_layer_added(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "layer-added", + transmute(layer_added_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_layer_removed(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "layer-removed", + transmute(layer_removed_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + //fn connect_select_tracks_for_object(&self, f: F) -> SignalHandlerId { + // Empty ctype return value *.PtrArray TypeId { ns_id: 1, id: 16 } + //} + + fn connect_snapping_ended(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "snapping-ended", + transmute(snapping_ended_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_snapping_started(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "snapping-started", + transmute(snapping_started_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_track_added(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "track-added", + transmute(track_added_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_track_removed(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "track-removed", + transmute(track_removed_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_auto_transition_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::auto-transition", + transmute(notify_auto_transition_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::duration", + transmute(notify_duration_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_snapping_distance_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::snapping-distance", + transmute(notify_snapping_distance_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn commited_trampoline

(this: *mut ffi::GESTimeline, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Timeline::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn group_added_trampoline

(this: *mut ffi::GESTimeline, group: *mut ffi::GESGroup, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &Group) + 'static) = transmute(f); + f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(group)) +} + +unsafe extern "C" fn layer_added_trampoline

(this: *mut ffi::GESTimeline, layer: *mut ffi::GESLayer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &Layer) + 'static) = transmute(f); + f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(layer)) +} + +unsafe extern "C" fn layer_removed_trampoline

(this: *mut ffi::GESTimeline, layer: *mut ffi::GESLayer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &Layer) + 'static) = transmute(f); + f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(layer)) +} + +unsafe extern "C" fn snapping_ended_trampoline

(this: *mut ffi::GESTimeline, object: *mut ffi::GESTrackElement, p0: *mut ffi::GESTrackElement, p1: u64, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &TrackElement, &TrackElement, u64) + 'static) = transmute(f); + f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object), &from_glib_borrow(p0), p1) +} + +unsafe extern "C" fn snapping_started_trampoline

(this: *mut ffi::GESTimeline, object: *mut ffi::GESTrackElement, p0: *mut ffi::GESTrackElement, p1: u64, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &TrackElement, &TrackElement, u64) + 'static) = transmute(f); + f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(object), &from_glib_borrow(p0), p1) +} + +unsafe extern "C" fn track_added_trampoline

(this: *mut ffi::GESTimeline, track: *mut ffi::GESTrack, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &Track) + 'static) = transmute(f); + f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(track)) +} + +unsafe extern "C" fn track_removed_trampoline

(this: *mut ffi::GESTimeline, track: *mut ffi::GESTrack, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &Track) + 'static) = transmute(f); + f(&Timeline::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(track)) +} + +unsafe extern "C" fn notify_auto_transition_trampoline

(this: *mut ffi::GESTimeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Timeline::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_duration_trampoline

(this: *mut ffi::GESTimeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Timeline::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_snapping_distance_trampoline

(this: *mut ffi::GESTimeline, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Timeline::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/timeline_element.rs b/gstreamer-editing-services/src/auto/timeline_element.rs new file mode 100644 index 000000000..626c14389 --- /dev/null +++ b/gstreamer-editing-services/src/auto/timeline_element.rs @@ -0,0 +1,495 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Extractable; +use Timeline; +use TrackType; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct TimelineElement(Object): Extractable; + + match fn { + get_type => || ffi::ges_timeline_element_get_type(), + } +} + +pub trait TimelineElementExt { + //fn add_child_property, Q: IsA>(&self, pspec: &P, child: &Q) -> bool; + + fn copy(&self, deep: bool) -> Option; + + //fn get_child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs); + + //fn get_child_property(&self, property_name: &str, value: /*Ignored*/glib::Value) -> bool; + + //fn get_child_property_by_pspec>(&self, pspec: &P, value: /*Ignored*/glib::Value); + + //fn get_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported); + + fn get_duration(&self) -> gst::ClockTime; + + fn get_inpoint(&self) -> gst::ClockTime; + + fn get_max_duration(&self) -> gst::ClockTime; + + fn get_name(&self) -> Option; + + fn get_parent(&self) -> Option; + + fn get_priority(&self) -> u32; + + fn get_start(&self) -> gst::ClockTime; + + fn get_timeline(&self) -> Option; + + fn get_toplevel_parent(&self) -> Option; + + fn get_track_types(&self) -> TrackType; + + //fn list_children_properties(&self) -> /*Ignored*/Vec; + + //fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option; + + fn paste(&self, paste_position: gst::ClockTime) -> Option; + + //fn remove_child_property>(&self, pspec: &P) -> bool; + + fn ripple(&self, start: gst::ClockTime) -> bool; + + fn ripple_end(&self, end: gst::ClockTime) -> bool; + + fn roll_end(&self, end: gst::ClockTime) -> bool; + + fn roll_start(&self, start: gst::ClockTime) -> bool; + + //fn set_child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs); + + //fn set_child_property(&self, property_name: &str, value: /*Ignored*/&mut glib::Value) -> bool; + + //fn set_child_property_by_pspec>(&self, pspec: &P, value: /*Ignored*/&mut glib::Value); + + //fn set_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported); + + fn set_duration(&self, duration: gst::ClockTime); + + fn set_inpoint(&self, inpoint: gst::ClockTime); + + fn set_max_duration(&self, maxduration: gst::ClockTime); + + fn set_name<'a, P: Into>>(&self, name: P) -> bool; + + fn set_parent>(&self, parent: &P) -> bool; + + fn set_priority(&self, priority: u32); + + fn set_start(&self, start: gst::ClockTime); + + fn set_timeline(&self, timeline: &Timeline) -> bool; + + fn trim(&self, start: gst::ClockTime) -> bool; + + fn get_property_in_point(&self) -> u64; + + fn set_property_in_point(&self, in_point: u64); + + fn get_property_serialize(&self) -> bool; + + fn set_property_serialize(&self, serialize: bool); + + //fn connect_deep_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_in_point_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_max_duration_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_name_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_parent_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_priority_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_serialize_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_start_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_timeline_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> TimelineElementExt for O { + //fn add_child_property, Q: IsA>(&self, pspec: &P, child: &Q) -> bool { + // unsafe { TODO: call ffi::ges_timeline_element_add_child_property() } + //} + + fn copy(&self, deep: bool) -> Option { + unsafe { + from_glib_none(ffi::ges_timeline_element_copy(self.to_glib_none().0, deep.to_glib())) + } + } + + //fn get_child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { + // unsafe { TODO: call ffi::ges_timeline_element_get_child_properties() } + //} + + //fn get_child_property(&self, property_name: &str, value: /*Ignored*/glib::Value) -> bool { + // unsafe { TODO: call ffi::ges_timeline_element_get_child_property() } + //} + + //fn get_child_property_by_pspec>(&self, pspec: &P, value: /*Ignored*/glib::Value) { + // unsafe { TODO: call ffi::ges_timeline_element_get_child_property_by_pspec() } + //} + + //fn get_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) { + // unsafe { TODO: call ffi::ges_timeline_element_get_child_property_valist() } + //} + + fn get_duration(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::ges_timeline_element_get_duration(self.to_glib_none().0)) + } + } + + fn get_inpoint(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::ges_timeline_element_get_inpoint(self.to_glib_none().0)) + } + } + + fn get_max_duration(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::ges_timeline_element_get_max_duration(self.to_glib_none().0)) + } + } + + fn get_name(&self) -> Option { + unsafe { + from_glib_full(ffi::ges_timeline_element_get_name(self.to_glib_none().0)) + } + } + + fn get_parent(&self) -> Option { + unsafe { + from_glib_full(ffi::ges_timeline_element_get_parent(self.to_glib_none().0)) + } + } + + fn get_priority(&self) -> u32 { + unsafe { + ffi::ges_timeline_element_get_priority(self.to_glib_none().0) + } + } + + fn get_start(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::ges_timeline_element_get_start(self.to_glib_none().0)) + } + } + + fn get_timeline(&self) -> Option { + unsafe { + from_glib_full(ffi::ges_timeline_element_get_timeline(self.to_glib_none().0)) + } + } + + fn get_toplevel_parent(&self) -> Option { + unsafe { + from_glib_full(ffi::ges_timeline_element_get_toplevel_parent(self.to_glib_none().0)) + } + } + + fn get_track_types(&self) -> TrackType { + unsafe { + from_glib(ffi::ges_timeline_element_get_track_types(self.to_glib_none().0)) + } + } + + //fn list_children_properties(&self) -> /*Ignored*/Vec { + // unsafe { TODO: call ffi::ges_timeline_element_list_children_properties() } + //} + + //fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option { + // unsafe { TODO: call ffi::ges_timeline_element_lookup_child() } + //} + + fn paste(&self, paste_position: gst::ClockTime) -> Option { + unsafe { + from_glib_none(ffi::ges_timeline_element_paste(self.to_glib_none().0, paste_position.to_glib())) + } + } + + //fn remove_child_property>(&self, pspec: &P) -> bool { + // unsafe { TODO: call ffi::ges_timeline_element_remove_child_property() } + //} + + fn ripple(&self, start: gst::ClockTime) -> bool { + unsafe { + from_glib(ffi::ges_timeline_element_ripple(self.to_glib_none().0, start.to_glib())) + } + } + + fn ripple_end(&self, end: gst::ClockTime) -> bool { + unsafe { + from_glib(ffi::ges_timeline_element_ripple_end(self.to_glib_none().0, end.to_glib())) + } + } + + fn roll_end(&self, end: gst::ClockTime) -> bool { + unsafe { + from_glib(ffi::ges_timeline_element_roll_end(self.to_glib_none().0, end.to_glib())) + } + } + + fn roll_start(&self, start: gst::ClockTime) -> bool { + unsafe { + from_glib(ffi::ges_timeline_element_roll_start(self.to_glib_none().0, start.to_glib())) + } + } + + //fn set_child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) { + // unsafe { TODO: call ffi::ges_timeline_element_set_child_properties() } + //} + + //fn set_child_property(&self, property_name: &str, value: /*Ignored*/&mut glib::Value) -> bool { + // unsafe { TODO: call ffi::ges_timeline_element_set_child_property() } + //} + + //fn set_child_property_by_pspec>(&self, pspec: &P, value: /*Ignored*/&mut glib::Value) { + // unsafe { TODO: call ffi::ges_timeline_element_set_child_property_by_pspec() } + //} + + //fn set_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) { + // unsafe { TODO: call ffi::ges_timeline_element_set_child_property_valist() } + //} + + fn set_duration(&self, duration: gst::ClockTime) { + unsafe { + ffi::ges_timeline_element_set_duration(self.to_glib_none().0, duration.to_glib()); + } + } + + fn set_inpoint(&self, inpoint: gst::ClockTime) { + unsafe { + ffi::ges_timeline_element_set_inpoint(self.to_glib_none().0, inpoint.to_glib()); + } + } + + fn set_max_duration(&self, maxduration: gst::ClockTime) { + unsafe { + ffi::ges_timeline_element_set_max_duration(self.to_glib_none().0, maxduration.to_glib()); + } + } + + fn set_name<'a, P: Into>>(&self, name: P) -> bool { + let name = name.into(); + let name = name.to_glib_none(); + unsafe { + from_glib(ffi::ges_timeline_element_set_name(self.to_glib_none().0, name.0)) + } + } + + fn set_parent>(&self, parent: &P) -> bool { + unsafe { + from_glib(ffi::ges_timeline_element_set_parent(self.to_glib_none().0, parent.to_glib_none().0)) + } + } + + fn set_priority(&self, priority: u32) { + unsafe { + ffi::ges_timeline_element_set_priority(self.to_glib_none().0, priority); + } + } + + fn set_start(&self, start: gst::ClockTime) { + unsafe { + ffi::ges_timeline_element_set_start(self.to_glib_none().0, start.to_glib()); + } + } + + fn set_timeline(&self, timeline: &Timeline) -> bool { + unsafe { + from_glib(ffi::ges_timeline_element_set_timeline(self.to_glib_none().0, timeline.to_glib_none().0)) + } + } + + fn trim(&self, start: gst::ClockTime) -> bool { + unsafe { + from_glib(ffi::ges_timeline_element_trim(self.to_glib_none().0, start.to_glib())) + } + } + + fn get_property_in_point(&self) -> u64 { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "in-point".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn set_property_in_point(&self, in_point: u64) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "in-point".to_glib_none().0, Value::from(&in_point).to_glib_none().0); + } + } + + fn get_property_serialize(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "serialize".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn set_property_serialize(&self, serialize: bool) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "serialize".to_glib_none().0, Value::from(&serialize).to_glib_none().0); + } + } + + //fn connect_deep_notify(&self, f: F) -> SignalHandlerId { + // Ignored prop: GObject.ParamSpec + //} + + fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::duration", + transmute(notify_duration_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_in_point_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::in-point", + transmute(notify_in_point_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_max_duration_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::max-duration", + transmute(notify_max_duration_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_name_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::name", + transmute(notify_name_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_parent_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::parent", + transmute(notify_parent_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_priority_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::priority", + transmute(notify_priority_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_serialize_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::serialize", + transmute(notify_serialize_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_start_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::start", + transmute(notify_start_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_timeline_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::timeline", + transmute(notify_timeline_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn notify_duration_trampoline

(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&TimelineElement::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_in_point_trampoline

(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&TimelineElement::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_max_duration_trampoline

(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&TimelineElement::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_name_trampoline

(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&TimelineElement::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_parent_trampoline

(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&TimelineElement::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_priority_trampoline

(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&TimelineElement::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_serialize_trampoline

(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&TimelineElement::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_start_trampoline

(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&TimelineElement::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_timeline_trampoline

(this: *mut ffi::GESTimelineElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&TimelineElement::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/track.rs b/gstreamer-editing-services/src/auto/track.rs new file mode 100644 index 000000000..95f81764b --- /dev/null +++ b/gstreamer-editing-services/src/auto/track.rs @@ -0,0 +1,300 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Timeline; +use TrackElement; +use TrackType; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use gst_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct Track(Object): [ + gst::Element => gst_ffi::GstElement, + gst::Object => gst_ffi::GstObject, + ]; + + match fn { + get_type => || ffi::ges_track_get_type(), + } +} + +impl Track { + pub fn new(type_: TrackType, caps: &gst::Caps) -> Track { + assert_initialized_main_thread!(); + unsafe { + from_glib_none(ffi::ges_track_new(type_.to_glib(), caps.to_glib_full())) + } + } +} + +pub trait TrackExt { + fn add_element>(&self, object: &P) -> bool; + + fn commit(&self) -> bool; + + fn get_caps(&self) -> Option; + + fn get_elements(&self) -> Vec; + + fn get_mixing(&self) -> bool; + + fn get_timeline(&self) -> Option; + + fn remove_element>(&self, object: &P) -> bool; + + //fn set_create_element_for_gap_func(&self, func: /*Unknown conversion*//*Unimplemented*/CreateElementForGapFunc); + + fn set_mixing(&self, mixing: bool); + + fn set_restriction_caps(&self, caps: &gst::Caps); + + fn set_timeline(&self, timeline: &Timeline); + + fn update_restriction_caps(&self, caps: &gst::Caps); + + fn get_property_duration(&self) -> u64; + + fn get_property_restriction_caps(&self) -> Option; + + fn get_property_track_type(&self) -> TrackType; + + fn connect_commited(&self, f: F) -> SignalHandlerId; + + fn connect_track_element_added(&self, f: F) -> SignalHandlerId; + + fn connect_track_element_removed(&self, f: F) -> SignalHandlerId; + + fn connect_property_caps_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_mixing_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_restriction_caps_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_track_type_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> TrackExt for O { + fn add_element>(&self, object: &P) -> bool { + unsafe { + from_glib(ffi::ges_track_add_element(self.to_glib_none().0, object.to_glib_none().0)) + } + } + + fn commit(&self) -> bool { + unsafe { + from_glib(ffi::ges_track_commit(self.to_glib_none().0)) + } + } + + fn get_caps(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_track_get_caps(self.to_glib_none().0)) + } + } + + fn get_elements(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_full(ffi::ges_track_get_elements(self.to_glib_none().0)) + } + } + + fn get_mixing(&self) -> bool { + unsafe { + from_glib(ffi::ges_track_get_mixing(self.to_glib_none().0)) + } + } + + fn get_timeline(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_track_get_timeline(self.to_glib_none().0)) + } + } + + fn remove_element>(&self, object: &P) -> bool { + unsafe { + from_glib(ffi::ges_track_remove_element(self.to_glib_none().0, object.to_glib_none().0)) + } + } + + //fn set_create_element_for_gap_func(&self, func: /*Unknown conversion*//*Unimplemented*/CreateElementForGapFunc) { + // unsafe { TODO: call ffi::ges_track_set_create_element_for_gap_func() } + //} + + fn set_mixing(&self, mixing: bool) { + unsafe { + ffi::ges_track_set_mixing(self.to_glib_none().0, mixing.to_glib()); + } + } + + fn set_restriction_caps(&self, caps: &gst::Caps) { + unsafe { + ffi::ges_track_set_restriction_caps(self.to_glib_none().0, caps.to_glib_none().0); + } + } + + fn set_timeline(&self, timeline: &Timeline) { + unsafe { + ffi::ges_track_set_timeline(self.to_glib_none().0, timeline.to_glib_none().0); + } + } + + fn update_restriction_caps(&self, caps: &gst::Caps) { + unsafe { + ffi::ges_track_update_restriction_caps(self.to_glib_none().0, caps.to_glib_none().0); + } + } + + fn get_property_duration(&self) -> u64 { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "duration".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn get_property_restriction_caps(&self) -> Option { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "restriction-caps".to_glib_none().0, value.to_glib_none_mut().0); + value.get() + } + } + + fn get_property_track_type(&self) -> TrackType { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "track-type".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn connect_commited(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "commited", + transmute(commited_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_track_element_added(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "track-element-added", + transmute(track_element_added_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_track_element_removed(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "track-element-removed", + transmute(track_element_removed_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_caps_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::caps", + transmute(notify_caps_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::duration", + transmute(notify_duration_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_mixing_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::mixing", + transmute(notify_mixing_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_restriction_caps_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::restriction-caps", + transmute(notify_restriction_caps_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_track_type_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::track-type", + transmute(notify_track_type_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn commited_trampoline

(this: *mut ffi::GESTrack, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Track::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn track_element_added_trampoline

(this: *mut ffi::GESTrack, effect: *mut ffi::GESTrackElement, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &TrackElement) + 'static) = transmute(f); + f(&Track::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(effect)) +} + +unsafe extern "C" fn track_element_removed_trampoline

(this: *mut ffi::GESTrack, effect: *mut ffi::GESTrackElement, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P, &TrackElement) + 'static) = transmute(f); + f(&Track::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(effect)) +} + +unsafe extern "C" fn notify_caps_trampoline

(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Track::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_duration_trampoline

(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Track::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_mixing_trampoline

(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Track::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_restriction_caps_trampoline

(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Track::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_track_type_trampoline

(this: *mut ffi::GESTrack, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&Track::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/track_element.rs b/gstreamer-editing-services/src/auto/track_element.rs new file mode 100644 index 000000000..6d4d88ef0 --- /dev/null +++ b/gstreamer-editing-services/src/auto/track_element.rs @@ -0,0 +1,221 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Edge; +use EditMode; +use Extractable; +use Layer; +use TimelineElement; +use Track; +use TrackType; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct TrackElement(Object): TimelineElement, Extractable; + + match fn { + get_type => || ffi::ges_track_element_get_type(), + } +} + +pub trait TrackElementExt { + fn add_children_props>(&self, element: &P, wanted_categories: &[&str], blacklist: &[&str], whitelist: &[&str]); + + fn edit(&self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64) -> bool; + + //fn get_all_control_bindings(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 83 }; + + //fn get_control_binding(&self, property_name: &str) -> /*Ignored*/Option; + + fn get_element(&self) -> Option; + + fn get_gnlobject(&self) -> Option; + + fn get_nleobject(&self) -> Option; + + fn get_track(&self) -> Option; + + fn get_track_type(&self) -> TrackType; + + fn is_active(&self) -> bool; + + //fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option; + + fn remove_control_binding(&self, property_name: &str) -> bool; + + fn set_active(&self, active: bool) -> bool; + + //fn set_control_source(&self, source: /*Ignored*/&gst::ControlSource, property_name: &str, binding_type: &str) -> bool; + + fn set_track_type(&self, type_: TrackType); + + fn get_property_active(&self) -> bool; + + //fn connect_control_binding_added(&self, f: F) -> SignalHandlerId; + + //fn connect_control_binding_removed(&self, f: F) -> SignalHandlerId; + + fn connect_property_active_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_track_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_track_type_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> TrackElementExt for O { + fn add_children_props>(&self, element: &P, wanted_categories: &[&str], blacklist: &[&str], whitelist: &[&str]) { + unsafe { + ffi::ges_track_element_add_children_props(self.to_glib_none().0, element.to_glib_none().0, wanted_categories.to_glib_none().0, blacklist.to_glib_none().0, whitelist.to_glib_none().0); + } + } + + fn edit(&self, layers: &[Layer], mode: EditMode, edge: Edge, position: u64) -> bool { + unsafe { + from_glib(ffi::ges_track_element_edit(self.to_glib_none().0, layers.to_glib_none().0, mode.to_glib(), edge.to_glib(), position)) + } + } + + //fn get_all_control_bindings(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 83 } { + // unsafe { TODO: call ffi::ges_track_element_get_all_control_bindings() } + //} + + //fn get_control_binding(&self, property_name: &str) -> /*Ignored*/Option { + // unsafe { TODO: call ffi::ges_track_element_get_control_binding() } + //} + + fn get_element(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_track_element_get_element(self.to_glib_none().0)) + } + } + + fn get_gnlobject(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_track_element_get_gnlobject(self.to_glib_none().0)) + } + } + + fn get_nleobject(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_track_element_get_nleobject(self.to_glib_none().0)) + } + } + + fn get_track(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_track_element_get_track(self.to_glib_none().0)) + } + } + + fn get_track_type(&self) -> TrackType { + unsafe { + from_glib(ffi::ges_track_element_get_track_type(self.to_glib_none().0)) + } + } + + fn is_active(&self) -> bool { + unsafe { + from_glib(ffi::ges_track_element_is_active(self.to_glib_none().0)) + } + } + + //fn lookup_child(&self, prop_name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option { + // unsafe { TODO: call ffi::ges_track_element_lookup_child() } + //} + + fn remove_control_binding(&self, property_name: &str) -> bool { + unsafe { + from_glib(ffi::ges_track_element_remove_control_binding(self.to_glib_none().0, property_name.to_glib_none().0)) + } + } + + fn set_active(&self, active: bool) -> bool { + unsafe { + from_glib(ffi::ges_track_element_set_active(self.to_glib_none().0, active.to_glib())) + } + } + + //fn set_control_source(&self, source: /*Ignored*/&gst::ControlSource, property_name: &str, binding_type: &str) -> bool { + // unsafe { TODO: call ffi::ges_track_element_set_control_source() } + //} + + fn set_track_type(&self, type_: TrackType) { + unsafe { + ffi::ges_track_element_set_track_type(self.to_glib_none().0, type_.to_glib()); + } + } + + fn get_property_active(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "active".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + //fn connect_control_binding_added(&self, f: F) -> SignalHandlerId { + // Ignored control_binding: Gst.ControlBinding + //} + + //fn connect_control_binding_removed(&self, f: F) -> SignalHandlerId { + // Ignored control_binding: Gst.ControlBinding + //} + + fn connect_property_active_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::active", + transmute(notify_active_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_track_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::track", + transmute(notify_track_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_track_type_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::track-type", + transmute(notify_track_type_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn notify_active_trampoline

(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&TrackElement::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_track_trampoline

(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&TrackElement::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_track_type_trampoline

(this: *mut ffi::GESTrackElement, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&TrackElement::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/uri_clip.rs b/gstreamer-editing-services/src/auto/uri_clip.rs new file mode 100644 index 000000000..1679623d9 --- /dev/null +++ b/gstreamer-editing-services/src/auto/uri_clip.rs @@ -0,0 +1,168 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Clip; +use Container; +use Extractable; +use TimelineElement; +use ffi; +use glib; +use glib::StaticType; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct UriClip(Object): Clip, Container, TimelineElement, Extractable; + + match fn { + get_type => || ffi::ges_uri_clip_get_type(), + } +} + +impl UriClip { + pub fn new(uri: &str) -> UriClip { + assert_initialized_main_thread!(); + unsafe { + from_glib_none(ffi::ges_uri_clip_new(uri.to_glib_none().0)) + } + } +} + +pub trait UriClipExt { + fn get_uri(&self) -> Option; + + fn is_image(&self) -> bool; + + fn is_muted(&self) -> bool; + + fn set_is_image(&self, is_image: bool); + + fn set_mute(&self, mute: bool); + + fn get_property_is_image(&self) -> bool; + + fn get_property_mute(&self) -> bool; + + fn connect_property_is_image_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_mute_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_supported_formats_notify(&self, f: F) -> SignalHandlerId; + + fn connect_property_uri_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> UriClipExt for O { + fn get_uri(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_uri_clip_get_uri(self.to_glib_none().0)) + } + } + + fn is_image(&self) -> bool { + unsafe { + from_glib(ffi::ges_uri_clip_is_image(self.to_glib_none().0)) + } + } + + fn is_muted(&self) -> bool { + unsafe { + from_glib(ffi::ges_uri_clip_is_muted(self.to_glib_none().0)) + } + } + + fn set_is_image(&self, is_image: bool) { + unsafe { + ffi::ges_uri_clip_set_is_image(self.to_glib_none().0, is_image.to_glib()); + } + } + + fn set_mute(&self, mute: bool) { + unsafe { + ffi::ges_uri_clip_set_mute(self.to_glib_none().0, mute.to_glib()); + } + } + + fn get_property_is_image(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "is-image".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn get_property_mute(&self) -> bool { + unsafe { + let mut value = Value::from_type(::static_type()); + gobject_ffi::g_object_get_property(self.to_glib_none().0, "mute".to_glib_none().0, value.to_glib_none_mut().0); + value.get().unwrap() + } + } + + fn connect_property_is_image_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::is-image", + transmute(notify_is_image_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_mute_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::mute", + transmute(notify_mute_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_supported_formats_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::supported-formats", + transmute(notify_supported_formats_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } + + fn connect_property_uri_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::uri", + transmute(notify_uri_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn notify_is_image_trampoline

(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&UriClip::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_mute_trampoline

(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&UriClip::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_supported_formats_trampoline

(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&UriClip::from_glib_borrow(this).downcast_unchecked()) +} + +unsafe extern "C" fn notify_uri_trampoline

(this: *mut ffi::GESUriClip, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&UriClip::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/uri_clip_asset.rs b/gstreamer-editing-services/src/auto/uri_clip_asset.rs new file mode 100644 index 000000000..188a805eb --- /dev/null +++ b/gstreamer-editing-services/src/auto/uri_clip_asset.rs @@ -0,0 +1,106 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Asset; +use Error; +use UriSourceAsset; +use ffi; +use glib; +use glib::Value; +use glib::object::Downcast; +use glib::object::IsA; +use glib::signal::SignalHandlerId; +use glib::signal::connect; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst; +use gst_pbutils; +use std::boxed::Box as Box_; +use std::mem; +use std::mem::transmute; +use std::ptr; + +glib_wrapper! { + pub struct UriClipAsset(Object): Asset; + + match fn { + get_type => || ffi::ges_uri_clip_asset_get_type(), + } +} + +impl UriClipAsset { + //pub fn new<'a, P: Into>, Q: /*Unimplemented*/gio::AsyncReadyCallback>(uri: &str, cancellable: P, callback: Q) { + // unsafe { TODO: call ffi::ges_uri_clip_asset_new() } + //} + + pub fn request_sync(uri: &str) -> Result, Error> { + assert_initialized_main_thread!(); + unsafe { + let mut error = ptr::null_mut(); + let ret = ffi::ges_uri_clip_asset_request_sync(uri.to_glib_none().0, &mut error); + if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) } + } + } +} + +pub trait UriClipAssetExt { + fn get_duration(&self) -> gst::ClockTime; + + fn get_info(&self) -> Option; + + fn get_stream_assets(&self) -> Vec; + + fn is_image(&self) -> bool; + + fn set_property_duration(&self, duration: u64); + + fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId; +} + +impl + IsA> UriClipAssetExt for O { + fn get_duration(&self) -> gst::ClockTime { + unsafe { + from_glib(ffi::ges_uri_clip_asset_get_duration(self.to_glib_none().0)) + } + } + + fn get_info(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_uri_clip_asset_get_info(const_override(self.to_glib_none().0))) + } + } + + fn get_stream_assets(&self) -> Vec { + unsafe { + FromGlibPtrContainer::from_glib_none(ffi::ges_uri_clip_asset_get_stream_assets(self.to_glib_none().0)) + } + } + + fn is_image(&self) -> bool { + unsafe { + from_glib(ffi::ges_uri_clip_asset_is_image(self.to_glib_none().0)) + } + } + + fn set_property_duration(&self, duration: u64) { + unsafe { + gobject_ffi::g_object_set_property(self.to_glib_none().0, "duration".to_glib_none().0, Value::from(&duration).to_glib_none().0); + } + } + + fn connect_property_duration_notify(&self, f: F) -> SignalHandlerId { + unsafe { + let f: Box_> = Box_::new(Box_::new(f)); + connect(self.to_glib_none().0, "notify::duration", + transmute(notify_duration_trampoline:: as usize), Box_::into_raw(f) as *mut _) + } + } +} + +unsafe extern "C" fn notify_duration_trampoline

(this: *mut ffi::GESUriClipAsset, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) +where P: IsA { + let f: &&(Fn(&P) + 'static) = transmute(f); + f(&UriClipAsset::from_glib_borrow(this).downcast_unchecked()) +} diff --git a/gstreamer-editing-services/src/auto/uri_source_asset.rs b/gstreamer-editing-services/src/auto/uri_source_asset.rs new file mode 100644 index 000000000..135027ee0 --- /dev/null +++ b/gstreamer-editing-services/src/auto/uri_source_asset.rs @@ -0,0 +1,50 @@ +// This file was generated by gir (https://github.com/gtk-rs/gir) +// from gir-files (https://github.com/gtk-rs/gir-files) +// DO NOT EDIT + +use Asset; +use UriClipAsset; +use ffi; +use glib::object::IsA; +use glib::translate::*; +use glib_ffi; +use gobject_ffi; +use gst_pbutils; +use std::mem; +use std::ptr; + +glib_wrapper! { + pub struct UriSourceAsset(Object): Asset; + + match fn { + get_type => || ffi::ges_uri_source_asset_get_type(), + } +} + +pub trait UriSourceAssetExt { + fn get_filesource_asset(&self) -> Option; + + fn get_stream_info(&self) -> Option; + + fn get_stream_uri(&self) -> Option; +} + +impl> UriSourceAssetExt for O { + fn get_filesource_asset(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_uri_source_asset_get_filesource_asset(self.to_glib_none().0)) + } + } + + fn get_stream_info(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_uri_source_asset_get_stream_info(self.to_glib_none().0)) + } + } + + fn get_stream_uri(&self) -> Option { + unsafe { + from_glib_none(ffi::ges_uri_source_asset_get_stream_uri(self.to_glib_none().0)) + } + } +} diff --git a/gstreamer-editing-services/src/auto/versions.txt b/gstreamer-editing-services/src/auto/versions.txt new file mode 100644 index 000000000..8cf93d600 --- /dev/null +++ b/gstreamer-editing-services/src/auto/versions.txt @@ -0,0 +1,2 @@ +Generated by gir (https://github.com/gtk-rs/gir @ f5fca82) +from gir-files (https://github.com/gtk-rs/gir-files @ ???) diff --git a/gstreamer-editing-services/src/lib.rs b/gstreamer-editing-services/src/lib.rs new file mode 100644 index 000000000..ffb62175d --- /dev/null +++ b/gstreamer-editing-services/src/lib.rs @@ -0,0 +1,90 @@ +// Copyright (C) 2018 Thibault Saunier +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern crate libc; + +use std::sync::{Once, ONCE_INIT}; + +extern crate gio_sys as gio_ffi; +extern crate glib_sys as glib_ffi; +extern crate gobject_sys as gobject_ffi; +extern crate gstreamer as gst; +extern crate gstreamer_base as gst_base; +extern crate gstreamer_base_sys as gst_base_ffi; +extern crate gstreamer_editing_services_sys as ffi; +extern crate gstreamer_pbutils as gst_pbutils; +extern crate gstreamer_pbutils_sys as gst_pbutils_ffi; +extern crate gstreamer_sys as gst_ffi; + +use glib::translate::from_glib; + +#[macro_use] +extern crate glib; +extern crate gio; + +static GES_INIT: Once = ONCE_INIT; + +pub use glib::{ + BoolError, Cast, Continue, Error, IsA, StaticType, ToValue, Type, TypedValue, Value, +}; + +pub fn init() -> Result<(), BoolError> { + if gst::init().is_err() { + return Err(BoolError("Could not initialize GStreamer.")); + } + + unsafe { + if from_glib(ffi::ges_init()) { + Ok(()) + } else { + Err(BoolError("Could not initialize GES.")) + } + } +} + +pub unsafe fn deinit() { + ffi::ges_deinit(); +} + +macro_rules! assert_initialized_main_thread { + () => { + if unsafe { ::gst_ffi::gst_is_initialized() } != ::glib_ffi::GTRUE { + panic!("GStreamer has not been initialized. Call `gst::init` first."); + } + ::GES_INIT.call_once(|| { + unsafe { ::ffi::ges_init() }; + }); + }; +} + +macro_rules! skip_assert_initialized { + () => {}; +} + +#[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))] +#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))] +#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] +#[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] +mod auto; +pub use auto::*; + +#[macro_use] +extern crate bitflags; + +mod timeline_element; +pub use timeline_element::TimelineElementExtManual; + +// Re-export all the traits in a prelude module, so that applications +// can always "use gst::prelude::*" without getting conflicts +pub mod prelude { + pub use glib::prelude::*; + pub use gst::prelude::*; + pub use timeline_element::TimelineElementExtManual; + + pub use auto::traits::*; +} diff --git a/gstreamer-editing-services/src/timeline_element.rs b/gstreamer-editing-services/src/timeline_element.rs new file mode 100644 index 000000000..dd8b6e577 --- /dev/null +++ b/gstreamer-editing-services/src/timeline_element.rs @@ -0,0 +1,66 @@ +// Copyright (C) 2018 Thibault Saunier +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use ffi; +use glib; +use glib::object::IsA; +use glib::translate::*; +use std::ptr; +use TimelineElement; + +pub trait TimelineElementExtManual { + fn get_child_property(&self, name: &str) -> Option; + fn set_child_property(&self, name: &str, value: &glib::ToValue) -> Result<(), glib::BoolError>; +} + +impl> TimelineElementExtManual for O { + fn get_child_property(&self, name: &str) -> Option { + unsafe { + let found: bool = from_glib(ffi::ges_timeline_element_lookup_child( + self.to_glib_none().0, + name.to_glib_none().0, + ptr::null_mut(), + ptr::null_mut(), + )); + if !found { + return None; + } + + let mut value = glib::Value::uninitialized(); + ffi::ges_timeline_element_get_child_property( + self.to_glib_none().0, + name.to_glib_none().0, + value.to_glib_none_mut().0, + ); + Some(value) + } + } + + fn set_child_property(&self, name: &str, value: &glib::ToValue) -> Result<(), glib::BoolError> { + unsafe { + let found: bool = from_glib(ffi::ges_timeline_element_lookup_child( + self.to_glib_none().0, + name.to_glib_none().0, + ptr::null_mut(), + ptr::null_mut(), + )); + if !found { + return Err(glib::BoolError("Child property not found")); + } + + let value = value.to_value(); + ffi::ges_timeline_element_set_child_property( + self.to_glib_none().0, + name.to_glib_none().0, + value.to_glib_none().0, + ); + + Ok(()) + } + } +}