summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2015-08-19 11:24:11 +0200
committerThibault Saunier <tsaunier@gnome.org>2015-08-20 13:49:20 +0200
commitedc5c27ffbcc527d6bc8121463228eaa015e9cdd (patch)
tree30b92f073e0f4ea6f732879d9205b78dd2152ba2
parentfdd1456062f64714cd57108380e696d28b14aad6 (diff)
Move NLE to a dedicated GstPlugin
Summary: Allowing external user to directly use it Reviewers: Mathieu_Du Differential Revision: https://phabricator.freedesktop.org/D231
-rw-r--r--.arcconfig2
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac8
-rw-r--r--ges/Makefile.am15
-rw-r--r--ges/ges-internal.h1
-rw-r--r--ges/ges-track.c5
-rw-r--r--ges/ges-utils.c10
-rw-r--r--ges/ges.c24
-rw-r--r--plugins/Makefile.am1
-rw-r--r--plugins/nle/.gitignore (renamed from ges/nle/.gitignore)0
-rw-r--r--plugins/nle/Makefile.am30
-rw-r--r--plugins/nle/gnlmarshal.list (renamed from ges/nle/gnlmarshal.list)0
-rw-r--r--plugins/nle/gstnle.c66
-rw-r--r--plugins/nle/nle.h (renamed from ges/nle/nle.h)0
-rw-r--r--plugins/nle/nlecomposition.c (renamed from ges/nle/nlecomposition.c)0
-rw-r--r--plugins/nle/nlecomposition.h (renamed from ges/nle/nlecomposition.h)0
-rw-r--r--plugins/nle/nleghostpad.c (renamed from ges/nle/nleghostpad.c)0
-rw-r--r--plugins/nle/nleghostpad.h (renamed from ges/nle/nleghostpad.h)0
-rw-r--r--plugins/nle/nleobject.c (renamed from ges/nle/nleobject.c)0
-rw-r--r--plugins/nle/nleobject.h (renamed from ges/nle/nleobject.h)0
-rw-r--r--plugins/nle/nleoperation.c (renamed from ges/nle/nleoperation.c)0
-rw-r--r--plugins/nle/nleoperation.h (renamed from ges/nle/nleoperation.h)0
-rw-r--r--plugins/nle/nlesource.c (renamed from ges/nle/nlesource.c)0
-rw-r--r--plugins/nle/nlesource.h (renamed from ges/nle/nlesource.h)0
-rw-r--r--plugins/nle/nletypes.h (renamed from ges/nle/nletypes.h)0
-rw-r--r--plugins/nle/nleurisource.c (renamed from ges/nle/nleurisource.c)0
-rw-r--r--plugins/nle/nleurisource.h (renamed from ges/nle/nleurisource.h)0
27 files changed, 120 insertions, 44 deletions
diff --git a/.arcconfig b/.arcconfig
index fc70fd3d..728aa7a4 100644
--- a/.arcconfig
+++ b/.arcconfig
@@ -1,3 +1,3 @@
{
- "phabricator.uri" : "http://phabricator.freedesktop.org/"
+ "phabricator.uri" : "https:\/\/phabricator.freedesktop.org\/api\/"
}
diff --git a/Makefile.am b/Makefile.am
index 127de2d4..c9c83a38 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
-SUBDIRS = ges tests tools common m4 pkgconfig docs bindings
+SUBDIRS = ges tests tools common m4 pkgconfig docs bindings plugins
DIST_SUBDIRS = $(SUBDIRS)
diff --git a/configure.ac b/configure.ac
index 3a20a231..65ed31a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -235,6 +235,12 @@ AG_GST_CHECK_GST_CONTROLLER($GST_API_VERSION, [$GST_REQ], yes)
AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes)
AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
+AG_GST_ARG_WITH_PLUGINS
+AG_GST_CHECK_PLUGIN(plugins)
+
+dnl set location of plugin directory
+AG_GST_SET_PLUGINDIR
+
GSTPB_PLUGINS_DIR=`$PKG_CONFIG gstreamer-plugins-base-$GST_API_VERSION --variable pluginsdir`
AC_SUBST(GSTPB_PLUGINS_DIR)
AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
@@ -420,6 +426,8 @@ docs/libs/Makefile
pkgconfig/Makefile
pkgconfig/gst-editing-services.pc
pkgconfig/gst-editing-services-uninstalled.pc
+plugins/Makefile
+plugins/nle/Makefile
bindings/Makefile
bindings/python/Makefile
bindings/python/gi/Makefile
diff --git a/ges/Makefile.am b/ges/Makefile.am
index 0c300832..8f459242 100644
--- a/ges/Makefile.am
+++ b/ges/Makefile.am
@@ -15,12 +15,6 @@ nodist_libges_@GST_API_VERSION@_la_SOURCES = lex.priv_ges_parse_yy.c parse_lex.h
libges_@GST_API_VERSION@_la_SOURCES = \
$(built_source_make) \
- nle/nleobject.c \
- nle/nlecomposition.c \
- nle/nleghostpad.c \
- nle/nleoperation.c \
- nle/nlesource.c \
- nle/nleurisource.c \
ges.c \
ges-enums.c \
ges-meta-container.c \
@@ -151,15 +145,6 @@ libges_@GST_API_VERSION@include_HEADERS = \
ges-version.h
noinst_HEADERS = \
- nle/nle.h \
- nle/nleobject.h \
- nle/nlecomposition.h \
- nle/nletypes.h \
- nle/nleghostpad.h \
- nle/nleoperation.h \
- nle/nlesource.h \
- nle/nletypes.h \
- nle/nleurisource.h \
ges-internal.h \
ges-auto-transition.h \
ges-structured-interface.h \
diff --git a/ges/ges-internal.h b/ges/ges-internal.h
index 53a775da..cf3852c3 100644
--- a/ges/ges-internal.h
+++ b/ges/ges-internal.h
@@ -382,5 +382,6 @@ G_GNUC_INTERNAL GESMultiFileURI * ges_multi_file_uri_new (const gchar * uri);
G_GNUC_INTERNAL gboolean nle_composition_add_object (GstElement *comp, GstElement *object);
G_GNUC_INTERNAL gboolean nle_composition_remove_object (GstElement *comp, GstElement *object);
+G_GNUC_INTERNAL gboolean nle_object_commit (GstElement * nlesource, gboolean recurse);
#endif /* __GES_INTERNAL_H__ */
diff --git a/ges/ges-track.c b/ges/ges-track.c
index e573f85a..8d663422 100644
--- a/ges/ges-track.c
+++ b/ges/ges-track.c
@@ -33,7 +33,6 @@
#include "ges-meta-container.h"
#include "ges-video-track.h"
#include "ges-audio-track.h"
-#include "nle/nleobject.h"
G_DEFINE_TYPE_WITH_CODE (GESTrack, ges_track, GST_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GES_TYPE_META_CONTAINER, NULL));
@@ -453,7 +452,7 @@ ges_track_dispose (GObject * object)
(GFunc) dispose_trackelements_foreach, track);
g_sequence_free (priv->trackelements_by_start);
g_list_free_full (priv->gaps, (GDestroyNotify) free_gap);
- nle_object_commit (NLE_OBJECT (track->priv->composition), TRUE);
+ nle_object_commit (track->priv->composition, TRUE);
if (priv->mixing_operation)
gst_object_unref (priv->mixing_operation);
@@ -1096,7 +1095,7 @@ ges_track_commit (GESTrack * track)
track_resort_and_fill_gaps (track);
- return nle_object_commit (NLE_OBJECT (track->priv->composition), TRUE);
+ return nle_object_commit (track->priv->composition, TRUE);
}
diff --git a/ges/ges-utils.c b/ges/ges-utils.c
index 21eb5dc9..4be6be4f 100644
--- a/ges/ges-utils.c
+++ b/ges/ges-utils.c
@@ -173,3 +173,13 @@ nle_composition_remove_object (GstElement * comp, GstElement * object)
{
return gst_bin_remove (GST_BIN (comp), object);
}
+
+gboolean
+nle_object_commit (GstElement * nlesource, gboolean recurse)
+{
+ gboolean ret;
+
+ g_signal_emit_by_name (nlesource, "commit", recurse, &ret);
+
+ return ret;
+}
diff --git a/ges/ges.c b/ges/ges.c
index f1697295..5cc39f43 100644
--- a/ges/ges.c
+++ b/ges/ges.c
@@ -34,7 +34,6 @@
#include <ges/ges.h>
#include "ges/gstframepositionner.h"
#include "ges-internal.h"
-#include "ges/nle/nle.h"
#define GES_GNONLIN_VERSION_NEEDED_MAJOR 1
#define GES_GNONLIN_VERSION_NEEDED_MINOR 2
@@ -44,20 +43,6 @@ GST_DEBUG_CATEGORY (_ges_debug);
static gboolean ges_initialized = FALSE;
-struct _elements_entry
-{
- const gchar *name;
- GType (*type) (void);
-};
-
-static struct _elements_entry _elements[] = {
- {"nlesource", nle_source_get_type},
- {"nlecomposition", nle_composition_get_type},
- {"nleoperation", nle_operation_get_type},
- {"nleurisource", nle_urisource_get_type},
- {NULL, 0}
-};
-
/**
* ges_init:
*
@@ -69,8 +54,6 @@ static struct _elements_entry _elements[] = {
gboolean
ges_init (void)
{
- gint i = 0;
-
/* initialize debugging category */
GST_DEBUG_CATEGORY_INIT (_ges_debug, "ges", GST_DEBUG_FG_YELLOW,
"GStreamer Editing Services");
@@ -108,13 +91,6 @@ ges_init (void)
GST_TYPE_FRAME_POSITIONNER);
gst_element_register (NULL, "gespipeline", 0, GES_TYPE_PIPELINE);
- for (; _elements[i].name; i++)
- if (!(gst_element_register (NULL,
- _elements[i].name, GST_RANK_NONE, (_elements[i].type) ())))
- return FALSE;
-
- nle_init_ghostpad_category ();
-
/* TODO: user-defined types? */
ges_initialized = TRUE;
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
new file mode 100644
index 00000000..7f0a0065
--- /dev/null
+++ b/plugins/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = nle
diff --git a/ges/nle/.gitignore b/plugins/nle/.gitignore
index 3ac440bf..3ac440bf 100644
--- a/ges/nle/.gitignore
+++ b/plugins/nle/.gitignore
diff --git a/plugins/nle/Makefile.am b/plugins/nle/Makefile.am
new file mode 100644
index 00000000..2e8fa57d
--- /dev/null
+++ b/plugins/nle/Makefile.am
@@ -0,0 +1,30 @@
+plugin_LTLIBRARIES = libgstnle.la
+
+libgstnle_la_SOURCES = gstnle.c \
+ nleobject.c \
+ nlecomposition.c \
+ nleghostpad.c \
+ nleoperation.c \
+ nlesource.c \
+ nleurisource.c
+
+libgstnle_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \
+ $(GST_BASE_CFLAGS) $(GST_CFLAGS) \
+ -I$(top_srcdir)
+
+libgstnle_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \
+ $(GST_BASE_LIBS) $(GST_LIBS)
+
+libgstnle_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
+libgstnle_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
+
+noinst_HEADERS = \
+ nle.h \
+ nleobject.h \
+ nlecomposition.h \
+ nletypes.h \
+ nleghostpad.h \
+ nleoperation.h \
+ nlesource.h \
+ nletypes.h \
+ nleurisource.h
diff --git a/ges/nle/gnlmarshal.list b/plugins/nle/gnlmarshal.list
index 67c63946..67c63946 100644
--- a/ges/nle/gnlmarshal.list
+++ b/plugins/nle/gnlmarshal.list
diff --git a/plugins/nle/gstnle.c b/plugins/nle/gstnle.c
new file mode 100644
index 00000000..df32330a
--- /dev/null
+++ b/plugins/nle/gstnle.c
@@ -0,0 +1,66 @@
+/* Non Linear Engine plugin
+ *
+ * Copyright (C) 2015 Thibault Saunier <thibault.saunier@collabora.com>
+ *
+ * gstnle.c
+ *
+ * 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., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gst/gst.h>
+#include "nle.h"
+
+struct _elements_entry
+{
+ const gchar *name;
+ GType (*type) (void);
+};
+
+static struct _elements_entry _elements[] = {
+ {"nlesource", nle_source_get_type},
+ {"nlecomposition", nle_composition_get_type},
+ {"nleoperation", nle_operation_get_type},
+ {"nleurisource", nle_urisource_get_type},
+ {NULL, 0}
+};
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+ gint i = 0;
+
+ for (; _elements[i].name; i++)
+ if (!(gst_element_register (plugin,
+ _elements[i].name, GST_RANK_NONE, (_elements[i].type) ())))
+ return FALSE;
+
+ nle_init_ghostpad_category ();
+
+ return TRUE;
+}
+
+/* plugin export resolution */
+GST_PLUGIN_DEFINE
+ (GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ nle,
+ "GStreamer Non Linear Engine",
+ plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
diff --git a/ges/nle/nle.h b/plugins/nle/nle.h
index 6e00eae4..6e00eae4 100644
--- a/ges/nle/nle.h
+++ b/plugins/nle/nle.h
diff --git a/ges/nle/nlecomposition.c b/plugins/nle/nlecomposition.c
index 7b69589b..7b69589b 100644
--- a/ges/nle/nlecomposition.c
+++ b/plugins/nle/nlecomposition.c
diff --git a/ges/nle/nlecomposition.h b/plugins/nle/nlecomposition.h
index 9f5da3d8..9f5da3d8 100644
--- a/ges/nle/nlecomposition.h
+++ b/plugins/nle/nlecomposition.h
diff --git a/ges/nle/nleghostpad.c b/plugins/nle/nleghostpad.c
index c98364ae..c98364ae 100644
--- a/ges/nle/nleghostpad.c
+++ b/plugins/nle/nleghostpad.c
diff --git a/ges/nle/nleghostpad.h b/plugins/nle/nleghostpad.h
index 25fd3626..25fd3626 100644
--- a/ges/nle/nleghostpad.h
+++ b/plugins/nle/nleghostpad.h
diff --git a/ges/nle/nleobject.c b/plugins/nle/nleobject.c
index 94be16d2..94be16d2 100644
--- a/ges/nle/nleobject.c
+++ b/plugins/nle/nleobject.c
diff --git a/ges/nle/nleobject.h b/plugins/nle/nleobject.h
index 1e0272e4..1e0272e4 100644
--- a/ges/nle/nleobject.h
+++ b/plugins/nle/nleobject.h
diff --git a/ges/nle/nleoperation.c b/plugins/nle/nleoperation.c
index fa59734c..fa59734c 100644
--- a/ges/nle/nleoperation.c
+++ b/plugins/nle/nleoperation.c
diff --git a/ges/nle/nleoperation.h b/plugins/nle/nleoperation.h
index 3f68f5d8..3f68f5d8 100644
--- a/ges/nle/nleoperation.h
+++ b/plugins/nle/nleoperation.h
diff --git a/ges/nle/nlesource.c b/plugins/nle/nlesource.c
index fcb98506..fcb98506 100644
--- a/ges/nle/nlesource.c
+++ b/plugins/nle/nlesource.c
diff --git a/ges/nle/nlesource.h b/plugins/nle/nlesource.h
index 6fcb1af4..6fcb1af4 100644
--- a/ges/nle/nlesource.h
+++ b/plugins/nle/nlesource.h
diff --git a/ges/nle/nletypes.h b/plugins/nle/nletypes.h
index f84cb23b..f84cb23b 100644
--- a/ges/nle/nletypes.h
+++ b/plugins/nle/nletypes.h
diff --git a/ges/nle/nleurisource.c b/plugins/nle/nleurisource.c
index 8fd2950a..8fd2950a 100644
--- a/ges/nle/nleurisource.c
+++ b/plugins/nle/nleurisource.c
diff --git a/ges/nle/nleurisource.h b/plugins/nle/nleurisource.h
index a2750e59..a2750e59 100644
--- a/ges/nle/nleurisource.h
+++ b/plugins/nle/nleurisource.h