mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
formatter: Make the emit_loaded a real method and not a virtual method
+ Modify formatter subclasses accordingly API:ges_formatter_emit_loaded This API wasn't released so it could still be changed
This commit is contained in:
parent
2d13b12878
commit
b13942c5b5
3 changed files with 24 additions and 21 deletions
|
@ -39,8 +39,8 @@
|
|||
* Support for saving or loading new formats can be added by creating a subclass of
|
||||
* #GESFormatter and implement the various vmethods of #GESFormatterClass.
|
||||
*
|
||||
* Note that subclasses should call project_loaded wen they are done loading
|
||||
* a project.
|
||||
* Note that subclasses should call ges_formatter_project_loaded when they are done
|
||||
* loading a project.
|
||||
**/
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
@ -76,9 +76,6 @@ static gboolean default_can_save_uri (const gchar * uri);
|
|||
static void discovery_error_cb (GESTimeline * timeline,
|
||||
GESTimelineFileSource * tfs, GError * error, GESFormatter * formatter);
|
||||
|
||||
static gboolean project_loaded (GESFormatter * formatter,
|
||||
GESTimeline * timeline);
|
||||
|
||||
enum
|
||||
{
|
||||
SOURCE_MOVED_SIGNAL,
|
||||
|
@ -123,7 +120,6 @@ ges_formatter_class_init (GESFormatterClass * klass)
|
|||
klass->load_from_uri = load_from_uri;
|
||||
klass->save_to_uri = save_to_uri;
|
||||
klass->update_source_uri = NULL;
|
||||
klass->project_loaded = project_loaded;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -594,11 +590,22 @@ discovery_error_cb (GESTimeline * timeline,
|
|||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
project_loaded (GESFormatter * formatter, GESTimeline * timeline)
|
||||
/*< protected >*/
|
||||
/**
|
||||
* ges_formatter_emit_loaded:
|
||||
* @formatter: The #GESFormatter from which to emit the "project-loaded" signal
|
||||
*
|
||||
* Emits the "loaded" signal. This method should be called by sublasses when
|
||||
* the project is fully loaded.
|
||||
*
|
||||
* Returns: %TRUE if the signale could be emitted %FALSE otherwize
|
||||
*/
|
||||
gboolean
|
||||
ges_formatter_emit_loaded (GESFormatter * formatter)
|
||||
{
|
||||
GST_INFO_OBJECT (formatter, "Emit project loaded");
|
||||
g_signal_emit (formatter, ges_formatter_signals[LOADED_SIGNAL], 0, timeline);
|
||||
g_signal_emit (formatter, ges_formatter_signals[LOADED_SIGNAL], 0,
|
||||
formatter->timeline);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -140,7 +140,6 @@ typedef gboolean (*GESFormatterLoadedMethod) (GESFormatter *formatter,
|
|||
* @save_to_uri: class method to serialize data to a URI
|
||||
* @update_source_uri: virtual method to specify that a source has moved, and thus its URI
|
||||
* must be set to its new location (specified by the user)
|
||||
* @project_loaded: Must be called by subclasses when done loading a project
|
||||
*
|
||||
* GES Formatter class. Override the vmethods to implement the formatter functionnality.
|
||||
*/
|
||||
|
@ -153,7 +152,6 @@ struct _GESFormatterClass {
|
|||
GESFormatterLoadFromURIMethod load_from_uri;
|
||||
GESFormatterSaveToURIMethod save_to_uri;
|
||||
GESFormatterSourceMovedMethod update_source_uri;
|
||||
GESFormatterLoadedMethod project_loaded;
|
||||
|
||||
/*< private >*/
|
||||
/* FIXME : formatter name */
|
||||
|
@ -188,6 +186,10 @@ gboolean
|
|||
ges_formatter_update_source_uri (GESFormatter * formatter,
|
||||
GESTimelineFileSource * source, gchar * new_uri);
|
||||
|
||||
/*< protected >*/
|
||||
gboolean
|
||||
ges_formatter_emit_loaded (GESFormatter * formatter);
|
||||
|
||||
/* Non-standard methods. WILL BE DEPRECATED */
|
||||
gboolean ges_formatter_load (GESFormatter * formatter,
|
||||
GESTimeline * timeline);
|
||||
|
|
|
@ -807,12 +807,8 @@ track_object_added_cb (GESTimelineObject * object,
|
|||
g_hash_table_steal (props_table, "current-formatter");
|
||||
|
||||
priv->sources_to_load = g_list_remove (priv->sources_to_load, object);
|
||||
if (!priv->sources_to_load) {
|
||||
GESFormatterClass *klass = GES_FORMATTER_GET_CLASS (formatter);
|
||||
|
||||
klass->project_loaded (GES_FORMATTER (formatter),
|
||||
GES_FORMATTER (formatter)->timeline);
|
||||
}
|
||||
if (!priv->sources_to_load)
|
||||
ges_formatter_emit_loaded (GES_FORMATTER (formatter));
|
||||
}
|
||||
|
||||
if (lockedstr && !g_strcmp0 (lockedstr, "(bool)False"))
|
||||
|
@ -909,7 +905,7 @@ make_source (GESFormatter * self, GList * reflist, GHashTable * source_table)
|
|||
if (!(layer = g_hash_table_lookup (priv->layers_table, &prio))) {
|
||||
layer = ges_timeline_layer_new ();
|
||||
g_object_set (layer, "auto-transition", TRUE, "priority", prio, NULL);
|
||||
ges_timeline_add_layer (priv->timeline, layer);
|
||||
ges_timeline_add_layer (self->timeline, layer);
|
||||
g_hash_table_insert (priv->layers_table, g_memdup (&prio,
|
||||
sizeof (guint64)), layer);
|
||||
}
|
||||
|
@ -1106,9 +1102,7 @@ load_pitivi_file_from_uri (GESFormatter * self,
|
|||
* 'project-loaded' signal.
|
||||
*/
|
||||
if (!g_hash_table_size (priv->timeline_objects_table)) {
|
||||
GESFormatterClass *klass = GES_FORMATTER_GET_CLASS (self);
|
||||
|
||||
klass->project_loaded (self, self->timeline);
|
||||
ges_formatter_emit_loaded (self);
|
||||
} else {
|
||||
if (!make_timeline_objects (self)) {
|
||||
GST_ERROR ("Couldn't deserialise the project properly");
|
||||
|
|
Loading…
Reference in a new issue