mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
Move NLE to a dedicated GstPlugin
Summary: Allowing external user to directly use it Reviewers: Mathieu_Du Differential Revision: https://phabricator.freedesktop.org/D231
This commit is contained in:
parent
fdd1456062
commit
edc5c27ffb
27 changed files with 120 additions and 44 deletions
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"phabricator.uri" : "http://phabricator.freedesktop.org/"
|
||||
"phabricator.uri" : "https:\/\/phabricator.freedesktop.org\/api\/"
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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__ */
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
24
ges/ges.c
24
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;
|
||||
|
||||
|
|
1
plugins/Makefile.am
Normal file
1
plugins/Makefile.am
Normal file
|
@ -0,0 +1 @@
|
|||
SUBDIRS = nle
|
0
ges/nle/.gitignore → plugins/nle/.gitignore
vendored
0
ges/nle/.gitignore → plugins/nle/.gitignore
vendored
30
plugins/nle/Makefile.am
Normal file
30
plugins/nle/Makefile.am
Normal file
|
@ -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
|
66
plugins/nle/gstnle.c
Normal file
66
plugins/nle/gstnle.c
Normal file
|
@ -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)
|
Loading…
Reference in a new issue