2010-11-08 20:53:26 +00:00
|
|
|
Effects
|
|
|
|
-------
|
|
|
|
|
|
|
|
Summary
|
|
|
|
-------
|
|
|
|
1. Basic ideas
|
|
|
|
2. Problems
|
|
|
|
3. Propositions to solve those problems
|
|
|
|
A. The registry
|
|
|
|
B. Effects configurability
|
|
|
|
C. Keyframes
|
|
|
|
4. Use-cases
|
2010-12-07 12:47:47 +00:00
|
|
|
5. API draft
|
2010-11-08 20:53:26 +00:00
|
|
|
|
|
|
|
The goal of this proposal is to find a simple way to handle effects through an
|
|
|
|
API which would allow developers to handle any use-case
|
|
|
|
|
|
|
|
1. Basic ideas
|
|
|
|
----------------
|
|
|
|
|
|
|
|
* Effects are actually descendant of GESTrackOperation
|
2010-12-04 11:22:54 +00:00
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
* You can add effects on any clip or layer
|
|
|
|
|
|
|
|
* You can add effects between several clips and control them as a unique effect.
|
2010-12-04 11:22:54 +00:00
|
|
|
|
2010-11-08 20:53:26 +00:00
|
|
|
* Effects are configurable and those could change during time
|
2010-12-04 11:22:54 +00:00
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
* We should be able to handle the gnome-video-effects standard. We should also offer
|
|
|
|
a system to be able to handle any other effect system.
|
2010-12-04 11:22:54 +00:00
|
|
|
|
|
|
|
* We can implement complexe effects. It means effects that are more
|
|
|
|
than adding GstElement-s to the timeline. It can also mean effects
|
|
|
|
that are both: video and audio at the same time
|
2010-11-08 20:53:26 +00:00
|
|
|
|
|
|
|
2. Problems
|
|
|
|
----------
|
|
|
|
* We should be able to handle list of available effects on the system at
|
|
|
|
runtime.
|
|
|
|
|
|
|
|
* We should be able to configure effects through an API in GES and
|
|
|
|
not directly configuring the corresponding GstElement properties.
|
|
|
|
|
2010-12-04 11:22:54 +00:00
|
|
|
* We should also expose the GstElement-s contained in an effect so
|
|
|
|
it is possible for people to control their properties as they wish.
|
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
* We should be able to implement and handle complexe effects directly in GES
|
2010-11-08 20:53:26 +00:00
|
|
|
|
|
|
|
* We should be able to configure effects in the time -> Keyframes without
|
|
|
|
duplicating code from GStreamer
|
|
|
|
|
|
|
|
|
|
|
|
3. Propositions to solve those problems
|
|
|
|
---------------------------------------
|
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
A. The registry => Still to design
|
2010-11-08 20:53:26 +00:00
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
We could implement a GESRegistry which would actually
|
2010-12-04 11:22:54 +00:00
|
|
|
retrieve elements (effects) from the GSTRegistry and any other mean
|
|
|
|
such as gnome-video-effects to let us get all the effects that are present
|
|
|
|
on the system....
|
|
|
|
This way the developers could have the list of all the effects
|
|
|
|
that are installed on the system pretty easily.
|
2010-11-08 20:53:26 +00:00
|
|
|
|
|
|
|
B. Effects configurability
|
|
|
|
|
|
|
|
The idea to be able to configure effects through a simple API in GES would
|
2011-01-12 10:47:30 +00:00
|
|
|
be to add an API in GESTrackObject to access the gst-object properties that
|
|
|
|
user would like to configure.
|
2010-11-08 20:53:26 +00:00
|
|
|
We would also have a method to set those properties easily
|
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
We should also find a way to handle that in thecase of systems such as gnome-effects
|
2010-11-08 20:53:26 +00:00
|
|
|
|
|
|
|
C. Keyframes
|
|
|
|
We may want to handle this use-case directly in GES and for any kind of
|
|
|
|
time related configuration? FIXME
|
|
|
|
=> Special specifications for that?
|
|
|
|
|
|
|
|
4. Use-cases
|
|
|
|
-----------
|
|
|
|
|
2010-12-07 12:47:47 +00:00
|
|
|
UC-1. The user wants to add an effect to an entire clip => GESTimelineObject new API
|
2010-11-08 20:53:26 +00:00
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
UC-2. The developer wants to allow his users to configure effects => New
|
|
|
|
GESTrackOperation API
|
2010-11-08 20:53:26 +00:00
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
UC-3. The user wants to add an effect on a special portion of a clip, we should
|
2010-11-08 20:53:26 +00:00
|
|
|
allow him to configure that thanks to a system of keyframes. FIXME
|
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
UC-4. We want to implement an effect which isn't only composed by a bin, but is more
|
2010-11-08 20:53:26 +00:00
|
|
|
complexe than that (ex: "effect '24'") => we have the GESTrackOperation
|
2011-01-12 10:47:30 +00:00
|
|
|
which is the base class (abstract) for this kind of implementation. This class should
|
|
|
|
implement vmethods to get/set configurable properties.
|
2010-11-08 20:53:26 +00:00
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
UC-5. A developer wants to implement effect which handle music and video at the same
|
2010-11-08 20:53:26 +00:00
|
|
|
time, Would the solution be to implement a GESTimelineEffect to handle this
|
|
|
|
special usecase? FIXME
|
2010-12-07 12:47:47 +00:00
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
UC-6. The developers wants to configure each elements of an effect the way he wants
|
2010-12-07 12:47:47 +00:00
|
|
|
with a full control over it.
|
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
UC-7. Developers want to expose all effects present on the system to the end-user
|
2010-12-07 12:47:47 +00:00
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
5. API draft
|
2010-12-07 12:47:47 +00:00
|
|
|
------------
|
|
|
|
|
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
A. GESTrackObject new API
|
2010-12-09 15:01:02 +00:00
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
signals:
|
|
|
|
-------
|
|
|
|
* property-changed: emited when a property of the GESTrackObject gst element
|
|
|
|
is changed
|
2010-12-09 15:01:02 +00:00
|
|
|
|
2010-12-07 12:47:47 +00:00
|
|
|
/**
|
2011-01-12 10:47:30 +00:00
|
|
|
* ges_track_object_list_gst_properties:
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* @object: The origin #GESTrackObject
|
|
|
|
*
|
|
|
|
* Get all the usefull configurable properties of the GstElement contained in @object.
|
|
|
|
*
|
|
|
|
* Returns: an array of GParamSpec of the configurable properties of the
|
|
|
|
* GstElement-s contained in @object
|
2010-12-07 12:47:47 +00:00
|
|
|
*/
|
2011-01-12 10:47:30 +00:00
|
|
|
GParamSpec **
|
|
|
|
ges_track_object_list_gst_properties (GESTrackObject *object);
|
2010-12-07 12:47:47 +00:00
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
-> Usecases: Let user know all the property he can configure.
|
2010-12-07 12:47:47 +00:00
|
|
|
|
|
|
|
/**
|
2011-01-12 10:47:30 +00:00
|
|
|
* ges_track_object_set_gst_property:
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* @object: The origin #GESTrackObject
|
|
|
|
* @property_name: The name of the property
|
|
|
|
* @value: the value
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* Sets a property of a GstElement contained in @object.
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
|
|
|
*/
|
2011-01-12 10:47:30 +00:00
|
|
|
void ges_track_object_set_gst_property (GESTrackObject *object,
|
|
|
|
const gchar *property_name,
|
|
|
|
GValue * value);
|
2010-12-07 12:47:47 +00:00
|
|
|
-> Usecases:
|
2011-01-12 10:47:30 +00:00
|
|
|
+ Let user configure effects easily (UC-3)
|
2010-12-09 15:01:02 +00:00
|
|
|
|
2010-12-07 12:47:47 +00:00
|
|
|
/**
|
2011-01-12 10:47:30 +00:00
|
|
|
* ges_track_object_get_gst_property:
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* @object: The origin #GESTrackObject
|
|
|
|
* @property_name: The name of the property
|
|
|
|
* @value: return location for the property value
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* Gets a property of a GstElement contained in @object.
|
2010-12-07 12:47:47 +00:00
|
|
|
*/
|
2011-01-12 10:47:30 +00:00
|
|
|
void ges_track_object_get_gst_property (GESTrackObject *object,
|
|
|
|
const gchar *property_name,
|
|
|
|
GValue * value);
|
2010-12-07 12:47:47 +00:00
|
|
|
|
2011-01-18 19:03:51 +00:00
|
|
|
B. GESTimelineObject new API
|
2010-12-07 12:47:47 +00:00
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
signals:
|
|
|
|
-------
|
2010-12-09 15:01:02 +00:00
|
|
|
* effect-added: emited when an effect is added
|
|
|
|
* effect-removed: emited when an effect is removed
|
|
|
|
* effect-moved: emited when an effect is moved
|
|
|
|
|
2010-12-07 12:47:47 +00:00
|
|
|
/**
|
2011-01-18 19:03:51 +00:00
|
|
|
* ges_timeline_object_add_effect:
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-18 19:03:51 +00:00
|
|
|
* @object: The origin #GESTimelineObject
|
2011-01-12 10:47:30 +00:00
|
|
|
* @effect_material: The #GESMaterial from which to create the effect
|
|
|
|
* @position: The top position you want to give to the effect,
|
|
|
|
* -1 if you want it to be added at the end of effects.
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-18 19:03:51 +00:00
|
|
|
* Adds a new effect corresponding to @material to the #GESTimelineObject
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* Returns: The newly created #GESTrackEffect, or %NULL if there was an error.
|
2010-12-07 12:47:47 +00:00
|
|
|
*/
|
2011-01-18 19:03:51 +00:00
|
|
|
GESTrackEffect *ges_timeline_object_add_effect (GESTimelineObject *object,
|
2011-01-12 10:47:30 +00:00
|
|
|
GESMaterial *effect_material,
|
|
|
|
gint position);
|
2010-12-07 12:47:47 +00:00
|
|
|
|
|
|
|
/**
|
2011-01-18 19:03:51 +00:00
|
|
|
* ges_timeline_object_get_effects:
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-18 19:03:51 +00:00
|
|
|
* @object: The origin #GESTimelineObject
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* Returns: a #GList of the #GESTrackEffect that are applied on
|
|
|
|
* @object order by ascendant priorities.
|
2010-12-07 12:47:47 +00:00
|
|
|
* The refcount of the objects will be increased. The user will have to
|
2011-01-12 10:47:30 +00:00
|
|
|
* unref each #GESTrackOperation and free the #GList.
|
2010-12-07 12:47:47 +00:00
|
|
|
*/
|
2011-01-12 10:47:30 +00:00
|
|
|
GList *
|
2011-01-18 19:03:51 +00:00
|
|
|
ges_timeline_object_get_effects (GESTimelineObject *object);
|
2010-12-09 15:01:02 +00:00
|
|
|
-> Usecases:
|
|
|
|
+ First step to allow the configuration of effects (UC-3)
|
|
|
|
|
|
|
|
/**
|
2011-01-18 19:03:51 +00:00
|
|
|
* ges_timeline_object_set_top_effect_position:
|
2010-12-09 15:01:02 +00:00
|
|
|
*
|
2011-01-18 19:03:51 +00:00
|
|
|
* @object: The origin #GESTimelineObject
|
2011-01-12 10:47:30 +00:00
|
|
|
* @effect: The #GESTrackEffect to move
|
2010-12-09 15:01:02 +00:00
|
|
|
* @newposition: the new position at which to move the @effect
|
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* Returns: %TRUE if @effect was successfuly moved, %FALSE otherwize.
|
2010-12-09 15:01:02 +00:00
|
|
|
*/
|
|
|
|
gboolean
|
2011-01-18 19:03:51 +00:00
|
|
|
ges_timeline_object_set_top_effect_position (GESTimelineObject *object,
|
2011-01-12 10:47:30 +00:00
|
|
|
GESTrackEffect *effect, guint newposition);
|
2010-12-07 12:47:47 +00:00
|
|
|
|
2011-01-12 10:47:30 +00:00
|
|
|
C - The GESTrackEffect API:
|
2010-12-07 12:47:47 +00:00
|
|
|
|
|
|
|
/**
|
2011-01-12 10:47:30 +00:00
|
|
|
* ges_track_effect_new_from_material:
|
|
|
|
*
|
|
|
|
* @material: The #GESMaterial from which to create this GESTrackEffect
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* Creates a new #GESTrackEffect from a #GESMaterial
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* Returns: a newly created #GESTrackEffect, or %NULL if something went wrong.
|
2010-12-07 12:47:47 +00:00
|
|
|
*/
|
2011-01-12 10:47:30 +00:00
|
|
|
GESTrackEffect *ges_track_effect_new_from_material(GESTrackEffect *effect, GESMaterial *material);
|
2010-12-07 12:47:47 +00:00
|
|
|
|
|
|
|
/**
|
2011-01-12 10:47:30 +00:00
|
|
|
* ges_track_effect_new_from_bin_desc:
|
|
|
|
*
|
|
|
|
* @bin_dec: The gst-launch like bin description of the effect
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* Creates a new #GESTrackEffect from the description of the bin. This is a
|
|
|
|
* convenience method for testing puposes.
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* Returns: a newly created #GESTrackEffect, or %NULL if something went wrong.
|
2010-12-07 12:47:47 +00:00
|
|
|
*/
|
2011-01-12 10:47:30 +00:00
|
|
|
GESTrackEffect *ges_track_effect_new_from_bin_desc(GESTrackEffect *effect,
|
|
|
|
const gchar *bin_desc);
|
|
|
|
|
|
|
|
D - The GESTimelineEffect API:
|
|
|
|
|
|
|
|
The GESTimelineEffect basically doesn't have anything else but what GESTimelineObject has.
|
|
|
|
|
|
|
|
-> Usecases: The user wants to control multiple effects in sync. The user wants to add
|
|
|
|
an effect to the whole timeline. The user wants to had an effect to a
|
|
|
|
segment of the timeline without caring about what clip it is applied on.
|
|
|
|
|
|
|
|
=================
|
|
|
|
TODO GESRegistry API:
|
|
|
|
This should be a singleton since we don't want an app to instanciate more
|
|
|
|
than one registry. It should be able to get effects from various sources.
|
|
|
|
We should also make sure any custom effect is detected.
|
2010-12-07 12:47:47 +00:00
|
|
|
|
|
|
|
/**
|
2011-01-12 10:47:30 +00:00
|
|
|
* ges_registry_get_default:
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* Returns a newly created #GESEffectRegistry or the existing one increasing
|
|
|
|
* its refcount
|
2010-12-07 12:47:47 +00:00
|
|
|
*/
|
2011-01-12 10:47:30 +00:00
|
|
|
GESEffectRegistry *
|
|
|
|
ges_registry_get_default (void);
|
2010-12-07 12:47:47 +00:00
|
|
|
-> Usecases:
|
2011-01-12 10:47:30 +00:00
|
|
|
+ Have a registry of all effects that are on the système (UC-8)
|
2010-12-07 12:47:47 +00:00
|
|
|
|
|
|
|
/**
|
2011-01-12 10:47:30 +00:00
|
|
|
* ges_effect_registry_get_effect_list:
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* @self: The origin #GESEffectRegistry
|
2010-12-07 12:47:47 +00:00
|
|
|
*
|
2011-01-12 10:47:30 +00:00
|
|
|
* Returns a #GList of #GESEffectDescriptors. The
|
2010-12-07 12:47:47 +00:00
|
|
|
*/
|
2011-01-12 10:47:30 +00:00
|
|
|
GList *
|
|
|
|
ges_registry_get_effect_list (GESEffectRegistry *self);
|
2010-12-07 12:47:47 +00:00
|
|
|
-> Usecases:
|
2011-01-12 10:47:30 +00:00
|
|
|
+ Get all effects descriptors that are on the système (UC-8)
|