ges: Use G_DEPRECATE to mark deprecated methods

Cleanup a few things on the way.

And move ges-track-element deprecations to a dedicated header file
This commit is contained in:
Thibault Saunier 2019-08-20 17:46:09 -04:00
parent 7b5f655c9a
commit 000edd268e
13 changed files with 129 additions and 130 deletions

View file

@ -151,7 +151,7 @@ GList * ges_container_ungroup (GESContainer * container, gboolean recursive)
GES_API
GESContainer *ges_container_group (GList *containers);
GES_API
GES_DEPRECATED_FOR(ges_timeline_element_edit)
gboolean ges_container_edit (GESContainer * container,
GList * layers, gint new_layer_priority,
GESEditMode mode,

View file

@ -315,7 +315,7 @@ ges_formatter_can_save_uri (const gchar * uri, GError ** error)
if (!(gst_uri_has_protocol (uri, "file"))) {
gchar *proto = gst_uri_get_protocol (uri);
GST_ERROR ("Unspported protocol '%s'", proto);
GST_ERROR ("Unsupported protocol '%s'", proto);
g_free (proto);
return FALSE;
}
@ -379,6 +379,8 @@ error:
*
* Returns: TRUE if the timeline data was successfully loaded from the URI,
* else FALSE.
*
* Deprecated: 1.18: Use @ges_timeline_load_from_uri
*/
gboolean
@ -411,6 +413,8 @@ ges_formatter_load_from_uri (GESFormatter * formatter,
*
* Returns: TRUE if the timeline data was successfully saved to the URI
* else FALSE.
*
* Deprecated: 1.18: Use @ges_timeline_save_to_uri
*/
gboolean

View file

@ -80,8 +80,6 @@ typedef gboolean (*GESFormatterCanLoadURIMethod) (GESFormatter *dummy_instance,
*
* Returns: TRUE if the @timeline was properly loaded from the given @uri,
* else FALSE.
*
* Deprecated: 1.16: Use @ges_timeline_load_from_uri
**/
typedef gboolean (*GESFormatterLoadFromURIMethod) (GESFormatter *formatter,
GESTimeline *timeline,
@ -102,8 +100,6 @@ typedef gboolean (*GESFormatterLoadFromURIMethod) (GESFormatter *formatter,
*
* Returns: TRUE if the @timeline was properly stored to the given @uri,
* else FALSE.
*
* Deprecated: 1.16: Use @ges_timeline_save_to_uri
*/
typedef gboolean (*GESFormatterSaveToURIMethod) (GESFormatter *formatter,
GESTimeline *timeline, const gchar * uri, gboolean overwrite,
@ -159,13 +155,13 @@ gboolean ges_formatter_can_load_uri (const gchar * uri, GError **error);
GES_API
gboolean ges_formatter_can_save_uri (const gchar * uri, GError **error);
GES_API
GES_DEPRECATED_FOR(ges_timeline_load_from_uri)
gboolean ges_formatter_load_from_uri (GESFormatter * formatter,
GESTimeline *timeline,
const gchar *uri,
GError **error);
GES_API
GES_DEPRECATED_FOR(ges_timeline_save_to_uri)
gboolean ges_formatter_save_to_uri (GESFormatter * formatter,
GESTimeline *timeline,
const gchar *uri,

View file

@ -117,7 +117,7 @@ GES_API
gboolean ges_layer_remove_clip (GESLayer * layer,
GESClip * clip);
GES_API
GES_DEPRECATED_FOR(ges_timeline_move_layer)
void ges_layer_set_priority (GESLayer * layer,
guint priority);

View file

@ -32,4 +32,12 @@
# endif
#endif
#ifndef GST_DISABLE_DEPRECATED
#define GES_DEPRECATED GES_API
#define GES_DEPRECATED_FOR(f) GES_API
#else
#define GES_DEPRECATED G_DEPRECATED GES_API
#define GES_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) GES_API
#endif
#endif /* __GST_GES_PRELUDE_H__ */

View file

@ -26,7 +26,7 @@
G_BEGIN_DECLS
GES_API GstSample *
GES_DEPRECATED GstSample *
ges_play_sink_convert_frame (GstElement * playsink, GstCaps * caps);
G_END_DECLS

View file

@ -1005,7 +1005,7 @@ ges_timeline_element_get_priority (GESTimelineElement * self)
*
* Sets the priority of the object within the containing layer
*
* Deprecated: All priority management is done by GES itself now.
* Deprecated:1.10: All priority management is done by GES itself now.
* To set #GESEffect priorities #ges_clip_set_top_effect_index should
* be used.
*

View file

@ -251,7 +251,7 @@ gboolean ges_timeline_element_set_duration (GESTimeli
GES_API
gboolean ges_timeline_element_set_max_duration (GESTimelineElement *self,
GstClockTime maxduration);
GES_API
GES_DEPRECATED
gboolean ges_timeline_element_set_priority (GESTimelineElement *self,
guint32 priority);
GES_API

View file

@ -106,32 +106,17 @@ static void
ges_title_clip_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec)
{
GESTitleClip *uriclip = GES_TITLE_CLIP (object);
switch (property_id) {
case PROP_TEXT:
ges_title_clip_set_text (uriclip, g_value_get_string (value));
break;
case PROP_FONT_DESC:
ges_title_clip_set_font_desc (uriclip, g_value_get_string (value));
break;
case PROP_HALIGNMENT:
ges_title_clip_set_halignment (uriclip, g_value_get_enum (value));
break;
case PROP_VALIGNMENT:
ges_title_clip_set_valignment (uriclip, g_value_get_enum (value));
break;
case PROP_COLOR:
ges_title_clip_set_color (uriclip, g_value_get_uint (value));
break;
case PROP_BACKGROUND:
ges_title_clip_set_background (uriclip, g_value_get_uint (value));
break;
case PROP_XPOS:
ges_title_clip_set_xpos (uriclip, g_value_get_double (value));
break;
case PROP_YPOS:
ges_title_clip_set_ypos (uriclip, g_value_get_double (value));
ges_timeline_element_set_child_property (GES_TIMELINE_ELEMENT (object),
pspec->name, value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -314,7 +299,7 @@ ges_title_clip_set_text (GESTitleClip * self, const gchar * text)
GST_DEBUG_OBJECT (self, "text:%s", text);
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_element_set_child_properties (tmp->data, "text", text, NULL);
ges_timeline_element_set_child_properties (tmp->data, "text", text, NULL);
}
}
@ -336,7 +321,7 @@ ges_title_clip_set_font_desc (GESTitleClip * self, const gchar * font_desc)
GST_DEBUG_OBJECT (self, "font_desc:%s", font_desc);
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_element_set_child_properties (tmp->data,
ges_timeline_element_set_child_properties (tmp->data,
"font-desc", font_desc, NULL);
}
}
@ -359,7 +344,7 @@ ges_title_clip_set_halignment (GESTitleClip * self, GESTextHAlign halign)
GST_DEBUG_OBJECT (self, "halign:%d", halign);
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_element_set_child_properties (tmp->data,
ges_timeline_element_set_child_properties (tmp->data,
"halignment", halign, NULL);
}
}
@ -382,7 +367,7 @@ ges_title_clip_set_valignment (GESTitleClip * self, GESTextVAlign valign)
GST_DEBUG_OBJECT (self, "valign:%d", valign);
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_element_set_child_properties (tmp->data,
ges_timeline_element_set_child_properties (tmp->data,
"valignment", valign, NULL);
}
}
@ -405,7 +390,7 @@ ges_title_clip_set_color (GESTitleClip * self, guint32 color)
GST_DEBUG_OBJECT (self, "color:%d", color);
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_element_set_child_properties (tmp->data, "color", color, NULL);
ges_timeline_element_set_child_properties (tmp->data, "color", color, NULL);
}
}
@ -427,12 +412,11 @@ ges_title_clip_set_background (GESTitleClip * self, guint32 background)
GST_DEBUG_OBJECT (self, "background:%d", background);
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_element_set_child_properties (tmp->data,
ges_timeline_element_set_child_properties (tmp->data,
"foreground-color", background, NULL);
}
}
/**
* ges_title_clip_set_xpos:
* @self: the #GESTitleClip* to set
@ -451,7 +435,8 @@ ges_title_clip_set_xpos (GESTitleClip * self, gdouble position)
GST_DEBUG_OBJECT (self, "xpos:%f", position);
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_element_set_child_properties (tmp->data, "xpos", position, NULL);
ges_timeline_element_set_child_properties (tmp->data, "xpos", position,
NULL);
}
}
@ -473,7 +458,8 @@ ges_title_clip_set_ypos (GESTitleClip * self, gdouble position)
GST_DEBUG_OBJECT (self, "ypos:%f", position);
for (tmp = self->priv->track_titles; tmp; tmp = tmp->next) {
ges_track_element_set_child_properties (tmp->data, "ypos", position, NULL);
ges_timeline_element_set_child_properties (tmp->data, "ypos", position,
NULL);
}
}
@ -493,7 +479,7 @@ ges_title_clip_get_text (GESTitleClip * self)
{
gchar *text;
ges_track_element_get_child_properties (self->priv->track_titles->data,
ges_timeline_element_get_child_properties (self->priv->track_titles->data,
"text", &text, NULL);
return text;
@ -515,7 +501,7 @@ ges_title_clip_get_font_desc (GESTitleClip * self)
{
gchar *font_desc;
ges_track_element_get_child_properties (self->priv->track_titles->data,
ges_timeline_element_get_child_properties (self->priv->track_titles->data,
"font-desc", &font_desc, NULL);
return font_desc;
@ -537,7 +523,7 @@ ges_title_clip_get_halignment (GESTitleClip * self)
{
GESTextHAlign halign;
ges_track_element_get_child_properties (self->priv->track_titles->data,
ges_timeline_element_get_child_properties (self->priv->track_titles->data,
"halignment", &halign, NULL);
return halign;
@ -559,7 +545,7 @@ ges_title_clip_get_valignment (GESTitleClip * self)
{
GESTextVAlign valign;
ges_track_element_get_child_properties (self->priv->track_titles->data,
ges_timeline_element_get_child_properties (self->priv->track_titles->data,
"valignment", &valign, NULL);
return valign;
@ -581,7 +567,7 @@ ges_title_clip_get_text_color (GESTitleClip * self)
{
guint32 color;
ges_track_element_get_child_properties (self->priv->track_titles->data,
ges_timeline_element_get_child_properties (self->priv->track_titles->data,
"color", &color, NULL);
return color;
@ -603,7 +589,7 @@ ges_title_clip_get_background_color (GESTitleClip * self)
{
guint32 color;
ges_track_element_get_child_properties (self->priv->track_titles->data,
ges_timeline_element_get_child_properties (self->priv->track_titles->data,
"foreground-color", &color, NULL);
return color;
@ -625,7 +611,7 @@ ges_title_clip_get_xpos (GESTitleClip * self)
{
gdouble xpos;
ges_track_element_get_child_properties (self->priv->track_titles->data,
ges_timeline_element_get_child_properties (self->priv->track_titles->data,
"xpos", &xpos, NULL);
return xpos;
@ -646,7 +632,7 @@ ges_title_clip_get_ypos (GESTitleClip * self)
{
gdouble ypos;
ges_track_element_get_child_properties (self->priv->track_titles->data,
ges_timeline_element_get_child_properties (self->priv->track_titles->data,
"ypos", &ypos, NULL);
return ypos;

View file

@ -74,60 +74,52 @@ struct _GESTitleClipClass {
GES_API
GType ges_title_clip_get_type (void);
GES_API void
ges_title_clip_set_text( GESTitleClip * self,
const gchar * text);
G_DEPRECATED_FOR(ges_timeline_element_set_children_properties) void
ges_title_clip_set_text( GESTitleClip * self, const gchar * text);
GES_API void
ges_title_clip_set_font_desc (GESTitleClip * self,
const gchar * font_desc);
G_DEPRECATED_FOR(ges_timeline_element_set_children_properties) void
ges_title_clip_set_font_desc (GESTitleClip * self, const gchar * font_desc);
GES_API void
ges_title_clip_set_valignment (GESTitleClip * self,
GESTextVAlign valign);
G_DEPRECATED_FOR(ges_timeline_element_set_children_properties) void
ges_title_clip_set_valignment (GESTitleClip * self, GESTextVAlign valign);
GES_API void
ges_title_clip_set_halignment (GESTitleClip * self,
GESTextHAlign halign);
G_DEPRECATED_FOR(ges_timeline_element_set_children_properties) void
ges_title_clip_set_halignment (GESTitleClip * self, GESTextHAlign halign);
GES_API void
ges_title_clip_set_color (GESTitleClip * self,
guint32 color);
G_DEPRECATED_FOR(ges_timeline_element_set_children_properties) void
ges_title_clip_set_color (GESTitleClip * self, guint32 color);
GES_API void
ges_title_clip_set_background (GESTitleClip * self,
guint32 background);
G_DEPRECATED_FOR(ges_timeline_element_set_children_properties) void
ges_title_clip_set_background (GESTitleClip * self, guint32 background);
GES_API void
ges_title_clip_set_xpos (GESTitleClip * self,
gdouble position);
G_DEPRECATED_FOR(ges_timeline_element_set_children_properties) void
ges_title_clip_set_xpos (GESTitleClip * self, gdouble position);
GES_API void
ges_title_clip_set_ypos (GESTitleClip * self,
gdouble position);
G_DEPRECATED_FOR(ges_timeline_element_set_children_properties) void
ges_title_clip_set_ypos (GESTitleClip * self, gdouble position);
GES_API const gchar*
G_DEPRECATED_FOR(ges_timeline_element_get_children_properties) const gchar*
ges_title_clip_get_font_desc (GESTitleClip * self);
GES_API GESTextVAlign
G_DEPRECATED_FOR(ges_timeline_element_get_children_properties) GESTextVAlign
ges_title_clip_get_valignment (GESTitleClip * self);
GES_API GESTextHAlign
G_DEPRECATED_FOR(ges_timeline_element_get_children_properties) GESTextHAlign
ges_title_clip_get_halignment (GESTitleClip * self);
GES_API const guint32
G_DEPRECATED_FOR(ges_timeline_element_get_children_properties) const guint32
ges_title_clip_get_text_color (GESTitleClip * self);
GES_API const guint32
G_DEPRECATED_FOR(ges_timeline_element_get_children_properties) const guint32
ges_title_clip_get_background_color (GESTitleClip * self);
GES_API const gdouble
G_DEPRECATED_FOR(ges_timeline_element_get_children_properties) const gdouble
ges_title_clip_get_xpos (GESTitleClip * self);
GES_API const gdouble
G_DEPRECATED_FOR(ges_timeline_element_get_children_properties) const gdouble
ges_title_clip_get_ypos (GESTitleClip * self);
GES_API
G_DEPRECATED_FOR(ges_timeline_element_get_children_properties)
const gchar* ges_title_clip_get_text (GESTitleClip * self);
GES_API

View file

@ -0,0 +1,61 @@
#pragma once
GES_DEPRECATED_FOR(ges_track_element_get_nleobject)
GstElement * ges_track_element_get_gnlobject (GESTrackElement * object);
GES_DEPRECATED_FOR(ges_timeline_element_list_children_properties)
GParamSpec **
ges_track_element_list_children_properties (GESTrackElement *object,
guint *n_properties);
GES_DEPRECATED_FOR(ges_timeline_element_lookup_child)
gboolean ges_track_element_lookup_child (GESTrackElement *object,
const gchar *prop_name,
GstElement **element,
GParamSpec **pspec);
GES_DEPRECATED_FOR(ges_timeline_element_get_child_property_valist)
void
ges_track_element_get_child_property_valist (GESTrackElement * object,
const gchar * first_property_name,
va_list var_args);
GES_DEPRECATED_FOR(ges_timeline_element_get_child_properties)
void ges_track_element_get_child_properties (GESTrackElement *object,
const gchar * first_property_name,
...) G_GNUC_NULL_TERMINATED;
GES_DEPRECATED_FOR(ges_timeline_element_set_child_property_valist)
void
ges_track_element_set_child_property_valist (GESTrackElement * object,
const gchar * first_property_name,
va_list var_args);
GES_DEPRECATED_FOR(ges_timeline_element_set_child_property_by_spec)
void
ges_track_element_set_child_property_by_pspec (GESTrackElement * object,
GParamSpec * pspec,
GValue * value);
GES_DEPRECATED_FOR(ges_timeline_element_set_child_properties)
void
ges_track_element_set_child_properties (GESTrackElement * object,
const gchar * first_property_name,
...) G_GNUC_NULL_TERMINATED;
GES_DEPRECATED_FOR(ges_timeline_element_set_child_property)
gboolean ges_track_element_set_child_property (GESTrackElement *object,
const gchar *property_name,
GValue * value);
GES_DEPRECATED_FOR(ges_timeline_element_get_child_property)
gboolean ges_track_element_get_child_property (GESTrackElement *object,
const gchar *property_name,
GValue * value);
GES_DEPRECATED_FOR(ges_timeline_element_edit)
gboolean
ges_track_element_edit (GESTrackElement * object,
GList *layers, GESEditMode mode,
GESEdge edge, guint64 position);

View file

@ -139,8 +139,6 @@ void ges_track_element_set_track_type (GESTrackElement * object,
GES_API
GstElement * ges_track_element_get_nleobject (GESTrackElement * object);
GES_API
GstElement * ges_track_element_get_gnlobject (GESTrackElement * object);
GES_API
GstElement * ges_track_element_get_element (GESTrackElement * object);
@ -152,61 +150,11 @@ gboolean ges_track_element_set_active (GESTrackElement * object,
GES_API
gboolean ges_track_element_is_active (GESTrackElement * object);
GES_API GParamSpec **
ges_track_element_list_children_properties (GESTrackElement *object,
guint *n_properties);
GES_API
gboolean ges_track_element_lookup_child (GESTrackElement *object,
const gchar *prop_name,
GstElement **element,
GParamSpec **pspec);
GES_API void
ges_track_element_get_child_property_by_pspec (GESTrackElement * object,
GParamSpec * pspec,
GValue * value);
GES_API void
ges_track_element_get_child_property_valist (GESTrackElement * object,
const gchar * first_property_name,
va_list var_args);
GES_API
void ges_track_element_get_child_properties (GESTrackElement *object,
const gchar * first_property_name,
...) G_GNUC_NULL_TERMINATED;
GES_API void
ges_track_element_set_child_property_valist (GESTrackElement * object,
const gchar * first_property_name,
va_list var_args);
GES_API void
ges_track_element_set_child_property_by_pspec (GESTrackElement * object,
GParamSpec * pspec,
GValue * value);
GES_API
void ges_track_element_set_child_properties (GESTrackElement * object,
const gchar * first_property_name,
...) G_GNUC_NULL_TERMINATED;
GES_API
gboolean ges_track_element_set_child_property (GESTrackElement *object,
const gchar *property_name,
GValue * value);
GES_API
gboolean ges_track_element_get_child_property (GESTrackElement *object,
const gchar *property_name,
GValue * value);
GES_API gboolean
ges_track_element_edit (GESTrackElement * object,
GList *layers, GESEditMode mode,
GESEdge edge, guint64 position);
GES_API gboolean
ges_track_element_set_control_source (GESTrackElement *object,
GstControlSource *source,
@ -227,5 +175,8 @@ ges_track_element_get_all_control_bindings (GESTrackElement * trackelement);
GES_API gboolean
ges_track_element_remove_control_binding (GESTrackElement * object,
const gchar * property_name);
#include "ges-track-element-deprecated.h"
G_END_DECLS
#endif /* _GES_TRACK_ELEMENT */

View file

@ -93,6 +93,7 @@ ges_headers = files([
'ges-audio-track.h',
'ges-video-track.h',
'ges-track-element.h',
'ges-track-element-deprecated.h',
'ges-source.h',
'ges-operation.h',
'ges-video-source.h',