mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
TimelineEffect: Add the basis for GESTimelineEffect implementation
This commit is contained in:
parent
67cefa009d
commit
b566453e4a
7 changed files with 242 additions and 1 deletions
|
@ -49,6 +49,7 @@ platform as well as Windows. It is released under the GNU Library General Public
|
|||
|
||||
<chapter>
|
||||
<title>Timeline objects</title>
|
||||
<xi:include href="xml/ges-timeline-effect.xml"/>
|
||||
<xi:include href="xml/ges-timeline-filesource.xml"/>
|
||||
<xi:include href="xml/ges-timeline-title-source.xml"/>
|
||||
<xi:include href="xml/ges-timeline-test-source.xml"/>
|
||||
|
|
|
@ -422,6 +422,23 @@ GES_IS_TIMELINE_TRANSITION_CLASS
|
|||
GES_TIMELINE_TRANSITION_GET_CLASS
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>ges-timeline-effect</FILE>
|
||||
<TITLE>GESTimelineEffect</TITLE>
|
||||
GESTimelineEffect
|
||||
ges_timeline_effect_new_from_bin_desc
|
||||
<SUBSECTION Standard>
|
||||
GESTimelineEffectClass
|
||||
GESTimelineEffectPrivate
|
||||
GES_TIMELINE_EFFECT
|
||||
GES_IS_TIMELINE_EFFECT
|
||||
GES_TYPE_TIMELINE_EFFECT
|
||||
ges_timeline_effect_get_type
|
||||
GES_TIMELINE_EFFECT_CLASS
|
||||
GES_IS_TIMELINE_EFFECT_CLASS
|
||||
GES_TIMELINE_EFFECT_GET_CLASS
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>ges-timeline-standard-transition</FILE>
|
||||
<TITLE>GESTimelineStandardTransition</TITLE>
|
||||
|
@ -704,9 +721,10 @@ ges_keyfile_formatter_get_type
|
|||
<FILE>ges-track-effect</FILE>
|
||||
<TITLE>GESTrackEffect</TITLE>
|
||||
GESTrackEffect
|
||||
GESTrackEffectClass
|
||||
ges_track_effect_new_from_bin_desc
|
||||
<SUBSECTION Standard>
|
||||
GESTrackEffectClass
|
||||
GESTrackEffectPrivate
|
||||
GES_IS_TRACK_EFFECT
|
||||
GES_IS_TRACK_EFFECT_CLASS
|
||||
GES_TRACK_EFFECT
|
||||
|
|
|
@ -18,6 +18,7 @@ libges_@GST_MAJORMINOR@_la_SOURCES = \
|
|||
ges-timeline-object.c \
|
||||
ges-timeline-pipeline.c \
|
||||
ges-timeline-source.c \
|
||||
ges-timeline-effect.c \
|
||||
ges-timeline-file-source.c \
|
||||
ges-timeline-operation.c \
|
||||
ges-timeline-transition.c \
|
||||
|
@ -59,6 +60,7 @@ libges_@GST_MAJORMINOR@include_HEADERS = \
|
|||
ges-timeline-pipeline.h \
|
||||
ges-timeline-source.h \
|
||||
ges-timeline-file-source.h \
|
||||
ges-timeline-effect.h \
|
||||
ges-timeline-operation.h \
|
||||
ges-timeline-transition.h \
|
||||
ges-timeline-standard-transition.h \
|
||||
|
|
135
ges/ges-timeline-effect.c
Normal file
135
ges/ges-timeline-effect.c
Normal file
|
@ -0,0 +1,135 @@
|
|||
/* GStreamer Editing Services
|
||||
* Copyright (C) 2011 Thibault Saunier <thibault.saunier@collabora.co.uk>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION: ges-timeline-effect
|
||||
* @short_description: An effect in a #GESTimelineLayer
|
||||
*
|
||||
* The effect will be applied on the sources that have lower priorities
|
||||
* (higher number) between the inpoint and the end of it.
|
||||
*
|
||||
* In a #GESSimpleTimelineLayer, the priorities will be set for you but if
|
||||
* you use another type of #GESTimelineLayer, you will have to handle it
|
||||
* yourself.
|
||||
*/
|
||||
|
||||
#include <ges/ges.h>
|
||||
#include "ges-internal.h"
|
||||
#include "ges-types.h"
|
||||
|
||||
G_DEFINE_TYPE (GESTimelineEffect, ges_timeline_effect,
|
||||
GES_TYPE_TIMELINE_OPERATION);
|
||||
|
||||
struct _GESTimelineEffectPrivate
|
||||
{
|
||||
gchar *bin_description;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_BIN_DESCRIPTION,
|
||||
};
|
||||
|
||||
static GESTrackObject *ges_tl_effect_create_track_object (GESTimelineObject
|
||||
* self, GESTrack * track);
|
||||
|
||||
static void
|
||||
ges_timeline_effect_get_property (GObject * object,
|
||||
guint property_id, GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
switch (property_id) {
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ges_timeline_effect_set_property (GObject * object,
|
||||
guint property_id, const GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
GESTimelineEffect *self = GES_TIMELINE_EFFECT (object);
|
||||
|
||||
switch (property_id) {
|
||||
case PROP_BIN_DESCRIPTION:
|
||||
self->priv->bin_description = g_value_dup_string (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ges_timeline_effect_class_init (GESTimelineEffectClass * klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GESTimelineObjectClass *timobj_class = GES_TIMELINE_OBJECT_CLASS (klass);
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GESTimelineEffectPrivate));
|
||||
|
||||
object_class->get_property = ges_timeline_effect_get_property;
|
||||
object_class->set_property = ges_timeline_effect_set_property;
|
||||
|
||||
/**
|
||||
* GESTrackEffect:bin_description:
|
||||
*
|
||||
* The description of the effect bin with a gst-launch-style
|
||||
* pipeline description.
|
||||
* exemple: videobalance saturation=1.5 hue=+0.5
|
||||
*/
|
||||
g_object_class_install_property (object_class, PROP_BIN_DESCRIPTION,
|
||||
g_param_spec_string ("bin-description",
|
||||
"bin description",
|
||||
"Bin description of the effect",
|
||||
NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
||||
|
||||
timobj_class->create_track_object = ges_tl_effect_create_track_object;
|
||||
timobj_class->need_fill_track = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
ges_timeline_effect_init (GESTimelineEffect * self)
|
||||
{
|
||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
||||
GES_TYPE_TIMELINE_EFFECT, GESTimelineEffectPrivate);
|
||||
|
||||
}
|
||||
|
||||
static GESTrackObject *
|
||||
ges_tl_effect_create_track_object (GESTimelineObject * self, GESTrack * track)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* ges_timeline_effect_new_from_bin_desc:
|
||||
* @bin_description: The gst-launch like bin description of the effect
|
||||
*
|
||||
* Creates a new #GESTimelineEffect from the description of the bin. This is
|
||||
* a convenience method for testing puposes.
|
||||
*
|
||||
* Returns: a newly created #GESTimelineEffect, or %NULL if something went
|
||||
* wrong.
|
||||
*/
|
||||
GESTimelineEffect *
|
||||
ges_timeline_effect_new_from_bin_desc (const gchar * bin_description)
|
||||
{
|
||||
return g_object_new (GES_TYPE_TIMELINE_EFFECT, "bin-description",
|
||||
bin_description, NULL);
|
||||
}
|
81
ges/ges-timeline-effect.h
Normal file
81
ges/ges-timeline-effect.h
Normal file
|
@ -0,0 +1,81 @@
|
|||
/* GStreamer Editing Services
|
||||
* Copyright (C) 2011 Thibault Saunier <thibault.saunier@collabora.co.uk>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef _GES_TIMELINE_EFFECT
|
||||
#define _GES_TIMELINE_EFFECT
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <ges/ges.h>
|
||||
#include "ges-types.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GES_TYPE_TIMELINE_EFFECT ges_timeline_effect_get_type()
|
||||
|
||||
#define GES_TIMELINE_EFFECT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_TIMELINE_EFFECT, GESTimelineEffect))
|
||||
|
||||
#define GES_TIMELINE_EFFECT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_TIMELINE_EFFECT, GESTimelineEffectClass))
|
||||
|
||||
#define GES_IS_TIMELINE_EFFECT(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_TIMELINE_EFFECT))
|
||||
|
||||
#define GES_IS_TIMELINE_EFFECT_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_TIMELINE_EFFECT))
|
||||
|
||||
#define GES_TIMELINE_EFFECT_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_TIMELINE_EFFECT, GESTimelineEffectClass))
|
||||
|
||||
typedef struct _GESTimelineEffectPrivate GESTimelineEffectPrivate;
|
||||
|
||||
/**
|
||||
* GESTimelineEffect:
|
||||
*/
|
||||
struct _GESTimelineEffect {
|
||||
/*< private >*/
|
||||
GESTimelineOperation parent;
|
||||
|
||||
GESTimelineEffectPrivate *priv;
|
||||
|
||||
/* Padding for API extension */
|
||||
gpointer _ges_reserved[GES_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GESTimelineEffectClass:
|
||||
*
|
||||
*/
|
||||
|
||||
struct _GESTimelineEffectClass {
|
||||
/*< private >*/
|
||||
GESTimelineOperationClass parent_class;
|
||||
|
||||
/* Padding for API extension */
|
||||
gpointer _ges_reserved[GES_PADDING];
|
||||
};
|
||||
|
||||
GType ges_timeline_effect_get_type (void);
|
||||
|
||||
GESTimelineEffect *
|
||||
ges_timeline_effect_new_from_bin_desc(const gchar *bin_description);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _GES_TIMELINE_EFFECT */
|
|
@ -50,6 +50,9 @@ typedef struct _GESTimelinePipelineClass GESTimelinePipelineClass;
|
|||
typedef struct _GESTimelineSource GESTimelineSource;
|
||||
typedef struct _GESTimelineSourceClass GESTimelineSourceClass;
|
||||
|
||||
typedef struct _GESTimelineEffect GESTimelineEffect;
|
||||
typedef struct _GESTimelineEffectClass GESTimelineEffectClass;
|
||||
|
||||
typedef struct _GESTimelineFileSource GESTimelineFileSource;
|
||||
typedef struct _GESTimelineFileSourceClass GESTimelineFileSourceClass;
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#include <ges/ges-track-source.h>
|
||||
|
||||
#include <ges/ges-custom-timeline-source.h>
|
||||
#include <ges/ges-timeline-effect.h>
|
||||
#include <ges/ges-timeline-file-source.h>
|
||||
#include <ges/ges-track-filesource.h>
|
||||
#include <ges/ges-track-image-source.h>
|
||||
|
|
Loading…
Reference in a new issue