Cleanup import of GNL and rename gnl to nle for Non Linear Engine

Conflicts:
	ges/ges-track-element.c
	gnl/Makefile.am
	gnl/common

Conflicts:
	ges/ges-internal.h
	ges/ges-track.c
	ges/ges-utils.c
	ges/nle/.gitignore
	ges/nle/gnlmarshal.list
	ges/nle/nle.h
	ges/nle/nlecomposition.c
	ges/nle/nlecomposition.h
	ges/nle/nleghostpad.c
	ges/nle/nleghostpad.h
	ges/nle/nleobject.c
	ges/nle/nleoperation.c
	ges/nle/nleoperation.h
	ges/nle/nlesource.c
	ges/nle/nlesource.h
	ges/nle/nletypes.h
	ges/nle/nleurisource.c
	ges/nle/nleurisource.h
	gnl/Makefile.am
	gnl/gnl.c
	gnl/gnl.h
	gnl/gnl/gnl.h
	gnl/gnl/gnlcomposition.c
	gnl/gnl/gnlcomposition.h
	gnl/gnl/gnlghostpad.c
	gnl/gnl/gnlghostpad.h
	gnl/gnl/gnlmarshal.list
	gnl/gnl/gnlobject.c
	gnl/gnl/gnloperation.c
	gnl/gnl/gnloperation.h
	gnl/gnl/gnlsource.c
	gnl/gnl/gnlsource.h
	gnl/gnl/gnltypes.h
	gnl/gnl/gnlurisource.c
	gnl/gnl/gnlurisource.h
	gnl/gnlcomposition.c
	gnl/gnlcomposition.h
	gnl/gnlghostpad.c
	gnl/gnlghostpad.h
	gnl/gnlmarshal.list
	gnl/gnlobject.c
	gnl/gnlobject.h
	gnl/gnloperation.c
	gnl/gnloperation.h
	gnl/gnlsource.c
	gnl/gnlsource.h
	gnl/gnltypes.h
	gnl/gnlurisource.c
	gnl/gnlurisource.h
	gnl/tests/check/gnl/common.c
	gnl/tests/check/gnl/common.h
	gnl/tests/check/gnl/complex.c
	gnl/tests/check/gnl/gnlcomposition.c
	gnl/tests/check/gnl/gnloperation.c
	gnl/tests/check/gnl/gnlsource.c
	gnl/tests/check/gnl/seek.c
	gnl/tests/check/gnl/simple.c
	tests/check/gnl/common.c
	tests/check/gnl/common.h
	tests/check/gnl/complex.c
	tests/check/gnl/gnlcomposition.c
	tests/check/gnl/gnloperation.c
	tests/check/gnl/gnlsource.c
	tests/check/gnl/seek.c
	tests/check/gnl/simple.c
	tests/check/nle/common.c
	tests/check/nle/common.h
	tests/check/nle/complex.c
	tests/check/nle/nlecomposition.c
	tests/check/nle/nleoperation.c
	tests/check/nle/nlesource.c
	tests/check/nle/seek.c
	tests/check/nle/simple.c
This commit is contained in:
Thibault Saunier 2014-08-15 15:48:14 +02:00
parent aa1ba05895
commit 11f9c6e108
60 changed files with 1598 additions and 1657 deletions

View file

@ -130,7 +130,7 @@ GESTrackElement
GESTrackElementClass GESTrackElementClass
ges_track_element_set_active ges_track_element_set_active
ges_track_element_get_track ges_track_element_get_track
ges_track_element_get_gnlobject ges_track_element_get_nleobject
ges_track_element_get_element ges_track_element_get_element
ges_track_element_is_active ges_track_element_is_active
ges_track_element_lookup_child ges_track_element_lookup_child

View file

@ -342,7 +342,7 @@ Index of features:
GESTimelineObject, which proxies it to the relevant GESTrackObject. GESTimelineObject, which proxies it to the relevant GESTrackObject.
Create a new GESTrack{Audio|Video}Compositing GstElement which will Create a new GESTrack{Audio|Video}Compositing GstElement which will
be put in each track as a priority 0 expandable GnlOperation. be put in each track as a priority 0 expandable NleOperation.
That object will be able to figure out which That object will be able to figure out which
mixing/scaling/conversion elements to use at any given time by mixing/scaling/conversion elements to use at any given time by
inspecting: inspecting:
@ -392,11 +392,11 @@ Index of features:
through publically available APIs (GObject and GStreamer APIs). through publically available APIs (GObject and GStreamer APIs).
The GESTrackObject for example has to duplicate exactly the same The GESTrackObject for example has to duplicate exactly the same
properties as GnlObject for no reason. properties as NleObject for no reason.
Other properties are also expensive to re-compute and also become Other properties are also expensive to re-compute and also become
non-MT-safe (like computing the exact 'tree' of objects at a non-MT-safe (like computing the exact 'tree' of objects at a
certain position in a GnlComposition). certain position in a NleComposition).
Merge the GES and GNonLin modules together into one single module, Merge the GES and GNonLin modules together into one single module,
and keep the same previous API for both for backward compatibility. and keep the same previous API for both for backward compatibility.

View file

@ -12,7 +12,7 @@ ges_timeline_layer_add_object(layer, tlobj)
trobj = GESTimelineObject::create_track_objects trobj = GESTimelineObject::create_track_objects
ges_track_add_object(TRACK, trobj) ges_track_add_object(TRACK, trobj)
ges_track_object_set_track(troj, TRACK) ges_track_object_set_track(troj, TRACK)
gnlobj = GESTrackObject::create_gnl_object nleobj = GESTrackObject::create_nle_object
ges_timeline_object_fill_track_object(tlobj, trobj, gnlobj) ges_timeline_object_fill_track_object(tlobj, trobj, nleobj)
GESTimelineObject::fill_track_object GESTimelineObject::fill_track_object

View file

@ -37,7 +37,7 @@ SCENARIOS
==> ges_track_add_object (track, trackobject); ==> ges_track_add_object (track, trackobject);
Set the track on the TrackObject Set the track on the TrackObject
==> ges_track_object_set_track (track) ==> ges_track_object_set_track (track)
The GESTrackObject can create the GnlObject The GESTrackObject can create the NleObject
@ -108,7 +108,7 @@ Methods
return ges_track_source_new(); return ges_track_source_new();
* gboolean * gboolean
ges_timeline_object_fill_track_object (GESTimelineObject *tlo, GESTrackObject *tro, GstElement *gnlobj); ges_timeline_object_fill_track_object (GESTimelineObject *tlo, GESTrackObject *tro, GstElement *nleobj);
* up to the implementation :) * up to the implementation :)
@ -120,8 +120,8 @@ Methods
* Set the track on the track_object * Set the track on the track_object
ges_track_object_set_track (object, track); ges_track_object_set_track (object, track);
* Add the GnlObject of the TrackObject to the composition * Add the NleObject of the TrackObject to the composition
gst_bin_add (track->composition, object->gnlobject); gst_bin_add (track->composition, object->nleobject);
[ GESTrackObject ] [ GESTrackObject ]
@ -130,14 +130,14 @@ Methods
ges_track_object_set_track (GESTrackObject * object, GESTrack * track); ges_track_object_set_track (GESTrackObject * object, GESTrack * track);
* Set the track field of the TrackObject * Set the track field of the TrackObject
* if no GnlObject is available yet: * if no NleObject is available yet:
* Call the 'create_gnl_object' virtual method * Call the 'create_nle_object' virtual method
* Virtual-method for GESTrackObject::create_gnl_object * Virtual-method for GESTrackObject::create_nle_object
* Create a GnlObject of the proper type * Create a NleObject of the proper type
Ex : gnlobject = gst_element_factory_make("gnlsource", NULL); Ex : nleobject = gst_element_factory_make("nlesource", NULL);
* Ask the TimelineObject to fill in the GnlObject * Ask the TimelineObject to fill in the NleObject
=> ges_timeline_object_fill_track_object (GESTimelineObject * tlo, GESTrackObject * tro, GstElement * gnlobj); => ges_timeline_object_fill_track_object (GESTimelineObject * tlo, GESTrackObject * tro, GstElement * nleobj);

View file

@ -3,12 +3,19 @@ built_source_make =
lib_LTLIBRARIES = libges-@GST_API_VERSION@.la lib_LTLIBRARIES = libges-@GST_API_VERSION@.la
EXTRA_libges_@GST_API_VERSION@_la_SOURCES = gesmarshal.list EXTRA_libges_@GST_API_VERSION@_la_SOURCES = gesmarshal.list
CLEANFILES = $(BUILT_SOURCES) $(built_header_make) $(built_source_make) *.gcno *.gcda *.gcov *.gcov.out CLEANFILES = $(BUILT_SOURCES) $(built_header_make) $(built_source_make) *.gcno *.gcda *.gcov *.gcov.out
libges_@GST_API_VERSION@_la_SOURCES = \ libges_@GST_API_VERSION@_la_SOURCES = \
$(built_source_make) \ $(built_source_make) \
nle/nleobject.c \
nle/nlecomposition.c \
nle/nleghostpad.c \
nle/nleoperation.c \
nle/nlesource.c \
nle/nleurisource.c \
ges.c \ ges.c \
ges-enums.c \ ges-enums.c \
ges-meta-container.c \ ges-meta-container.c \
@ -134,6 +141,15 @@ libges_@GST_API_VERSION@include_HEADERS = \
ges-version.h ges-version.h
noinst_HEADERS = \ 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-internal.h \
ges-auto-transition.h \ ges-auto-transition.h \
gstframepositionner.h gstframepositionner.h

View file

@ -101,7 +101,7 @@ ges_audio_source_class_init (GESAudioSourceClass * klass)
g_type_class_add_private (klass, sizeof (GESAudioSourcePrivate)); g_type_class_add_private (klass, sizeof (GESAudioSourcePrivate));
track_class->gnlobject_factorytype = "gnlsource"; track_class->nleobject_factorytype = "nlesource";
track_class->create_element = ges_audio_source_create_element; track_class->create_element = ges_audio_source_create_element;
audio_source_class->create_source = NULL; audio_source_class->create_source = NULL;
} }

View file

@ -254,12 +254,12 @@ ges_audio_transition_duration_changed (GESTrackElement * track_element,
guint64 duration) guint64 duration)
{ {
GESAudioTransition *self; GESAudioTransition *self;
GstElement *gnlobj = ges_track_element_get_gnlobject (track_element); GstElement *nleobj = ges_track_element_get_nleobject (track_element);
GstTimedValueControlSource *ta, *tb; GstTimedValueControlSource *ta, *tb;
self = GES_AUDIO_TRANSITION (track_element); self = GES_AUDIO_TRANSITION (track_element);
GST_INFO ("updating controller: gnlobj (%p)", gnlobj); GST_INFO ("updating controller: nleobj (%p)", nleobj);
if (G_UNLIKELY ((!self->priv->a_control_source || if (G_UNLIKELY ((!self->priv->a_control_source ||
!self->priv->b_control_source))) !self->priv->b_control_source)))

View file

@ -92,10 +92,10 @@ _get_priority_range (GESContainer * container, guint32 * min_priority,
GESLayer *layer = GES_CLIP (container)->priv->layer; GESLayer *layer = GES_CLIP (container)->priv->layer;
if (layer) { if (layer) {
*min_priority = layer->min_gnl_priority; *min_priority = layer->min_nle_priority;
*max_priority = layer->max_gnl_priority; *max_priority = layer->max_nle_priority;
} else { } else {
*min_priority = MIN_GNL_PRIO; *min_priority = MIN_NLE_PRIO;
*max_priority = G_MAXUINT32; *max_priority = G_MAXUINT32;
} }
} }
@ -223,7 +223,7 @@ _set_priority (GESTimelineElement * element, guint32 priority)
for (tmp = container->children; tmp; tmp = g_list_next (tmp)) { for (tmp = container->children; tmp; tmp = g_list_next (tmp)) {
guint32 real_tck_prio; guint32 real_tck_prio;
GESTimelineElement *child = (GESTimelineElement *) tmp->data; GESTimelineElement *child = (GESTimelineElement *) tmp->data;
gint off = _PRIORITY (child) - _PRIORITY (element) - MIN_GNL_PRIO; gint off = _PRIORITY (child) - _PRIORITY (element) - MIN_NLE_PRIO;
if (off >= LAYER_HEIGHT) if (off >= LAYER_HEIGHT)
off = 0; off = 0;

View file

@ -43,18 +43,18 @@ typedef struct _GESClipPrivate GESClipPrivate;
* GESFillTrackElementFunc: * GESFillTrackElementFunc:
* @clip: the #GESClip controlling the track elements * @clip: the #GESClip controlling the track elements
* @track_element: the #GESTrackElement * @track_element: the #GESTrackElement
* @gnlobj: the GNonLin object that needs to be filled. * @nleobj: the GNonLin object that needs to be filled.
* *
* A function that will be called when the GNonLin object of a corresponding * A function that will be called when the GNonLin object of a corresponding
* track element needs to be filled. * track element needs to be filled.
* *
* The implementer of this function shall add the proper #GstElement to @gnlobj * The implementer of this function shall add the proper #GstElement to @nleobj
* using gst_bin_add(). * using gst_bin_add().
* *
* Returns: TRUE if the implementer succesfully filled the @gnlobj, else #FALSE. * Returns: TRUE if the implementer succesfully filled the @nleobj, else #FALSE.
*/ */
typedef gboolean (*GESFillTrackElementFunc) (GESClip *clip, GESTrackElement *track_element, typedef gboolean (*GESFillTrackElementFunc) (GESClip *clip, GESTrackElement *track_element,
GstElement *gnlobj); GstElement *nleobj);
/** /**
* GESCreateTrackElementFunc: * GESCreateTrackElementFunc:

View file

@ -34,11 +34,11 @@
GST_DEBUG_CATEGORY_EXTERN (_ges_debug); GST_DEBUG_CATEGORY_EXTERN (_ges_debug);
#define GST_CAT_DEFAULT _ges_debug #define GST_CAT_DEFAULT _ges_debug
/* The first 2 GNL priorities are used for: /* The first 2 NLE priorities are used for:
* 0- The Mixing element * 0- The Mixing element
* 1- The Gaps * 1- The Gaps
*/ */
#define MIN_GNL_PRIO 2 #define MIN_NLE_PRIO 2
#define LAYER_HEIGHT 1000 #define LAYER_HEIGHT 1000
#define _START(obj) GES_TIMELINE_ELEMENT_START (obj) #define _START(obj) GES_TIMELINE_ELEMENT_START (obj)
@ -290,7 +290,7 @@ GList* ges_clip_create_track_elements (GESClip *clip, GESTrackType t
/**************************************************** /****************************************************
* GESTrackElement * * GESTrackElement *
****************************************************/ ****************************************************/
#define GNL_OBJECT_TRACK_ELEMENT_QUARK (g_quark_from_string ("gnl_object_track_element_quark")) #define NLE_OBJECT_TRACK_ELEMENT_QUARK (g_quark_from_string ("nle_object_track_element_quark"))
G_GNUC_INTERNAL gboolean ges_track_element_set_track (GESTrackElement * object, GESTrack * track); G_GNUC_INTERNAL gboolean ges_track_element_set_track (GESTrackElement * object, GESTrack * track);
G_GNUC_INTERNAL guint32 _ges_track_element_get_layer_priority (GESTrackElement * element); G_GNUC_INTERNAL guint32 _ges_track_element_get_layer_priority (GESTrackElement * element);
G_GNUC_INTERNAL void ges_track_element_copy_properties (GESTimelineElement * element, G_GNUC_INTERNAL void ges_track_element_copy_properties (GESTimelineElement * element,
@ -327,4 +327,11 @@ typedef struct GESMultiFileURI
G_GNUC_INTERNAL GESMultiFileURI * ges_multi_file_uri_new (const gchar * uri); G_GNUC_INTERNAL GESMultiFileURI * ges_multi_file_uri_new (const gchar * uri);
/********************
* Gnonlin helpers *
********************/
G_GNUC_INTERNAL gboolean nle_composition_add_object (GstElement *comp, GstElement *object);
G_GNUC_INTERNAL gboolean nle_composition_remove_object (GstElement *comp, GstElement *object);
#endif /* __GES_INTERNAL_H__ */ #endif /* __GES_INTERNAL_H__ */

View file

@ -209,8 +209,8 @@ ges_layer_init (GESLayer * self)
self->priv->priority = 0; self->priv->priority = 0;
self->priv->auto_transition = FALSE; self->priv->auto_transition = FALSE;
self->min_gnl_priority = MIN_GNL_PRIO; self->min_nle_priority = MIN_NLE_PRIO;
self->max_gnl_priority = LAYER_HEIGHT + MIN_GNL_PRIO; self->max_nle_priority = LAYER_HEIGHT + MIN_NLE_PRIO;
_register_metas (self); _register_metas (self);
} }
@ -376,8 +376,8 @@ ges_layer_set_priority (GESLayer * layer, guint priority)
if (priority != layer->priv->priority) { if (priority != layer->priv->priority) {
layer->priv->priority = priority; layer->priv->priority = priority;
layer->min_gnl_priority = (priority * LAYER_HEIGHT) + MIN_GNL_PRIO; layer->min_nle_priority = (priority * LAYER_HEIGHT) + MIN_NLE_PRIO;
layer->max_gnl_priority = ((priority + 1) * LAYER_HEIGHT) + MIN_GNL_PRIO; layer->max_nle_priority = ((priority + 1) * LAYER_HEIGHT) + MIN_NLE_PRIO;
ges_layer_resync_priorities (layer); ges_layer_resync_priorities (layer);
} }

View file

@ -57,7 +57,7 @@ struct _GESLayer {
GESTimeline *timeline; GESTimeline *timeline;
/*< protected >*/ /*< protected >*/
guint32 min_gnl_priority, max_gnl_priority; guint32 min_nle_priority, max_nle_priority;
GESLayerPrivate *priv; GESLayerPrivate *priv;

View file

@ -42,7 +42,7 @@ ges_operation_class_init (GESOperationClass * klass)
g_type_class_add_private (klass, sizeof (GESOperationPrivate)); g_type_class_add_private (klass, sizeof (GESOperationPrivate));
track_class->gnlobject_factorytype = "gnloperation"; track_class->nleobject_factorytype = "nleoperation";
} }
static void static void

View file

@ -129,7 +129,7 @@ ges_source_class_init (GESSourceClass * klass)
g_type_class_add_private (klass, sizeof (GESSourcePrivate)); g_type_class_add_private (klass, sizeof (GESSourcePrivate));
track_class->gnlobject_factorytype = "gnlsource"; track_class->nleobject_factorytype = "nlesource";
track_class->create_element = NULL; track_class->create_element = NULL;
} }

View file

@ -331,7 +331,7 @@ ges_timeline_dispose (GObject * object)
/* FIXME: it should be possible to remove tracks before removing /* FIXME: it should be possible to remove tracks before removing
* layers, but at the moment this creates a problem because the track * layers, but at the moment this creates a problem because the track
* objects aren't notified that their gnlobjects have been destroyed. * objects aren't notified that their nleobjects have been destroyed.
*/ */
while (tl->tracks) while (tl->tracks)
@ -379,7 +379,7 @@ ges_timeline_handle_message (GstBin * bin, GstMessage * message)
GstMessage *amessage = NULL; GstMessage *amessage = NULL;
const GstStructure *mstructure = gst_message_get_structure (message); const GstStructure *mstructure = gst_message_get_structure (message);
if (gst_structure_has_name (mstructure, "GnlCompositionStartUpdate")) { if (gst_structure_has_name (mstructure, "NleCompositionStartUpdate")) {
if (g_strcmp0 (gst_structure_get_string (mstructure, "reason"), "Seek")) { if (g_strcmp0 (gst_structure_get_string (mstructure, "reason"), "Seek")) {
GST_INFO_OBJECT (timeline, GST_INFO_OBJECT (timeline,
"A composition is starting an update because of %s" "A composition is starting an update because of %s"
@ -398,7 +398,7 @@ ges_timeline_handle_message (GstBin * bin, GstMessage * message)
} }
GST_OBJECT_UNLOCK (timeline); GST_OBJECT_UNLOCK (timeline);
} else if (gst_structure_has_name (mstructure, "GnlCompositionUpdateDone")) { } else if (gst_structure_has_name (mstructure, "NleCompositionUpdateDone")) {
if (g_strcmp0 (gst_structure_get_string (mstructure, "reason"), "Seek")) { if (g_strcmp0 (gst_structure_get_string (mstructure, "reason"), "Seek")) {
GST_INFO_OBJECT (timeline, GST_INFO_OBJECT (timeline,
"A composition is done updating because of %s" "A composition is done updating because of %s"
@ -3042,7 +3042,7 @@ ges_timeline_get_layers (GESTimeline * timeline)
* @timeline. * @timeline.
* *
* When timing changes happen in a timeline, the changes are not * When timing changes happen in a timeline, the changes are not
* directly done inside GNL. This method needs to be called so any changes * directly done inside NLE. This method needs to be called so any changes
* on a clip contained in the timeline actually happen at the media * on a clip contained in the timeline actually happen at the media
* processing level. * processing level.
* *

View file

@ -44,15 +44,15 @@ struct _GESTrackElementPrivate
{ {
GESTrackType track_type; GESTrackType track_type;
/* These fields are only used before the gnlobject is available */ /* These fields are only used before the nleobject is available */
guint64 pending_start; guint64 pending_start;
guint64 pending_inpoint; guint64 pending_inpoint;
guint64 pending_duration; guint64 pending_duration;
guint32 pending_priority; guint32 pending_priority;
gboolean pending_active; gboolean pending_active;
GstElement *gnlobject; /* The GnlObject */ GstElement *nleobject; /* The NleObject */
GstElement *element; /* The element contained in the gnlobject (can be NULL) */ GstElement *element; /* The element contained in the nleobject (can be NULL) */
/* We keep a link between properties name and elements internally /* We keep a link between properties name and elements internally
* The hashtable should look like * The hashtable should look like
@ -98,7 +98,7 @@ enum
static guint ges_track_element_signals[LAST_SIGNAL] = { 0 }; static guint ges_track_element_signals[LAST_SIGNAL] = { 0 };
static GstElement *ges_track_element_create_gnl_object_func (GESTrackElement * static GstElement *ges_track_element_create_nle_object_func (GESTrackElement *
object); object);
static void connect_properties_signals (GESTrackElement * object); static void connect_properties_signals (GESTrackElement * object);
@ -169,7 +169,7 @@ ges_track_element_dispose (GObject * object)
if (priv->bindings_hashtable) if (priv->bindings_hashtable)
g_hash_table_destroy (priv->bindings_hashtable); g_hash_table_destroy (priv->bindings_hashtable);
if (priv->gnlobject) { if (priv->nleobject) {
GstState cstate; GstState cstate;
if (priv->track != NULL) { if (priv->track != NULL) {
@ -179,15 +179,15 @@ ges_track_element_dispose (GObject * object)
" reference\n" " reference\n"
"This problem may also be caused by a refcounting bug in" "This problem may also be caused by a refcounting bug in"
" the application or GES itself.", object, priv->track); " the application or GES itself.", object, priv->track);
gst_element_get_state (priv->gnlobject, &cstate, NULL, 0); gst_element_get_state (priv->nleobject, &cstate, NULL, 0);
if (cstate != GST_STATE_NULL) if (cstate != GST_STATE_NULL)
gst_element_set_state (priv->gnlobject, GST_STATE_NULL); gst_element_set_state (priv->nleobject, GST_STATE_NULL);
} }
g_object_set_qdata (G_OBJECT (priv->gnlobject), g_object_set_qdata (G_OBJECT (priv->nleobject),
GNL_OBJECT_TRACK_ELEMENT_QUARK, NULL); NLE_OBJECT_TRACK_ELEMENT_QUARK, NULL);
gst_object_unref (priv->gnlobject); gst_object_unref (priv->nleobject);
priv->gnlobject = NULL; priv->nleobject = NULL;
} }
G_OBJECT_CLASS (ges_track_element_parent_class)->dispose (object); G_OBJECT_CLASS (ges_track_element_parent_class)->dispose (object);
@ -258,7 +258,7 @@ ges_track_element_class_init (GESTrackElementClass * klass)
element_class->set_priority = _set_priority; element_class->set_priority = _set_priority;
element_class->deep_copy = ges_track_element_copy_properties; element_class->deep_copy = ges_track_element_copy_properties;
klass->create_gnl_object = ges_track_element_create_gnl_object_func; klass->create_nle_object = ges_track_element_create_nle_object_func;
klass->list_children_properties = default_list_children_properties; klass->list_children_properties = default_list_children_properties;
} }
@ -272,7 +272,7 @@ ges_track_element_init (GESTrackElement * self)
priv->pending_start = 0; priv->pending_start = 0;
priv->pending_inpoint = 0; priv->pending_inpoint = 0;
priv->pending_duration = GST_SECOND; priv->pending_duration = GST_SECOND;
priv->pending_priority = MIN_GNL_PRIO; priv->pending_priority = MIN_NLE_PRIO;
priv->pending_active = TRUE; priv->pending_active = TRUE;
priv->bindings_hashtable = g_hash_table_new_full (g_str_hash, g_str_equal, priv->bindings_hashtable = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL); g_free, NULL);
@ -406,11 +406,11 @@ _set_start (GESTimelineElement * element, GstClockTime start)
{ {
GESTrackElement *object = GES_TRACK_ELEMENT (element); GESTrackElement *object = GES_TRACK_ELEMENT (element);
if (object->priv->gnlobject != NULL) { if (object->priv->nleobject != NULL) {
if (G_UNLIKELY (start == _START (object))) if (G_UNLIKELY (start == _START (object)))
return FALSE; return FALSE;
g_object_set (object->priv->gnlobject, "start", start, NULL); g_object_set (object->priv->nleobject, "start", start, NULL);
} else } else
object->priv->pending_start = start; object->priv->pending_start = start;
@ -422,12 +422,12 @@ _set_inpoint (GESTimelineElement * element, GstClockTime inpoint)
{ {
GESTrackElement *object = GES_TRACK_ELEMENT (element); GESTrackElement *object = GES_TRACK_ELEMENT (element);
if (object->priv->gnlobject != NULL) { if (object->priv->nleobject != NULL) {
if (G_UNLIKELY (inpoint == _INPOINT (object))) if (G_UNLIKELY (inpoint == _INPOINT (object)))
return FALSE; return FALSE;
g_object_set (object->priv->gnlobject, "inpoint", inpoint, NULL); g_object_set (object->priv->nleobject, "inpoint", inpoint, NULL);
} else } else
object->priv->pending_inpoint = inpoint; object->priv->pending_inpoint = inpoint;
@ -446,11 +446,11 @@ _set_duration (GESTimelineElement * element, GstClockTime duration)
duration > _INPOINT (object) + _MAXDURATION (element)) duration > _INPOINT (object) + _MAXDURATION (element))
duration = _MAXDURATION (element) - _INPOINT (object); duration = _MAXDURATION (element) - _INPOINT (object);
if (priv->gnlobject != NULL) { if (priv->nleobject != NULL) {
if (G_UNLIKELY (duration == _DURATION (object))) if (G_UNLIKELY (duration == _DURATION (object)))
return FALSE; return FALSE;
g_object_set (priv->gnlobject, "duration", duration, NULL); g_object_set (priv->nleobject, "duration", duration, NULL);
} else } else
priv->pending_duration = duration; priv->pending_duration = duration;
@ -465,19 +465,19 @@ _set_priority (GESTimelineElement * element, guint32 priority)
{ {
GESTrackElement *object = GES_TRACK_ELEMENT (element); GESTrackElement *object = GES_TRACK_ELEMENT (element);
if (priority < MIN_GNL_PRIO) { if (priority < MIN_NLE_PRIO) {
GST_INFO_OBJECT (element, "Priority (%d) < MIN_GNL_PRIO, setting it to %d", GST_INFO_OBJECT (element, "Priority (%d) < MIN_NLE_PRIO, setting it to %d",
priority, MIN_GNL_PRIO); priority, MIN_NLE_PRIO);
priority = MIN_GNL_PRIO; priority = MIN_NLE_PRIO;
} }
GST_DEBUG ("object:%p, priority:%" G_GUINT32_FORMAT, object, priority); GST_DEBUG ("object:%p, priority:%" G_GUINT32_FORMAT, object, priority);
if (object->priv->gnlobject != NULL) { if (object->priv->nleobject != NULL) {
if (G_UNLIKELY (priority == _PRIORITY (object))) if (G_UNLIKELY (priority == _PRIORITY (object)))
return FALSE; return FALSE;
g_object_set (object->priv->gnlobject, "priority", priority, NULL); g_object_set (object->priv->nleobject, "priority", priority, NULL);
} else } else
object->priv->pending_priority = priority; object->priv->pending_priority = priority;
@ -501,11 +501,11 @@ ges_track_element_set_active (GESTrackElement * object, gboolean active)
GST_DEBUG_OBJECT (object, "object:%p, active:%d", object, active); GST_DEBUG_OBJECT (object, "object:%p, active:%d", object, active);
if (object->priv->gnlobject != NULL) { if (object->priv->nleobject != NULL) {
if (G_UNLIKELY (active == object->active)) if (G_UNLIKELY (active == object->active))
return FALSE; return FALSE;
g_object_set (object->priv->gnlobject, "active", active, NULL); g_object_set (object->priv->nleobject, "active", active, NULL);
if (active != object->active) { if (active != object->active) {
object->active = active; object->active = active;
@ -564,29 +564,29 @@ connect_properties_signals (GESTrackElement * object)
(GHFunc) connect_signal, object); (GHFunc) connect_signal, object);
} }
/* default 'create_gnl_object' virtual method implementation */ /* default 'create_nle_object' virtual method implementation */
static GstElement * static GstElement *
ges_track_element_create_gnl_object_func (GESTrackElement * self) ges_track_element_create_nle_object_func (GESTrackElement * self)
{ {
GESTrackElementClass *klass = NULL; GESTrackElementClass *klass = NULL;
GstElement *child = NULL; GstElement *child = NULL;
GstElement *gnlobject; GstElement *nleobject;
klass = GES_TRACK_ELEMENT_GET_CLASS (self); klass = GES_TRACK_ELEMENT_GET_CLASS (self);
if (G_UNLIKELY (self->priv->gnlobject != NULL)) if (G_UNLIKELY (self->priv->nleobject != NULL))
goto already_have_gnlobject; goto already_have_nleobject;
if (G_UNLIKELY (klass->gnlobject_factorytype == NULL)) if (G_UNLIKELY (klass->nleobject_factorytype == NULL))
goto no_gnlfactory; goto no_nlefactory;
GST_DEBUG ("Creating a supporting gnlobject of type '%s'", GST_DEBUG ("Creating a supporting nleobject of type '%s'",
klass->gnlobject_factorytype); klass->nleobject_factorytype);
gnlobject = gst_element_factory_make (klass->gnlobject_factorytype, NULL); nleobject = gst_element_factory_make (klass->nleobject_factorytype, NULL);
if (G_UNLIKELY (gnlobject == NULL)) if (G_UNLIKELY (nleobject == NULL))
goto no_gnlobject; goto no_nleobject;
if (klass->create_element) { if (klass->create_element) {
GST_DEBUG ("Calling subclass 'create_element' vmethod"); GST_DEBUG ("Calling subclass 'create_element' vmethod");
@ -595,97 +595,97 @@ ges_track_element_create_gnl_object_func (GESTrackElement * self)
if (G_UNLIKELY (!child)) if (G_UNLIKELY (!child))
goto child_failure; goto child_failure;
if (!gst_bin_add (GST_BIN (gnlobject), child)) if (!gst_bin_add (GST_BIN (nleobject), child))
goto add_failure; goto add_failure;
GST_DEBUG ("Succesfully got the element to put in the gnlobject"); GST_DEBUG ("Succesfully got the element to put in the nleobject");
self->priv->element = child; self->priv->element = child;
} }
GST_DEBUG ("done"); GST_DEBUG ("done");
return gnlobject; return nleobject;
/* ERROR CASES */ /* ERROR CASES */
already_have_gnlobject: already_have_nleobject:
{ {
GST_ERROR ("Already controlling a GnlObject %s", GST_ERROR ("Already controlling a NleObject %s",
GST_ELEMENT_NAME (self->priv->gnlobject)); GST_ELEMENT_NAME (self->priv->nleobject));
return NULL; return NULL;
} }
no_gnlfactory: no_nlefactory:
{ {
GST_ERROR ("No GESTrackElement::gnlobject_factorytype implementation!"); GST_ERROR ("No GESTrackElement::nleobject_factorytype implementation!");
return NULL; return NULL;
} }
no_gnlobject: no_nleobject:
{ {
GST_ERROR ("Error creating a gnlobject of type '%s'", GST_ERROR ("Error creating a nleobject of type '%s'",
klass->gnlobject_factorytype); klass->nleobject_factorytype);
return NULL; return NULL;
} }
child_failure: child_failure:
{ {
GST_ERROR ("create_element returned NULL"); GST_ERROR ("create_element returned NULL");
gst_object_unref (gnlobject); gst_object_unref (nleobject);
return NULL; return NULL;
} }
add_failure: add_failure:
{ {
GST_ERROR ("Error adding the contents to the gnlobject"); GST_ERROR ("Error adding the contents to the nleobject");
gst_object_unref (child); gst_object_unref (child);
gst_object_unref (gnlobject); gst_object_unref (nleobject);
return NULL; return NULL;
} }
} }
static gboolean static gboolean
ensure_gnl_object (GESTrackElement * object) ensure_nle_object (GESTrackElement * object)
{ {
GESTrackElementClass *class; GESTrackElementClass *class;
GstElement *gnlobject; GstElement *nleobject;
gboolean res = TRUE; gboolean res = TRUE;
if (object->priv->gnlobject && object->priv->valid) if (object->priv->nleobject && object->priv->valid)
return FALSE; return FALSE;
/* 1. Create the GnlObject */ /* 1. Create the NleObject */
GST_DEBUG ("Creating GnlObject"); GST_DEBUG ("Creating NleObject");
class = GES_TRACK_ELEMENT_GET_CLASS (object); class = GES_TRACK_ELEMENT_GET_CLASS (object);
if (G_UNLIKELY (class->create_gnl_object == NULL)) { if (G_UNLIKELY (class->create_nle_object == NULL)) {
GST_ERROR ("No 'create_gnl_object' implementation !"); GST_ERROR ("No 'create_nle_object' implementation !");
goto done; goto done;
} }
GST_DEBUG ("Calling virtual method"); GST_DEBUG ("Calling virtual method");
/* 2. Fill in the GnlObject */ /* 2. Fill in the NleObject */
if (object->priv->gnlobject == NULL) { if (object->priv->nleobject == NULL) {
/* call the create_gnl_object virtual method */ /* call the create_nle_object virtual method */
gnlobject = class->create_gnl_object (object); nleobject = class->create_nle_object (object);
if (G_UNLIKELY (gnlobject == NULL)) { if (G_UNLIKELY (nleobject == NULL)) {
GST_ERROR GST_ERROR
("'create_gnl_object' implementation returned TRUE but no GnlObject is available"); ("'create_nle_object' implementation returned TRUE but no NleObject is available");
goto done; goto done;
} }
GST_DEBUG_OBJECT (object, "Got a valid GnlObject, now filling it in"); GST_DEBUG_OBJECT (object, "Got a valid NleObject, now filling it in");
object->priv->gnlobject = gst_object_ref (gnlobject); object->priv->nleobject = gst_object_ref (nleobject);
g_object_set_qdata (G_OBJECT (gnlobject), GNL_OBJECT_TRACK_ELEMENT_QUARK, g_object_set_qdata (G_OBJECT (nleobject), NLE_OBJECT_TRACK_ELEMENT_QUARK,
object); object);
/* Set some properties on the GnlObject */ /* Set some properties on the NleObject */
g_object_set (object->priv->gnlobject, g_object_set (object->priv->nleobject,
"duration", object->priv->pending_duration, "duration", object->priv->pending_duration,
"start", object->priv->pending_start, "start", object->priv->pending_start,
"inpoint", object->priv->pending_inpoint, "inpoint", object->priv->pending_inpoint,
@ -701,7 +701,7 @@ ensure_gnl_object (GESTrackElement * object)
if (object->priv->track != NULL) if (object->priv->track != NULL)
g_object_set (object->priv->gnlobject, g_object_set (object->priv->nleobject,
"caps", ges_track_get_caps (object->priv->track), NULL); "caps", ges_track_get_caps (object->priv->track), NULL);
} }
@ -881,12 +881,12 @@ ges_track_element_set_track (GESTrackElement * object, GESTrack * track)
object->priv->track = track; object->priv->track = track;
if (object->priv->track) { if (object->priv->track) {
/* If we already have a gnlobject, we just set its caps properly */ /* If we already have a nleobject, we just set its caps properly */
if (object->priv->gnlobject) { if (object->priv->nleobject) {
g_object_set (object->priv->gnlobject, g_object_set (object->priv->nleobject,
"caps", ges_track_get_caps (object->priv->track), NULL); "caps", ges_track_get_caps (object->priv->track), NULL);
} else { } else {
ret = ensure_gnl_object (object); ret = ensure_nle_object (object);
/* if we had pending control bindings, add them and free them */ /* if we had pending control bindings, add them and free them */
if (ret && object->priv->pending_bindings) { if (ret && object->priv->pending_bindings) {
@ -923,10 +923,10 @@ ges_track_element_get_bindings_hashtable (GESTrackElement * trackelement)
guint32 guint32
_ges_track_element_get_layer_priority (GESTrackElement * element) _ges_track_element_get_layer_priority (GESTrackElement * element)
{ {
if (_PRIORITY (element) < LAYER_HEIGHT + MIN_GNL_PRIO) if (_PRIORITY (element) < LAYER_HEIGHT + MIN_NLE_PRIO)
return 0; return 0;
return (_PRIORITY (element) - MIN_GNL_PRIO) / LAYER_HEIGHT; return (_PRIORITY (element) - MIN_NLE_PRIO) / LAYER_HEIGHT;
} }
/** /**
@ -947,7 +947,7 @@ ges_track_element_get_track (GESTrackElement * object)
} }
/** /**
* ges_track_element_get_gnlobject: * ges_track_element_get_nleobject:
* @object: a #GESTrackElement * @object: a #GESTrackElement
* *
* Get the GNonLin object this object is controlling. * Get the GNonLin object this object is controlling.
@ -955,11 +955,11 @@ ges_track_element_get_track (GESTrackElement * object)
* Returns: (transfer none): the GNonLin object this object is controlling. * Returns: (transfer none): the GNonLin object this object is controlling.
*/ */
GstElement * GstElement *
ges_track_element_get_gnlobject (GESTrackElement * object) ges_track_element_get_nleobject (GESTrackElement * object)
{ {
g_return_val_if_fail (GES_IS_TRACK_ELEMENT (object), NULL); g_return_val_if_fail (GES_IS_TRACK_ELEMENT (object), NULL);
return object->priv->gnlobject; return object->priv->nleobject;
} }
/** /**
@ -993,7 +993,7 @@ ges_track_element_is_active (GESTrackElement * object)
{ {
g_return_val_if_fail (GES_IS_TRACK_ELEMENT (object), FALSE); g_return_val_if_fail (GES_IS_TRACK_ELEMENT (object), FALSE);
if (G_UNLIKELY (object->priv->gnlobject == NULL)) if (G_UNLIKELY (object->priv->nleobject == NULL))
return object->priv->pending_active; return object->priv->pending_active;
else else
return object->active; return object->active;
@ -1449,7 +1449,7 @@ ges_track_element_copy_properties (GESTimelineElement * element,
GValue val = { 0 }; GValue val = { 0 };
GESTrackElement *copy = GES_TRACK_ELEMENT (elementcopy); GESTrackElement *copy = GES_TRACK_ELEMENT (elementcopy);
ensure_gnl_object (copy); ensure_nle_object (copy);
specs = specs =
ges_track_element_list_children_properties (GES_TRACK_ELEMENT (element), ges_track_element_list_children_properties (GES_TRACK_ELEMENT (element),
&n_specs); &n_specs);

View file

@ -71,17 +71,17 @@ struct _GESTrackElement {
/** /**
* GESTrackElementClass: * GESTrackElementClass:
* @gnlobject_factorytype: name of the GNonLin GStElementFactory type to use. * @nleobject_factorytype: name of the GNonLin GStElementFactory type to use.
* @create_gnl_object: method to create the GNonLin container object. * @create_nle_object: method to create the GNonLin container object.
* @create_element: method to return the GstElement to put in the gnlobject. * @create_element: method to return the GstElement to put in the nleobject.
* @active_changed: active property of gnlobject has changed * @active_changed: active property of nleobject has changed
* @list_children_properties: method to get children properties that user could * @list_children_properties: method to get children properties that user could
* like to configure. * like to configure.
* The default implementation will create an object * The default implementation will create an object
* of type @gnlobject_factorytype and call * of type @nleobject_factorytype and call
* @create_element. * @create_element.
* *
* Subclasses can override the @create_gnl_object method to override what type * Subclasses can override the @create_nle_object method to override what type
* of GNonLin object will be created. * of GNonLin object will be created.
*/ */
struct _GESTrackElementClass { struct _GESTrackElementClass {
@ -90,8 +90,8 @@ struct _GESTrackElementClass {
/*< public >*/ /*< public >*/
/* virtual methods for subclasses */ /* virtual methods for subclasses */
const gchar *gnlobject_factorytype; const gchar *nleobject_factorytype;
GstElement* (*create_gnl_object) (GESTrackElement * object); GstElement* (*create_nle_object) (GESTrackElement * object);
GstElement* (*create_element) (GESTrackElement * object); GstElement* (*create_element) (GESTrackElement * object);
void (*active_changed) (GESTrackElement *object, gboolean active); void (*active_changed) (GESTrackElement *object, gboolean active);
@ -117,7 +117,7 @@ GESTrackType ges_track_element_get_track_type (GESTrackElement * object);
void ges_track_element_set_track_type (GESTrackElement * object, void ges_track_element_set_track_type (GESTrackElement * object,
GESTrackType type); GESTrackType type);
GstElement * ges_track_element_get_gnlobject (GESTrackElement * object); GstElement * ges_track_element_get_nleobject (GESTrackElement * object);
GstElement * ges_track_element_get_element (GESTrackElement * object); GstElement * ges_track_element_get_element (GESTrackElement * object);

View file

@ -25,8 +25,6 @@
* Corresponds to one output format (i.e. audio OR video). * Corresponds to one output format (i.e. audio OR video).
* *
* Contains the compatible TrackElement(s). * Contains the compatible TrackElement(s).
*
* Wraps GNonLin's 'gnlcomposition' element.
*/ */
#include "ges-internal.h" #include "ges-internal.h"
@ -43,7 +41,7 @@ G_DEFINE_TYPE_WITH_CODE (GESTrack, ges_track, GST_TYPE_BIN,
* of the gaps filled in the track */ * of the gaps filled in the track */
typedef struct typedef struct
{ {
GstElement *gnlobj; GstElement *nleobj;
GstClockTime start; GstClockTime start;
GstClockTime duration; GstClockTime duration;
@ -111,17 +109,17 @@ add_trackelement_to_list_foreach (GESTrackElement * trackelement, GList ** list)
static Gap * static Gap *
gap_new (GESTrack * track, GstClockTime start, GstClockTime duration) gap_new (GESTrack * track, GstClockTime start, GstClockTime duration)
{ {
GstElement *gnlsrc, *elem; GstElement *nlesrc, *elem;
Gap *new_gap; Gap *new_gap;
gnlsrc = gst_element_factory_make ("gnlsource", NULL); nlesrc = gst_element_factory_make ("nlesource", NULL);
elem = track->priv->create_element_for_gaps (track); elem = track->priv->create_element_for_gaps (track);
if (G_UNLIKELY (gst_bin_add (GST_BIN (gnlsrc), elem) == FALSE)) { if (G_UNLIKELY (gst_bin_add (GST_BIN (nlesrc), elem) == FALSE)) {
GST_WARNING_OBJECT (track, "Could not create gap filler"); GST_WARNING_OBJECT (track, "Could not create gap filler");
if (gnlsrc) if (nlesrc)
gst_object_unref (gnlsrc); gst_object_unref (nlesrc);
if (elem) if (elem)
gst_object_unref (elem); gst_object_unref (elem);
@ -129,12 +127,12 @@ gap_new (GESTrack * track, GstClockTime start, GstClockTime duration)
return NULL; return NULL;
} }
if (G_UNLIKELY (gst_bin_add (GST_BIN (track->priv->composition), if (G_UNLIKELY (nle_composition_add_object (track->priv->composition,
gnlsrc) == FALSE)) { nlesrc) == FALSE)) {
GST_WARNING_OBJECT (track, "Could not add gap to the composition"); GST_WARNING_OBJECT (track, "Could not add gap to the composition");
if (gnlsrc) if (nlesrc)
gst_object_unref (gnlsrc); gst_object_unref (nlesrc);
if (elem) if (elem)
gst_object_unref (elem); gst_object_unref (elem);
@ -146,10 +144,10 @@ gap_new (GESTrack * track, GstClockTime start, GstClockTime duration)
new_gap->start = start; new_gap->start = start;
new_gap->duration = duration; new_gap->duration = duration;
new_gap->track = track; new_gap->track = track;
new_gap->gnlobj = gst_object_ref (gnlsrc); new_gap->nleobj = nlesrc;
g_object_set (gnlsrc, "start", new_gap->start, "duration", new_gap->duration, g_object_set (nlesrc, "start", new_gap->start, "duration", new_gap->duration,
"priority", 1, NULL); "priority", 1, NULL);
GST_DEBUG_OBJECT (track, GST_DEBUG_OBJECT (track,
@ -168,9 +166,7 @@ free_gap (Gap * gap)
GST_DEBUG_OBJECT (track, "Removed gap with start %" GST_TIME_FORMAT GST_DEBUG_OBJECT (track, "Removed gap with start %" GST_TIME_FORMAT
" duration %" GST_TIME_FORMAT, GST_TIME_ARGS (gap->start), " duration %" GST_TIME_FORMAT, GST_TIME_ARGS (gap->start),
GST_TIME_ARGS (gap->duration)); GST_TIME_ARGS (gap->duration));
gst_bin_remove (GST_BIN (track->priv->composition), gap->gnlobj); nle_composition_remove_object (track->priv->composition, gap->nleobj);
gst_element_set_state (gap->gnlobj, GST_STATE_NULL);
gst_object_unref (gap->gnlobj);
g_slice_free (Gap, gap); g_slice_free (Gap, gap);
} }
@ -258,7 +254,7 @@ sort_track_elements_cb (GESTrackElement * child,
} }
static void static void
pad_added_cb (GstElement * element, GstPad * pad, GESTrack * track) _ghost_nlecomposition_srcpad (GESTrack * track)
{ {
GESTrackPrivate *priv = track->priv; GESTrackPrivate *priv = track->priv;
GstPad *capsfilter_sink; GstPad *capsfilter_sink;
@ -328,7 +324,7 @@ static gboolean
remove_object_internal (GESTrack * track, GESTrackElement * object) remove_object_internal (GESTrack * track, GESTrackElement * object)
{ {
GESTrackPrivate *priv; GESTrackPrivate *priv;
GstElement *gnlobject; GstElement *nleobject;
GST_DEBUG_OBJECT (track, "object:%p", object); GST_DEBUG_OBJECT (track, "object:%p", object);
@ -339,16 +335,16 @@ remove_object_internal (GESTrack * track, GESTrackElement * object)
return FALSE; return FALSE;
} }
if ((gnlobject = ges_track_element_get_gnlobject (object))) { if ((nleobject = ges_track_element_get_nleobject (object))) {
GST_DEBUG ("Removing GnlObject '%s' from composition '%s'", GST_DEBUG ("Removing NleObject '%s' from composition '%s'",
GST_ELEMENT_NAME (gnlobject), GST_ELEMENT_NAME (priv->composition)); GST_ELEMENT_NAME (nleobject), GST_ELEMENT_NAME (priv->composition));
if (!gst_bin_remove (GST_BIN (priv->composition), gnlobject)) { if (!nle_composition_remove_object (priv->composition, nleobject)) {
GST_WARNING ("Failed to remove gnlobject from composition"); GST_WARNING ("Failed to remove nleobject from composition");
return FALSE; return FALSE;
} }
gst_element_set_state (gnlobject, GST_STATE_NULL); gst_element_set_state (nleobject, GST_STATE_NULL);
} }
g_signal_handlers_disconnect_by_func (object, sort_track_elements_cb, NULL); g_signal_handlers_disconnect_by_func (object, sort_track_elements_cb, NULL);
@ -473,8 +469,9 @@ ges_track_constructed (GObject * object)
if (!gst_bin_add (GST_BIN (self), self->priv->capsfilter)) if (!gst_bin_add (GST_BIN (self), self->priv->capsfilter))
GST_ERROR ("Couldn't add capsfilter to bin !"); GST_ERROR ("Couldn't add capsfilter to bin !");
_ghost_nlecomposition_srcpad (self);
if (GES_TRACK_GET_CLASS (self)->get_mixing_element) { if (GES_TRACK_GET_CLASS (self)->get_mixing_element) {
GstElement *gnlobject; GstElement *nleobject;
GstElement *mixer = GES_TRACK_GET_CLASS (self)->get_mixing_element (self); GstElement *mixer = GES_TRACK_GET_CLASS (self)->get_mixing_element (self);
if (mixer == NULL) { if (mixer == NULL) {
@ -483,24 +480,24 @@ ges_track_constructed (GObject * object)
return; return;
} }
gnlobject = gst_element_factory_make ("gnloperation", "mixing-operation"); nleobject = gst_element_factory_make ("nleoperation", "mixing-operation");
if (!gst_bin_add (GST_BIN (gnlobject), mixer)) { if (!gst_bin_add (GST_BIN (nleobject), mixer)) {
GST_WARNING_OBJECT (self, "Could not add the mixer to our composition"); GST_WARNING_OBJECT (self, "Could not add the mixer to our composition");
gst_object_unref (gnlobject); gst_object_unref (nleobject);
return; return;
} }
g_object_set (gnlobject, "expandable", TRUE, NULL); g_object_set (nleobject, "expandable", TRUE, NULL);
if (self->priv->mixing) { if (self->priv->mixing) {
if (!gst_bin_add (GST_BIN (self->priv->composition), gnlobject)) { if (!nle_composition_add_object (self->priv->composition, nleobject)) {
GST_WARNING_OBJECT (self, "Could not add the mixer to our composition"); GST_WARNING_OBJECT (self, "Could not add the mixer to our composition");
return; return;
} }
} }
self->priv->mixing_operation = gst_object_ref (gnlobject); self->priv->mixing_operation = gst_object_ref (nleobject);
} else { } else {
GST_INFO_OBJECT (self, "No way to create a main mixer"); GST_INFO_OBJECT (self, "No way to create a main mixer");
@ -622,7 +619,7 @@ ges_track_init (GESTrack * self)
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
GES_TYPE_TRACK, GESTrackPrivate); GES_TYPE_TRACK, GESTrackPrivate);
self->priv->composition = gst_element_factory_make ("gnlcomposition", NULL); self->priv->composition = gst_element_factory_make ("nlecomposition", NULL);
self->priv->capsfilter = gst_element_factory_make ("capsfilter", NULL); self->priv->capsfilter = gst_element_factory_make ("capsfilter", NULL);
self->priv->updating = TRUE; self->priv->updating = TRUE;
self->priv->trackelements_by_start = g_sequence_new (NULL); self->priv->trackelements_by_start = g_sequence_new (NULL);
@ -788,13 +785,13 @@ ges_track_set_mixing (GESTrack * track, gboolean mixing)
if (mixing) { if (mixing) {
/* increase ref count to hold the object */ /* increase ref count to hold the object */
gst_object_ref (track->priv->mixing_operation); gst_object_ref (track->priv->mixing_operation);
if (!gst_bin_add (GST_BIN (track->priv->composition), if (!nle_composition_add_object (track->priv->composition,
track->priv->mixing_operation)) { track->priv->mixing_operation)) {
GST_WARNING_OBJECT (track, "Could not add the mixer to our composition"); GST_WARNING_OBJECT (track, "Could not add the mixer to our composition");
return; return;
} }
} else { } else {
if (!gst_bin_remove (GST_BIN (track->priv->composition), if (!nle_composition_remove_object (track->priv->composition,
track->priv->mixing_operation)) { track->priv->mixing_operation)) {
GST_WARNING_OBJECT (track, GST_WARNING_OBJECT (track,
"Could not remove the mixer from our composition"); "Could not remove the mixer from our composition");
@ -839,12 +836,12 @@ ges_track_add_element (GESTrack * track, GESTrackElement * object)
} }
GST_DEBUG ("Adding object %s to ourself %s", GST_DEBUG ("Adding object %s to ourself %s",
GST_OBJECT_NAME (ges_track_element_get_gnlobject (object)), GST_OBJECT_NAME (ges_track_element_get_nleobject (object)),
GST_OBJECT_NAME (track->priv->composition)); GST_OBJECT_NAME (track->priv->composition));
if (G_UNLIKELY (!gst_bin_add (GST_BIN (track->priv->composition), if (G_UNLIKELY (!nle_composition_add_object (track->priv->composition,
ges_track_element_get_gnlobject (object)))) { ges_track_element_get_nleobject (object)))) {
GST_WARNING ("Couldn't add object to the GnlComposition"); GST_WARNING ("Couldn't add object to the NleComposition");
return FALSE; return FALSE;
} }
@ -972,7 +969,7 @@ ges_track_get_timeline (GESTrack * track)
* ges_track_get_mixing: * ges_track_get_mixing:
* @track: a #GESTrack * @track: a #GESTrack
* *
* Gets if the underlying #GnlComposition contains an expandable mixer. * Gets if the underlying #NleComposition contains an expandable mixer.
* *
* Returns: #True if there is a mixer, #False otherwise. * Returns: #True if there is a mixer, #False otherwise.
*/ */
@ -992,7 +989,7 @@ ges_track_get_mixing (GESTrack * track)
* track. * track.
* *
* When timing changes happen in a timeline, the changes are not * When timing changes happen in a timeline, the changes are not
* directly done inside GNL. This method needs to be called so any changes * directly done inside NLE. This method needs to be called so any changes
* on a clip contained in the timeline actually happen at the media * on a clip contained in the timeline actually happen at the media
* processing level. * processing level.
* *

View file

@ -161,3 +161,15 @@ ges_get_compositor_factory (void)
return compositor_factory; return compositor_factory;
} }
gboolean
nle_composition_add_object (GstElement * comp, GstElement * object)
{
return gst_bin_add (GST_BIN (comp), object);
}
gboolean
nle_composition_remove_object (GstElement * comp, GstElement * object)
{
return gst_bin_remove (GST_BIN (comp), object);
}

View file

@ -190,7 +190,7 @@ ges_video_source_class_init (GESVideoSourceClass * klass)
g_type_class_add_private (klass, sizeof (GESVideoSourcePrivate)); g_type_class_add_private (klass, sizeof (GESVideoSourcePrivate));
element_class->set_parent = _set_parent; element_class->set_parent = _set_parent;
track_class->gnlobject_factorytype = "gnlsource"; track_class->nleobject_factorytype = "nlesource";
track_class->create_element = ges_video_source_create_element; track_class->create_element = ges_video_source_create_element;
video_source_class->create_source = NULL; video_source_class->create_source = NULL;
} }

View file

@ -21,6 +21,7 @@
#include <ges/ges.h> #include <ges/ges.h>
#include "ges/gstframepositionner.h" #include "ges/gstframepositionner.h"
#include "ges-internal.h" #include "ges-internal.h"
#include "ges/nle/nle.h"
#define GES_GNONLIN_VERSION_NEEDED_MAJOR 1 #define GES_GNONLIN_VERSION_NEEDED_MAJOR 1
#define GES_GNONLIN_VERSION_NEEDED_MINOR 2 #define GES_GNONLIN_VERSION_NEEDED_MINOR 2
@ -30,25 +31,19 @@ GST_DEBUG_CATEGORY (_ges_debug);
static gboolean ges_initialized = FALSE; static gboolean ges_initialized = FALSE;
/** struct _elements_entry
* SECTION:ges-common
* @short_description: Initialization.
*/
static gboolean
ges_check_gnonlin_availability (void)
{ {
gboolean ret = TRUE; const gchar *name;
if (!gst_registry_check_feature_version (gst_registry_get (), GType (*type) (void);
"gnlcomposition", GES_GNONLIN_VERSION_NEEDED_MAJOR, };
GES_GNONLIN_VERSION_NEEDED_MINOR, GES_GNONLIN_VERSION_NEEDED_MICRO)) {
GST_ERROR ("GNonLin plugins not found, or not at least version %u.%u.%u", static struct _elements_entry _elements[] = {
GES_GNONLIN_VERSION_NEEDED_MAJOR, GES_GNONLIN_VERSION_NEEDED_MINOR, {"nlesource", nle_source_get_type},
GES_GNONLIN_VERSION_NEEDED_MICRO); {"nlecomposition", nle_composition_get_type},
ret = FALSE; {"nleoperation", nle_operation_get_type},
} {"nleurisource", nle_urisource_get_type},
return ret; {NULL, 0}
} };
/** /**
* ges_init: * ges_init:
@ -61,6 +56,8 @@ ges_check_gnonlin_availability (void)
gboolean gboolean
ges_init (void) ges_init (void)
{ {
gint i = 0;
/* initialize debugging category */ /* initialize debugging category */
GST_DEBUG_CATEGORY_INIT (_ges_debug, "ges", GST_DEBUG_FG_YELLOW, GST_DEBUG_CATEGORY_INIT (_ges_debug, "ges", GST_DEBUG_FG_YELLOW,
"GStreamer Editing Services"); "GStreamer Editing Services");
@ -92,14 +89,17 @@ ges_init (void)
ges_asset_cache_init (); ges_asset_cache_init ();
/* check the gnonlin elements are available */
if (!ges_check_gnonlin_availability ())
return FALSE;
gst_element_register (NULL, "framepositionner", 0, gst_element_register (NULL, "framepositionner", 0,
GST_TYPE_FRAME_POSITIONNER); GST_TYPE_FRAME_POSITIONNER);
gst_element_register (NULL, "gespipeline", 0, GES_TYPE_PIPELINE); 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? */ /* TODO: user-defined types? */
ges_initialized = TRUE; ges_initialized = TRUE;

8
ges/nle/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
Makefile
Makefile.in
*.o
*.lo
*.la
.deps
.libs
nleversion.h

View file

@ -18,19 +18,19 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef __GNL_H__ #ifndef __NLE_H__
#define __GNL_H__ #define __NLE_H__
#include <gst/gst.h> #include <gst/gst.h>
#include "gnltypes.h" #include "nletypes.h"
#include "gnlobject.h" #include "nleobject.h"
#include "gnlghostpad.h" #include "nleghostpad.h"
#include "gnlsource.h" #include "nlesource.h"
#include "gnlcomposition.h" #include "nlecomposition.h"
#include "gnloperation.h" #include "nleoperation.h"
#include "gnlurisource.h" #include "nleurisource.h"
#endif /* __GST_H__ */ #endif /* __GST_H__ */

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
* Copyright (C) 2001 Wim Taymans <wim.taymans@gmail.com> * Copyright (C) 2001 Wim Taymans <wim.taymans@gmail.com>
* 2004-2008 Edward Hervey <bilboed@bilboed.com> * 2004-2008 Edward Hervey <bilboed@bilboed.com>
* *
* gnlcomposition.h: Header for base GnlComposition * nlecomposition.h: Header for base NleComposition
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -21,46 +21,46 @@
*/ */
#ifndef __GNL_COMPOSITION_H__ #ifndef __NLE_COMPOSITION_H__
#define __GNL_COMPOSITION_H__ #define __NLE_COMPOSITION_H__
#include <gst/gst.h> #include <gst/gst.h>
#include "gnlobject.h" #include "nleobject.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define GNL_TYPE_COMPOSITION \ #define NLE_TYPE_COMPOSITION \
(gnl_composition_get_type()) (nle_composition_get_type())
#define GNL_COMPOSITION(obj) \ #define NLE_COMPOSITION(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GNL_TYPE_COMPOSITION,GnlComposition)) (G_TYPE_CHECK_INSTANCE_CAST((obj),NLE_TYPE_COMPOSITION,NleComposition))
#define GNL_COMPOSITION_CLASS(klass) \ #define NLE_COMPOSITION_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GNL_TYPE_COMPOSITION,GnlCompositionClass)) (G_TYPE_CHECK_CLASS_CAST((klass),NLE_TYPE_COMPOSITION,NleCompositionClass))
#define GNL_COMPOSITION_GET_CLASS(obj) \ #define NLE_COMPOSITION_GET_CLASS(obj) \
(GNL_COMPOSITION_CLASS (G_OBJECT_GET_CLASS (obj))) (NLE_COMPOSITION_CLASS (G_OBJECT_GET_CLASS (obj)))
#define GNL_IS_COMPOSITION(obj) \ #define NLE_IS_COMPOSITION(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GNL_TYPE_COMPOSITION)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),NLE_TYPE_COMPOSITION))
#define GNL_IS_COMPOSITION_CLASS(obj) \ #define NLE_IS_COMPOSITION_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GNL_TYPE_COMPOSITION)) (G_TYPE_CHECK_CLASS_TYPE((klass),NLE_TYPE_COMPOSITION))
typedef struct _GnlCompositionPrivate GnlCompositionPrivate; typedef struct _NleCompositionPrivate NleCompositionPrivate;
struct _GnlComposition struct _NleComposition
{ {
GnlObject parent; NleObject parent;
GstTask * task; GstTask * task;
GRecMutex task_rec_lock; GRecMutex task_rec_lock;
/*< private >*/ /*< private >*/
GnlCompositionPrivate * priv; NleCompositionPrivate * priv;
}; };
struct _GnlCompositionClass struct _NleCompositionClass
{ {
GnlObjectClass parent_class; NleObjectClass parent_class;
}; };
GType gnl_composition_get_type (void); GType nle_composition_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GNL_COMPOSITION_H__ */ #endif /* __NLE_COMPOSITION_H__ */

View file

@ -21,17 +21,17 @@
#include "config.h" #include "config.h"
#endif #endif
#include "gnl.h" #include "nle.h"
GST_DEBUG_CATEGORY_STATIC (gnlghostpad); GST_DEBUG_CATEGORY_STATIC (nleghostpad);
#define GST_CAT_DEFAULT gnlghostpad #define GST_CAT_DEFAULT nleghostpad
typedef struct _GnlPadPrivate GnlPadPrivate; typedef struct _NlePadPrivate NlePadPrivate;
struct _GnlPadPrivate struct _NlePadPrivate
{ {
GnlObject *object; NleObject *object;
GnlPadPrivate *ghostpriv; NlePadPrivate *ghostpriv;
GstPadDirection dir; GstPadDirection dir;
GstPadEventFunction eventfunc; GstPadEventFunction eventfunc;
GstPadQueryFunction queryfunc; GstPadQueryFunction queryfunc;
@ -40,7 +40,7 @@ struct _GnlPadPrivate
}; };
GstEvent * GstEvent *
gnl_object_translate_incoming_seek (GnlObject * object, GstEvent * event) nle_object_translate_incoming_seek (NleObject * object, GstEvent * event)
{ {
GstEvent *event2; GstEvent *event2;
GstFormat format; GstFormat format;
@ -68,7 +68,7 @@ gnl_object_translate_incoming_seek (GnlObject * object, GstEvent * event)
/* convert cur */ /* convert cur */
ncurtype = GST_SEEK_TYPE_SET; ncurtype = GST_SEEK_TYPE_SET;
if (G_LIKELY ((curtype == GST_SEEK_TYPE_SET) if (G_LIKELY ((curtype == GST_SEEK_TYPE_SET)
&& (gnl_object_to_media_time (object, cur, &ncur)))) { && (nle_object_to_media_time (object, cur, &ncur)))) {
/* cur is TYPE_SET and value is valid */ /* cur is TYPE_SET and value is valid */
if (ncur > G_MAXINT64) if (ncur > G_MAXINT64)
GST_WARNING_OBJECT (object, "return value too big..."); GST_WARNING_OBJECT (object, "return value too big...");
@ -85,14 +85,14 @@ gnl_object_translate_incoming_seek (GnlObject * object, GstEvent * event)
/* convert stop, we also need to limit it to object->stop */ /* convert stop, we also need to limit it to object->stop */
if (G_LIKELY ((stoptype == GST_SEEK_TYPE_SET) if (G_LIKELY ((stoptype == GST_SEEK_TYPE_SET)
&& (gnl_object_to_media_time (object, stop, &nstop)))) { && (nle_object_to_media_time (object, stop, &nstop)))) {
if (nstop > G_MAXINT64) if (nstop > G_MAXINT64)
GST_WARNING_OBJECT (object, "return value too big..."); GST_WARNING_OBJECT (object, "return value too big...");
GST_LOG_OBJECT (object, "Setting stop to %" GST_TIME_FORMAT, GST_LOG_OBJECT (object, "Setting stop to %" GST_TIME_FORMAT,
GST_TIME_ARGS (nstop)); GST_TIME_ARGS (nstop));
} else { } else {
GST_DEBUG_OBJECT (object, "Limiting end of seek to media_stop"); GST_DEBUG_OBJECT (object, "Limiting end of seek to media_stop");
gnl_object_to_media_time (object, object->stop, &nstop); nle_object_to_media_time (object, object->stop, &nstop);
if (nstop > G_MAXINT64) if (nstop > G_MAXINT64)
GST_WARNING_OBJECT (object, "return value too big..."); GST_WARNING_OBJECT (object, "return value too big...");
GST_LOG_OBJECT (object, "Setting stop to %" GST_TIME_FORMAT, GST_LOG_OBJECT (object, "Setting stop to %" GST_TIME_FORMAT,
@ -131,7 +131,7 @@ invalid_format:
} }
static GstEvent * static GstEvent *
translate_outgoing_seek (GnlObject * object, GstEvent * event) translate_outgoing_seek (NleObject * object, GstEvent * event)
{ {
GstEvent *event2; GstEvent *event2;
GstFormat format; GstFormat format;
@ -159,7 +159,7 @@ translate_outgoing_seek (GnlObject * object, GstEvent * event)
/* convert cur */ /* convert cur */
ncurtype = GST_SEEK_TYPE_SET; ncurtype = GST_SEEK_TYPE_SET;
if (G_LIKELY ((curtype == GST_SEEK_TYPE_SET) if (G_LIKELY ((curtype == GST_SEEK_TYPE_SET)
&& (gnl_media_to_object_time (object, cur, &ncur)))) { && (nle_media_to_object_time (object, cur, &ncur)))) {
/* cur is TYPE_SET and value is valid */ /* cur is TYPE_SET and value is valid */
if (ncur > G_MAXINT64) if (ncur > G_MAXINT64)
GST_WARNING_OBJECT (object, "return value too big..."); GST_WARNING_OBJECT (object, "return value too big...");
@ -176,7 +176,7 @@ translate_outgoing_seek (GnlObject * object, GstEvent * event)
/* convert stop, we also need to limit it to object->stop */ /* convert stop, we also need to limit it to object->stop */
if (G_LIKELY ((stoptype == GST_SEEK_TYPE_SET) if (G_LIKELY ((stoptype == GST_SEEK_TYPE_SET)
&& (gnl_media_to_object_time (object, stop, &nstop)))) { && (nle_media_to_object_time (object, stop, &nstop)))) {
if (nstop > G_MAXINT64) if (nstop > G_MAXINT64)
GST_WARNING_OBJECT (object, "return value too big..."); GST_WARNING_OBJECT (object, "return value too big...");
GST_LOG_OBJECT (object, "Setting stop to %" GST_TIME_FORMAT, GST_LOG_OBJECT (object, "Setting stop to %" GST_TIME_FORMAT,
@ -212,7 +212,7 @@ invalid_format:
} }
static GstEvent * static GstEvent *
translate_outgoing_segment (GnlObject * object, GstEvent * event) translate_outgoing_segment (NleObject * object, GstEvent * event)
{ {
const GstSegment *orig; const GstSegment *orig;
GstSegment segment; GstSegment segment;
@ -235,7 +235,7 @@ translate_outgoing_segment (GnlObject * object, GstEvent * event)
gst_segment_copy_into (orig, &segment); gst_segment_copy_into (orig, &segment);
gnl_media_to_object_time (object, orig->time, &segment.time); nle_media_to_object_time (object, orig->time, &segment.time);
if (G_UNLIKELY (segment.time > G_MAXINT64)) if (G_UNLIKELY (segment.time > G_MAXINT64))
GST_WARNING_OBJECT (object, "Return value too big..."); GST_WARNING_OBJECT (object, "Return value too big...");
@ -253,7 +253,7 @@ translate_outgoing_segment (GnlObject * object, GstEvent * event)
} }
static GstEvent * static GstEvent *
translate_incoming_segment (GnlObject * object, GstEvent * event) translate_incoming_segment (NleObject * object, GstEvent * event)
{ {
GstEvent *event2; GstEvent *event2;
const GstSegment *orig; const GstSegment *orig;
@ -276,15 +276,15 @@ translate_incoming_segment (GnlObject * object, GstEvent * event)
gst_segment_copy_into (orig, &segment); gst_segment_copy_into (orig, &segment);
if (!gnl_object_to_media_time (object, orig->time, &segment.time)) { if (!nle_object_to_media_time (object, orig->time, &segment.time)) {
GST_DEBUG ("Can't convert media_time, using 0"); GST_DEBUG ("Can't convert media_time, using 0");
segment.time = 0; segment.time = 0;
}; };
if (GNL_IS_OPERATION (object)) { if (NLE_IS_OPERATION (object)) {
segment.base = GNL_OPERATION (object)->next_base_time; segment.base = NLE_OPERATION (object)->next_base_time;
GST_INFO_OBJECT (object, "Using operation base time %" GST_TIME_FORMAT, GST_INFO_OBJECT (object, "Using operation base time %" GST_TIME_FORMAT,
GST_TIME_ARGS (GNL_OPERATION (object)->next_base_time)); GST_TIME_ARGS (NLE_OPERATION (object)->next_base_time));
} }
if (G_UNLIKELY (segment.time > G_MAXINT64)) if (G_UNLIKELY (segment.time > G_MAXINT64))
@ -306,8 +306,8 @@ static gboolean
internalpad_event_function (GstPad * internal, GstObject * parent, internalpad_event_function (GstPad * internal, GstObject * parent,
GstEvent * event) GstEvent * event)
{ {
GnlPadPrivate *priv = gst_pad_get_element_private (internal); NlePadPrivate *priv = gst_pad_get_element_private (internal);
GnlObject *object = priv->object; NleObject *object = priv->object;
gboolean res; gboolean res;
GST_DEBUG_OBJECT (internal, "event:%s (seqnum::%d)", GST_DEBUG_OBJECT (internal, "event:%s (seqnum::%d)",
@ -362,7 +362,7 @@ internalpad_event_function (GstPad * internal, GstObject * parent,
*/ */
static gboolean static gboolean
translate_incoming_position_query (GnlObject * object, GstQuery * query) translate_incoming_position_query (NleObject * object, GstQuery * query)
{ {
GstFormat format; GstFormat format;
gint64 cur, cur2; gint64 cur, cur2;
@ -374,7 +374,7 @@ translate_incoming_position_query (GnlObject * object, GstQuery * query)
goto beach; goto beach;
} }
gnl_media_to_object_time (object, (guint64) cur, (guint64 *) & cur2); nle_media_to_object_time (object, (guint64) cur, (guint64 *) & cur2);
GST_DEBUG_OBJECT (object, GST_DEBUG_OBJECT (object,
"Adjust position from %" GST_TIME_FORMAT " to %" GST_TIME_FORMAT, "Adjust position from %" GST_TIME_FORMAT " to %" GST_TIME_FORMAT,
@ -386,7 +386,7 @@ beach:
} }
static gboolean static gboolean
translate_outgoing_position_query (GnlObject * object, GstQuery * query) translate_outgoing_position_query (NleObject * object, GstQuery * query)
{ {
GstFormat format; GstFormat format;
gint64 cur, cur2; gint64 cur, cur2;
@ -398,7 +398,7 @@ translate_outgoing_position_query (GnlObject * object, GstQuery * query)
goto beach; goto beach;
} }
if (G_UNLIKELY (!(gnl_object_to_media_time (object, (guint64) cur, if (G_UNLIKELY (!(nle_object_to_media_time (object, (guint64) cur,
(guint64 *) & cur2)))) { (guint64 *) & cur2)))) {
GST_WARNING_OBJECT (object, GST_WARNING_OBJECT (object,
"Couldn't get media time for %" GST_TIME_FORMAT, GST_TIME_ARGS (cur)); "Couldn't get media time for %" GST_TIME_FORMAT, GST_TIME_ARGS (cur));
@ -415,7 +415,7 @@ beach:
} }
static gboolean static gboolean
translate_incoming_duration_query (GnlObject * object, GstQuery * query) translate_incoming_duration_query (NleObject * object, GstQuery * query)
{ {
GstFormat format; GstFormat format;
gint64 cur; gint64 cur;
@ -436,8 +436,8 @@ static gboolean
internalpad_query_function (GstPad * internal, GstObject * parent, internalpad_query_function (GstPad * internal, GstObject * parent,
GstQuery * query) GstQuery * query)
{ {
GnlPadPrivate *priv = gst_pad_get_element_private (internal); NlePadPrivate *priv = gst_pad_get_element_private (internal);
GnlObject *object = priv->object; NleObject *object = priv->object;
gboolean ret; gboolean ret;
GST_DEBUG_OBJECT (internal, "querytype:%s", GST_DEBUG_OBJECT (internal, "querytype:%s",
@ -474,8 +474,8 @@ static gboolean
ghostpad_event_function (GstPad * ghostpad, GstObject * parent, ghostpad_event_function (GstPad * ghostpad, GstObject * parent,
GstEvent * event) GstEvent * event)
{ {
GnlPadPrivate *priv; NlePadPrivate *priv;
GnlObject *object; NleObject *object;
gboolean ret = FALSE; gboolean ret = FALSE;
priv = gst_pad_get_element_private (ghostpad); priv = gst_pad_get_element_private (ghostpad);
@ -494,7 +494,7 @@ ghostpad_event_function (GstPad * ghostpad, GstObject * parent,
{ {
GstPad *target; GstPad *target;
event = gnl_object_translate_incoming_seek (object, event); event = nle_object_translate_incoming_seek (object, event);
if (!(target = gst_ghost_pad_get_target (GST_GHOST_PAD (ghostpad)))) { if (!(target = gst_ghost_pad_get_target (GST_GHOST_PAD (ghostpad)))) {
g_assert ("Seeked a pad with not target SHOULD NOT HAPPEND"); g_assert ("Seeked a pad with not target SHOULD NOT HAPPEND");
ret = FALSE; ret = FALSE;
@ -545,8 +545,8 @@ static gboolean
ghostpad_query_function (GstPad * ghostpad, GstObject * parent, ghostpad_query_function (GstPad * ghostpad, GstObject * parent,
GstQuery * query) GstQuery * query)
{ {
GnlPadPrivate *priv = gst_pad_get_element_private (ghostpad); NlePadPrivate *priv = gst_pad_get_element_private (ghostpad);
GnlObject *object = GNL_OBJECT (parent); NleObject *object = NLE_OBJECT (parent);
gboolean pret = TRUE; gboolean pret = TRUE;
GST_DEBUG_OBJECT (ghostpad, "querytype:%s", GST_QUERY_TYPE_NAME (query)); GST_DEBUG_OBJECT (ghostpad, "querytype:%s", GST_QUERY_TYPE_NAME (query));
@ -578,9 +578,9 @@ ghostpad_query_function (GstPad * ghostpad, GstObject * parent,
/* internal pad going away */ /* internal pad going away */
static void static void
internal_pad_finalizing (GnlPadPrivate * priv, GObject * pad G_GNUC_UNUSED) internal_pad_finalizing (NlePadPrivate * priv, GObject * pad G_GNUC_UNUSED)
{ {
g_slice_free (GnlPadPrivate, priv); g_slice_free (NlePadPrivate, priv);
} }
static inline GstPad * static inline GstPad *
@ -602,10 +602,10 @@ get_proxy_pad (GstPad * ghostpad)
} }
static void static void
control_internal_pad (GstPad * ghostpad, GnlObject * object) control_internal_pad (GstPad * ghostpad, NleObject * object)
{ {
GnlPadPrivate *priv; NlePadPrivate *priv;
GnlPadPrivate *privghost; NlePadPrivate *privghost;
GstPad *internal; GstPad *internal;
if (!ghostpad) { if (!ghostpad) {
@ -620,8 +620,8 @@ control_internal_pad (GstPad * ghostpad, GnlObject * object)
if (G_UNLIKELY (!(priv = gst_pad_get_element_private (internal)))) { if (G_UNLIKELY (!(priv = gst_pad_get_element_private (internal)))) {
GST_DEBUG_OBJECT (internal, GST_DEBUG_OBJECT (internal,
"Creating a GnlPadPrivate to put in element_private"); "Creating a NlePadPrivate to put in element_private");
priv = g_slice_new0 (GnlPadPrivate); priv = g_slice_new0 (NlePadPrivate);
/* Remember existing pad functions */ /* Remember existing pad functions */
priv->eventfunc = GST_PAD_EVENTFUNC (internal); priv->eventfunc = GST_PAD_EVENTFUNC (internal);
@ -649,14 +649,14 @@ control_internal_pad (GstPad * ghostpad, GnlObject * object)
/** /**
* gnl_object_ghost_pad: * nle_object_ghost_pad:
* @object: #GnlObject to add the ghostpad to * @object: #NleObject to add the ghostpad to
* @name: Name for the new pad * @name: Name for the new pad
* @target: Target #GstPad to ghost * @target: Target #GstPad to ghost
* *
* Adds a #GstGhostPad overridding the correct pad [query|event]_function so * Adds a #GstGhostPad overridding the correct pad [query|event]_function so
* that time shifting is done correctly * that time shifting is done correctly
* The #GstGhostPad is added to the #GnlObject * The #GstGhostPad is added to the #NleObject
* *
* /!\ This function doesn't check if the existing [src|sink] pad was removed * /!\ This function doesn't check if the existing [src|sink] pad was removed
* first, so you might end up with more pads than wanted * first, so you might end up with more pads than wanted
@ -664,7 +664,7 @@ control_internal_pad (GstPad * ghostpad, GnlObject * object)
* Returns: The #GstPad if everything went correctly, else NULL. * Returns: The #GstPad if everything went correctly, else NULL.
*/ */
GstPad * GstPad *
gnl_object_ghost_pad (GnlObject * object, const gchar * name, GstPad * target) nle_object_ghost_pad (NleObject * object, const gchar * name, GstPad * target)
{ {
GstPadDirection dir = GST_PAD_DIRECTION (target); GstPadDirection dir = GST_PAD_DIRECTION (target);
GstPad *ghost; GstPad *ghost;
@ -674,13 +674,13 @@ gnl_object_ghost_pad (GnlObject * object, const gchar * name, GstPad * target)
g_return_val_if_fail (target, FALSE); g_return_val_if_fail (target, FALSE);
g_return_val_if_fail ((dir != GST_PAD_UNKNOWN), FALSE); g_return_val_if_fail ((dir != GST_PAD_UNKNOWN), FALSE);
ghost = gnl_object_ghost_pad_no_target (object, name, dir, NULL); ghost = nle_object_ghost_pad_no_target (object, name, dir, NULL);
if (!ghost) { if (!ghost) {
GST_WARNING_OBJECT (object, "Couldn't create ghostpad"); GST_WARNING_OBJECT (object, "Couldn't create ghostpad");
return NULL; return NULL;
} }
if (!(gnl_object_ghost_pad_set_target (object, ghost, target))) { if (!(nle_object_ghost_pad_set_target (object, ghost, target))) {
GST_WARNING_OBJECT (object, GST_WARNING_OBJECT (object,
"Couldn't set the target pad... removing ghostpad"); "Couldn't set the target pad... removing ghostpad");
gst_object_unref (ghost); gst_object_unref (ghost);
@ -700,15 +700,15 @@ gnl_object_ghost_pad (GnlObject * object, const gchar * name, GstPad * target)
} }
/* /*
* gnl_object_ghost_pad_no_target: * nle_object_ghost_pad_no_target:
* /!\ Doesn't add the pad to the GnlObject.... * /!\ Doesn't add the pad to the NleObject....
*/ */
GstPad * GstPad *
gnl_object_ghost_pad_no_target (GnlObject * object, const gchar * name, nle_object_ghost_pad_no_target (NleObject * object, const gchar * name,
GstPadDirection dir, GstPadTemplate * template) GstPadDirection dir, GstPadTemplate * template)
{ {
GstPad *ghost; GstPad *ghost;
GnlPadPrivate *priv; NlePadPrivate *priv;
/* create a no_target ghostpad */ /* create a no_target ghostpad */
if (template) if (template)
@ -720,7 +720,7 @@ gnl_object_ghost_pad_no_target (GnlObject * object, const gchar * name,
/* remember the existing ghostpad event/query/link/unlink functions */ /* remember the existing ghostpad event/query/link/unlink functions */
priv = g_slice_new0 (GnlPadPrivate); priv = g_slice_new0 (NlePadPrivate);
priv->dir = dir; priv->dir = dir;
priv->object = object; priv->object = object;
@ -744,9 +744,9 @@ gnl_object_ghost_pad_no_target (GnlObject * object, const gchar * name,
void void
gnl_object_remove_ghost_pad (GnlObject * object, GstPad * ghost) nle_object_remove_ghost_pad (NleObject * object, GstPad * ghost)
{ {
GnlPadPrivate *priv; NlePadPrivate *priv;
GST_DEBUG_OBJECT (object, "ghostpad %s:%s", GST_DEBUG_PAD_NAME (ghost)); GST_DEBUG_OBJECT (object, "ghostpad %s:%s", GST_DEBUG_PAD_NAME (ghost));
@ -754,14 +754,14 @@ gnl_object_remove_ghost_pad (GnlObject * object, GstPad * ghost)
gst_ghost_pad_set_target (GST_GHOST_PAD (ghost), NULL); gst_ghost_pad_set_target (GST_GHOST_PAD (ghost), NULL);
gst_element_remove_pad (GST_ELEMENT (object), ghost); gst_element_remove_pad (GST_ELEMENT (object), ghost);
if (priv) if (priv)
g_slice_free (GnlPadPrivate, priv); g_slice_free (NlePadPrivate, priv);
} }
gboolean gboolean
gnl_object_ghost_pad_set_target (GnlObject * object, GstPad * ghost, nle_object_ghost_pad_set_target (NleObject * object, GstPad * ghost,
GstPad * target) GstPad * target)
{ {
GnlPadPrivate *priv = gst_pad_get_element_private (ghost); NlePadPrivate *priv = gst_pad_get_element_private (ghost);
g_return_val_if_fail (priv, FALSE); g_return_val_if_fail (priv, FALSE);
g_return_val_if_fail (GST_IS_PAD (ghost), FALSE); g_return_val_if_fail (GST_IS_PAD (ghost), FALSE);
@ -795,9 +795,9 @@ gnl_object_ghost_pad_set_target (GnlObject * object, GstPad * ghost,
} }
void void
gnl_init_ghostpad_category (void) nle_init_ghostpad_category (void)
{ {
GST_DEBUG_CATEGORY_INIT (gnlghostpad, "gnlghostpad", GST_DEBUG_CATEGORY_INIT (nleghostpad, "nleghostpad",
GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GNonLin GhostPad"); GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GNonLin GhostPad");
} }

View file

@ -1,7 +1,7 @@
/* GStreamer /* GStreamer
* Copyright (C) 2009 Edward Hervey <bilboed@bilboed.com> * Copyright (C) 2009 Edward Hervey <bilboed@bilboed.com>
* *
* gnlghostpad.h: Header for helper ghostpad * nleghostpad.h: Header for helper ghostpad
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -20,29 +20,29 @@
*/ */
#ifndef __GNL_GHOSTPAD_H__ #ifndef __NLE_GHOSTPAD_H__
#define __GNL_GHOSTPAD_H__ #define __NLE_GHOSTPAD_H__
#include <gst/gst.h> #include <gst/gst.h>
#include "gnltypes.h" #include "nletypes.h"
G_BEGIN_DECLS G_BEGIN_DECLS
GstPad *gnl_object_ghost_pad (GnlObject * object, GstPad *nle_object_ghost_pad (NleObject * object,
const gchar * name, GstPad * target); const gchar * name, GstPad * target);
GstPad *gnl_object_ghost_pad_no_target (GnlObject * object, GstPad *nle_object_ghost_pad_no_target (NleObject * object,
const gchar * name, GstPadDirection dir, GstPadTemplate *templ); const gchar * name, GstPadDirection dir, GstPadTemplate *templ);
gboolean gnl_object_ghost_pad_set_target (GnlObject * object, gboolean nle_object_ghost_pad_set_target (NleObject * object,
GstPad * ghost, GstPad * target); GstPad * ghost, GstPad * target);
void gnl_object_remove_ghost_pad (GnlObject * object, GstPad * ghost); void nle_object_remove_ghost_pad (NleObject * object, GstPad * ghost);
GstEvent * gnl_object_translate_incoming_seek (GnlObject * object, GstEvent * event); GstEvent * nle_object_translate_incoming_seek (NleObject * object, GstEvent * event);
void gnl_init_ghostpad_category (void); void nle_init_ghostpad_category (void);
G_END_DECLS G_END_DECLS
#endif /* __GNL_GHOSTPAD_H__ */ #endif /* __NLE_GHOSTPAD_H__ */

View file

@ -23,15 +23,15 @@
#endif #endif
#include <string.h> #include <string.h>
#include "gnl.h" #include "nle.h"
/** /**
* SECTION:gnlobject * SECTION:nleobject
* @short_description: Base class for GNonLin elements * @short_description: Base class for GNonLin elements
* *
* <refsect2> * <refsect2>
* <para> * <para>
* GnlObject encapsulates default behaviour and implements standard * NleObject encapsulates default behaviour and implements standard
* properties provided by all the GNonLin elements. * properties provided by all the GNonLin elements.
* </para> * </para>
* </refsect2> * </refsect2>
@ -39,8 +39,8 @@
*/ */
GST_DEBUG_CATEGORY_STATIC (gnlobject_debug); GST_DEBUG_CATEGORY_STATIC (nleobject_debug);
#define GST_CAT_DEFAULT gnlobject_debug #define GST_CAT_DEFAULT nleobject_debug
static GObjectClass *parent_class = NULL; static GObjectClass *parent_class = NULL;
@ -58,11 +58,11 @@ if (object->pending_##property != object->property) { \
} }
#define SET_PENDING_VALUE(property, property_str, type, print_format) \ #define SET_PENDING_VALUE(property, property_str, type, print_format) \
gnlobject->pending_##property = g_value_get_##type (value); \ nleobject->pending_##property = g_value_get_##type (value); \
if (gnlobject->property != gnlobject->pending_##property) { \ if (nleobject->property != nleobject->pending_##property) { \
GST_DEBUG_OBJECT(object, "Setting pending " property_str " to %" \ GST_DEBUG_OBJECT(object, "Setting pending " property_str " to %" \
print_format, gnlobject->pending_##property); \ print_format, nleobject->pending_##property); \
gnl_object_set_commit_needed (gnlobject); \ nle_object_set_commit_needed (nleobject); \
} else \ } else \
GST_DEBUG_OBJECT(object, "Pending " property_str " did not change"); GST_DEBUG_OBJECT(object, "Pending " property_str " did not change");
@ -82,50 +82,50 @@ enum
static GParamSpec *properties[PROP_LAST]; static GParamSpec *properties[PROP_LAST];
static void gnl_object_dispose (GObject * object); static void nle_object_dispose (GObject * object);
static void gnl_object_set_property (GObject * object, guint prop_id, static void nle_object_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
static void gnl_object_get_property (GObject * object, guint prop_id, static void nle_object_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
static GstStateChangeReturn gnl_object_change_state (GstElement * element, static GstStateChangeReturn nle_object_change_state (GstElement * element,
GstStateChange transition); GstStateChange transition);
static gboolean gnl_object_prepare_func (GnlObject * object); static gboolean nle_object_prepare_func (NleObject * object);
static gboolean gnl_object_cleanup_func (GnlObject * object); static gboolean nle_object_cleanup_func (NleObject * object);
static gboolean gnl_object_commit_func (GnlObject * object, gboolean recurse); static gboolean nle_object_commit_func (NleObject * object, gboolean recurse);
static GstStateChangeReturn gnl_object_prepare (GnlObject * object); static GstStateChangeReturn nle_object_prepare (NleObject * object);
static void static void
gnl_object_class_init (GnlObjectClass * klass) nle_object_class_init (NleObjectClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
GnlObjectClass *gnlobject_class; NleObjectClass *nleobject_class;
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gnlobject_class = (GnlObjectClass *) klass; nleobject_class = (NleObjectClass *) klass;
GST_DEBUG_CATEGORY_INIT (gnlobject_debug, "gnlobject", GST_DEBUG_CATEGORY_INIT (nleobject_debug, "nleobject",
GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GNonLin object"); GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GNonLin object");
parent_class = g_type_class_ref (GST_TYPE_BIN); parent_class = g_type_class_ref (GST_TYPE_BIN);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gnl_object_set_property); gobject_class->set_property = GST_DEBUG_FUNCPTR (nle_object_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gnl_object_get_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (nle_object_get_property);
gobject_class->dispose = GST_DEBUG_FUNCPTR (gnl_object_dispose); gobject_class->dispose = GST_DEBUG_FUNCPTR (nle_object_dispose);
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gnl_object_change_state); gstelement_class->change_state = GST_DEBUG_FUNCPTR (nle_object_change_state);
gnlobject_class->prepare = GST_DEBUG_FUNCPTR (gnl_object_prepare_func); nleobject_class->prepare = GST_DEBUG_FUNCPTR (nle_object_prepare_func);
gnlobject_class->cleanup = GST_DEBUG_FUNCPTR (gnl_object_cleanup_func); nleobject_class->cleanup = GST_DEBUG_FUNCPTR (nle_object_cleanup_func);
gnlobject_class->commit_signal_handler = nleobject_class->commit_signal_handler =
GST_DEBUG_FUNCPTR (gnl_object_commit); GST_DEBUG_FUNCPTR (nle_object_commit);
gnlobject_class->commit = GST_DEBUG_FUNCPTR (gnl_object_commit_func); nleobject_class->commit = GST_DEBUG_FUNCPTR (nle_object_commit_func);
/** /**
* GnlObject:start * NleObject:start
* *
* The start position relative to the parent in nanoseconds. * The start position relative to the parent in nanoseconds.
*/ */
@ -136,7 +136,7 @@ gnl_object_class_init (GnlObjectClass * klass)
properties[PROP_START]); properties[PROP_START]);
/** /**
* GnlObject:duration * NleObject:duration
* *
* The outgoing duration in nanoseconds. * The outgoing duration in nanoseconds.
*/ */
@ -147,7 +147,7 @@ gnl_object_class_init (GnlObjectClass * klass)
properties[PROP_DURATION]); properties[PROP_DURATION]);
/** /**
* GnlObject:stop * NleObject:stop
* *
* The stop position relative to the parent in nanoseconds. * The stop position relative to the parent in nanoseconds.
* *
@ -160,7 +160,7 @@ gnl_object_class_init (GnlObjectClass * klass)
properties[PROP_STOP]); properties[PROP_STOP]);
/** /**
* GnlObject:inpoint * NleObject:inpoint
* *
* The media start position in nanoseconds. * The media start position in nanoseconds.
* *
@ -175,7 +175,7 @@ gnl_object_class_init (GnlObjectClass * klass)
properties[PROP_INPOINT]); properties[PROP_INPOINT]);
/** /**
* GnlObject:priority * NleObject:priority
* *
* The priority of the object in the container. * The priority of the object in the container.
* *
@ -185,7 +185,7 @@ gnl_object_class_init (GnlObjectClass * klass)
* The lowest priority is G_MAXUINT32. * The lowest priority is G_MAXUINT32.
* *
* Objects whose priority is (-1) will be considered as 'default' objects * Objects whose priority is (-1) will be considered as 'default' objects
* in GnlComposition and their start/stop values will be modified as to * in NleComposition and their start/stop values will be modified as to
* fit the whole duration of the composition. * fit the whole duration of the composition.
*/ */
properties[PROP_PRIORITY] = g_param_spec_uint ("priority", "Priority", properties[PROP_PRIORITY] = g_param_spec_uint ("priority", "Priority",
@ -195,19 +195,19 @@ gnl_object_class_init (GnlObjectClass * klass)
properties[PROP_PRIORITY]); properties[PROP_PRIORITY]);
/** /**
* GnlObject:active * NleObject:active
* *
* Indicates whether this object should be used by its container. * Indicates whether this object should be used by its container.
* *
* Set to #TRUE to temporarily disable this object in a #GnlComposition. * Set to #TRUE to temporarily disable this object in a #NleComposition.
*/ */
properties[PROP_ACTIVE] = g_param_spec_boolean ("active", "Active", properties[PROP_ACTIVE] = g_param_spec_boolean ("active", "Active",
"Use this object in the GnlComposition", TRUE, G_PARAM_READWRITE); "Use this object in the NleComposition", TRUE, G_PARAM_READWRITE);
g_object_class_install_property (gobject_class, PROP_ACTIVE, g_object_class_install_property (gobject_class, PROP_ACTIVE,
properties[PROP_ACTIVE]); properties[PROP_ACTIVE]);
/** /**
* GnlObject:caps * NleObject:caps
* *
* Caps used to filter/choose the output stream. * Caps used to filter/choose the output stream.
* *
@ -223,10 +223,10 @@ gnl_object_class_init (GnlObjectClass * klass)
properties[PROP_CAPS]); properties[PROP_CAPS]);
/** /**
* GnlObject:expandable * NleObject:expandable
* *
* Indicates whether this object should expand to the full duration of its * Indicates whether this object should expand to the full duration of its
* container #GnlComposition. * container #NleComposition.
*/ */
properties[PROP_EXPANDABLE] = properties[PROP_EXPANDABLE] =
g_param_spec_boolean ("expandable", "Expandable", g_param_spec_boolean ("expandable", "Expandable",
@ -237,7 +237,7 @@ gnl_object_class_init (GnlObjectClass * klass)
} }
static void static void
gnl_object_init (GnlObject * object, GnlObjectClass * klass) nle_object_init (NleObject * object, NleObjectClass * klass)
{ {
object->start = object->pending_start = 0; object->start = object->pending_start = 0;
object->duration = object->pending_duration = 0; object->duration = object->pending_duration = 0;
@ -253,7 +253,7 @@ gnl_object_init (GnlObject * object, GnlObjectClass * klass)
object->segment_start = -1; object->segment_start = -1;
object->segment_stop = -1; object->segment_stop = -1;
object->srcpad = gnl_object_ghost_pad_no_target (object, object->srcpad = nle_object_ghost_pad_no_target (object,
"src", GST_PAD_SRC, "src", GST_PAD_SRC,
gst_element_class_get_pad_template ((GstElementClass *) klass, "src")); gst_element_class_get_pad_template ((GstElementClass *) klass, "src"));
@ -261,21 +261,21 @@ gnl_object_init (GnlObject * object, GnlObjectClass * klass)
} }
static void static void
gnl_object_dispose (GObject * object) nle_object_dispose (GObject * object)
{ {
GnlObject *gnl = (GnlObject *) object; NleObject *nle = (NleObject *) object;
if (gnl->caps) { if (nle->caps) {
gst_caps_unref (gnl->caps); gst_caps_unref (nle->caps);
gnl->caps = NULL; nle->caps = NULL;
} }
G_OBJECT_CLASS (parent_class)->dispose (object); G_OBJECT_CLASS (parent_class)->dispose (object);
} }
/** /**
* gnl_object_to_media_time: * nle_object_to_media_time:
* @object: a #GnlObject * @object: a #NleObject
* @objecttime: The #GstClockTime we want to convert * @objecttime: The #GstClockTime we want to convert
* @mediatime: A pointer on a #GstClockTime to fill * @mediatime: A pointer on a #GstClockTime to fill
* *
@ -285,7 +285,7 @@ gnl_object_dispose (GObject * object)
* FALSE otherwise * FALSE otherwise
*/ */
gboolean gboolean
gnl_object_to_media_time (GnlObject * object, GstClockTime otime, nle_object_to_media_time (NleObject * object, GstClockTime otime,
GstClockTime * mtime) GstClockTime * mtime)
{ {
g_return_val_if_fail (mtime, FALSE); g_return_val_if_fail (mtime, FALSE);
@ -328,8 +328,8 @@ gnl_object_to_media_time (GnlObject * object, GstClockTime otime,
} }
/** /**
* gnl_media_to_object_time: * nle_media_to_object_time:
* @object: The #GnlObject * @object: The #NleObject
* @mediatime: The #GstClockTime we want to convert * @mediatime: The #GstClockTime we want to convert
* @objecttime: A pointer on a #GstClockTime to fill * @objecttime: A pointer on a #GstClockTime to fill
* *
@ -340,7 +340,7 @@ gnl_object_to_media_time (GnlObject * object, GstClockTime otime,
*/ */
gboolean gboolean
gnl_media_to_object_time (GnlObject * object, GstClockTime mtime, nle_media_to_object_time (NleObject * object, GstClockTime mtime,
GstClockTime * otime) GstClockTime * otime)
{ {
g_return_val_if_fail (otime, FALSE); g_return_val_if_fail (otime, FALSE);
@ -373,7 +373,7 @@ gnl_media_to_object_time (GnlObject * object, GstClockTime mtime,
} }
static gboolean static gboolean
gnl_object_prepare_func (GnlObject * object) nle_object_prepare_func (NleObject * object)
{ {
GST_DEBUG_OBJECT (object, "default prepare function, returning TRUE"); GST_DEBUG_OBJECT (object, "default prepare function, returning TRUE");
@ -381,13 +381,13 @@ gnl_object_prepare_func (GnlObject * object)
} }
static GstStateChangeReturn static GstStateChangeReturn
gnl_object_prepare (GnlObject * object) nle_object_prepare (NleObject * object)
{ {
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
GST_DEBUG_OBJECT (object, "preparing"); GST_DEBUG_OBJECT (object, "preparing");
if (!(GNL_OBJECT_GET_CLASS (object)->prepare (object))) if (!(NLE_OBJECT_GET_CLASS (object)->prepare (object)))
ret = GST_STATE_CHANGE_FAILURE; ret = GST_STATE_CHANGE_FAILURE;
GST_DEBUG_OBJECT (object, "finished preparing, returning %d", ret); GST_DEBUG_OBJECT (object, "finished preparing, returning %d", ret);
@ -396,7 +396,7 @@ gnl_object_prepare (GnlObject * object)
} }
static gboolean static gboolean
gnl_object_cleanup_func (GnlObject * object) nle_object_cleanup_func (NleObject * object)
{ {
GST_DEBUG_OBJECT (object, "default cleanup function, returning TRUE"); GST_DEBUG_OBJECT (object, "default cleanup function, returning TRUE");
@ -404,13 +404,13 @@ gnl_object_cleanup_func (GnlObject * object)
} }
GstStateChangeReturn GstStateChangeReturn
gnl_object_cleanup (GnlObject * object) nle_object_cleanup (NleObject * object)
{ {
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
GST_DEBUG_OBJECT (object, "cleaning-up"); GST_DEBUG_OBJECT (object, "cleaning-up");
if (!(GNL_OBJECT_GET_CLASS (object)->cleanup (object))) if (!(NLE_OBJECT_GET_CLASS (object)->cleanup (object)))
ret = GST_STATE_CHANGE_FAILURE; ret = GST_STATE_CHANGE_FAILURE;
GST_DEBUG_OBJECT (object, "finished preparing, returning %d", ret); GST_DEBUG_OBJECT (object, "finished preparing, returning %d", ret);
@ -419,7 +419,7 @@ gnl_object_cleanup (GnlObject * object)
} }
void void
gnl_object_set_caps (GnlObject * object, const GstCaps * caps) nle_object_set_caps (NleObject * object, const GstCaps * caps)
{ {
if (object->caps) if (object->caps)
gst_caps_unref (object->caps); gst_caps_unref (object->caps);
@ -428,25 +428,25 @@ gnl_object_set_caps (GnlObject * object, const GstCaps * caps)
} }
static inline void static inline void
_update_stop (GnlObject * gnlobject) _update_stop (NleObject * nleobject)
{ {
/* check if start/duration has changed */ /* check if start/duration has changed */
if ((gnlobject->pending_start + gnlobject->pending_duration) != if ((nleobject->pending_start + nleobject->pending_duration) !=
gnlobject->stop) { nleobject->stop) {
gnlobject->stop = gnlobject->pending_start + gnlobject->pending_duration; nleobject->stop = nleobject->pending_start + nleobject->pending_duration;
GST_LOG_OBJECT (gnlobject, GST_LOG_OBJECT (nleobject,
"Updating stop value : %" GST_TIME_FORMAT " [start:%" GST_TIME_FORMAT "Updating stop value : %" GST_TIME_FORMAT " [start:%" GST_TIME_FORMAT
", duration:%" GST_TIME_FORMAT "]", GST_TIME_ARGS (gnlobject->stop), ", duration:%" GST_TIME_FORMAT "]", GST_TIME_ARGS (nleobject->stop),
GST_TIME_ARGS (gnlobject->pending_start), GST_TIME_ARGS (nleobject->pending_start),
GST_TIME_ARGS (gnlobject->pending_duration)); GST_TIME_ARGS (nleobject->pending_duration));
g_object_notify_by_pspec (G_OBJECT (gnlobject), properties[PROP_STOP]); g_object_notify_by_pspec (G_OBJECT (nleobject), properties[PROP_STOP]);
} }
} }
static void static void
update_values (GnlObject * object) update_values (NleObject * object)
{ {
CHECK_AND_SET (START, start, "start", G_GUINT64_FORMAT); CHECK_AND_SET (START, start, "start", G_GUINT64_FORMAT);
CHECK_AND_SET (INPOINT, inpoint, "inpoint", G_GUINT64_FORMAT); CHECK_AND_SET (INPOINT, inpoint, "inpoint", G_GUINT64_FORMAT);
@ -458,7 +458,7 @@ update_values (GnlObject * object)
} }
static gboolean static gboolean
gnl_object_commit_func (GnlObject * object, gboolean recurse) nle_object_commit_func (NleObject * object, gboolean recurse)
{ {
GST_INFO_OBJECT (object, "Commiting object changed"); GST_INFO_OBJECT (object, "Commiting object changed");
@ -476,12 +476,12 @@ gnl_object_commit_func (GnlObject * object, gboolean recurse)
} }
static void static void
gnl_object_set_property (GObject * object, guint prop_id, nle_object_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
GnlObject *gnlobject = (GnlObject *) object; NleObject *nleobject = (NleObject *) object;
g_return_if_fail (GNL_IS_OBJECT (object)); g_return_if_fail (NLE_IS_OBJECT (object));
GST_OBJECT_LOCK (object); GST_OBJECT_LOCK (object);
switch (prop_id) { switch (prop_id) {
@ -501,13 +501,13 @@ gnl_object_set_property (GObject * object, guint prop_id,
SET_PENDING_VALUE (active, "active", boolean, G_GUINT32_FORMAT); SET_PENDING_VALUE (active, "active", boolean, G_GUINT32_FORMAT);
break; break;
case PROP_CAPS: case PROP_CAPS:
gnl_object_set_caps (gnlobject, gst_value_get_caps (value)); nle_object_set_caps (nleobject, gst_value_get_caps (value));
break; break;
case PROP_EXPANDABLE: case PROP_EXPANDABLE:
if (g_value_get_boolean (value)) if (g_value_get_boolean (value))
GST_OBJECT_FLAG_SET (gnlobject, GNL_OBJECT_EXPANDABLE); GST_OBJECT_FLAG_SET (nleobject, NLE_OBJECT_EXPANDABLE);
else else
GST_OBJECT_FLAG_UNSET (gnlobject, GNL_OBJECT_EXPANDABLE); GST_OBJECT_FLAG_UNSET (nleobject, NLE_OBJECT_EXPANDABLE);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -515,39 +515,39 @@ gnl_object_set_property (GObject * object, guint prop_id,
} }
GST_OBJECT_UNLOCK (object); GST_OBJECT_UNLOCK (object);
_update_stop (gnlobject); _update_stop (nleobject);
} }
static void static void
gnl_object_get_property (GObject * object, guint prop_id, nle_object_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec) GValue * value, GParamSpec * pspec)
{ {
GnlObject *gnlobject = (GnlObject *) object; NleObject *nleobject = (NleObject *) object;
switch (prop_id) { switch (prop_id) {
case PROP_START: case PROP_START:
g_value_set_uint64 (value, gnlobject->pending_start); g_value_set_uint64 (value, nleobject->pending_start);
break; break;
case PROP_DURATION: case PROP_DURATION:
g_value_set_int64 (value, gnlobject->pending_duration); g_value_set_int64 (value, nleobject->pending_duration);
break; break;
case PROP_STOP: case PROP_STOP:
g_value_set_uint64 (value, gnlobject->stop); g_value_set_uint64 (value, nleobject->stop);
break; break;
case PROP_INPOINT: case PROP_INPOINT:
g_value_set_uint64 (value, gnlobject->pending_inpoint); g_value_set_uint64 (value, nleobject->pending_inpoint);
break; break;
case PROP_PRIORITY: case PROP_PRIORITY:
g_value_set_uint (value, gnlobject->pending_priority); g_value_set_uint (value, nleobject->pending_priority);
break; break;
case PROP_ACTIVE: case PROP_ACTIVE:
g_value_set_boolean (value, gnlobject->pending_active); g_value_set_boolean (value, nleobject->pending_active);
break; break;
case PROP_CAPS: case PROP_CAPS:
gst_value_set_caps (value, gnlobject->caps); gst_value_set_caps (value, nleobject->caps);
break; break;
case PROP_EXPANDABLE: case PROP_EXPANDABLE:
g_value_set_boolean (value, GNL_OBJECT_IS_EXPANDABLE (object)); g_value_set_boolean (value, NLE_OBJECT_IS_EXPANDABLE (object));
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -556,7 +556,7 @@ gnl_object_get_property (GObject * object, guint prop_id,
} }
static GstStateChangeReturn static GstStateChangeReturn
gnl_object_change_state (GstElement * element, GstStateChange transition) nle_object_change_state (GstElement * element, GstStateChange transition)
{ {
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
@ -568,11 +568,12 @@ gnl_object_change_state (GstElement * element, GstStateChange transition)
/* Going to READY and if we are not in a composition, we need to make /* Going to READY and if we are not in a composition, we need to make
* sure that the object positioning state is properly commited */ * sure that the object positioning state is properly commited */
if (parent) { if (parent) {
if (g_strcmp0 (gst_element_get_name (GST_ELEMENT (parent)), "current-bin") && if (g_strcmp0 (gst_element_get_name (GST_ELEMENT (parent)),
!GNL_OBJECT_IS_COMPOSITION (GNL_OBJECT (element))) { "current-bin")
GST_INFO ("Adding gnlobject to something that is not a composition," && !NLE_OBJECT_IS_COMPOSITION (NLE_OBJECT (element))) {
GST_INFO ("Adding nleobject to something that is not a composition,"
" commiting ourself"); " commiting ourself");
gnl_object_commit (GNL_OBJECT (element), FALSE); nle_object_commit (NLE_OBJECT (element), FALSE);
} }
gst_object_unref (parent); gst_object_unref (parent);
@ -580,7 +581,7 @@ gnl_object_change_state (GstElement * element, GstStateChange transition)
} }
break; break;
case GST_STATE_CHANGE_READY_TO_PAUSED: case GST_STATE_CHANGE_READY_TO_PAUSED:
if (gnl_object_prepare (GNL_OBJECT (element)) == GST_STATE_CHANGE_FAILURE) { if (nle_object_prepare (NLE_OBJECT (element)) == GST_STATE_CHANGE_FAILURE) {
ret = GST_STATE_CHANGE_FAILURE; ret = GST_STATE_CHANGE_FAILURE;
goto beach; goto beach;
} }
@ -600,8 +601,8 @@ gnl_object_change_state (GstElement * element, GstStateChange transition)
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
/* cleanup gnlobject */ /* cleanup nleobject */
if (gnl_object_cleanup (GNL_OBJECT (element)) == GST_STATE_CHANGE_FAILURE) if (nle_object_cleanup (NLE_OBJECT (element)) == GST_STATE_CHANGE_FAILURE)
ret = GST_STATE_CHANGE_FAILURE; ret = GST_STATE_CHANGE_FAILURE;
break; break;
default: default:
@ -613,7 +614,7 @@ beach:
} }
void void
gnl_object_set_commit_needed (GnlObject * object) nle_object_set_commit_needed (NleObject * object)
{ {
if (G_UNLIKELY (object->commiting)) { if (G_UNLIKELY (object->commiting)) {
GST_WARNING_OBJECT (object, GST_WARNING_OBJECT (object,
@ -627,14 +628,14 @@ gnl_object_set_commit_needed (GnlObject * object)
} }
gboolean gboolean
gnl_object_commit (GnlObject * object, gboolean recurse) nle_object_commit (NleObject * object, gboolean recurse)
{ {
gboolean ret; gboolean ret;
GST_DEBUG_OBJECT (object, "Commiting object state"); GST_DEBUG_OBJECT (object, "Commiting object state");
object->commiting = TRUE; object->commiting = TRUE;
ret = GNL_OBJECT_GET_CLASS (object)->commit (object, recurse); ret = NLE_OBJECT_GET_CLASS (object)->commit (object, recurse);
object->commiting = FALSE; object->commiting = FALSE;
return ret; return ret;
@ -642,7 +643,7 @@ gnl_object_commit (GnlObject * object, gboolean recurse)
} }
void void
gnl_object_reset (GnlObject * object) nle_object_reset (NleObject * object)
{ {
GST_INFO_OBJECT (object, "Resetting child timing values to default"); GST_INFO_OBJECT (object, "Resetting child timing values to default");
@ -655,26 +656,26 @@ gnl_object_reset (GnlObject * object)
} }
GType GType
gnl_object_get_type (void) nle_object_get_type (void)
{ {
static volatile gsize type = 0; static volatile gsize type = 0;
if (g_once_init_enter (&type)) { if (g_once_init_enter (&type)) {
GType _type; GType _type;
static const GTypeInfo info = { static const GTypeInfo info = {
sizeof (GnlObjectClass), sizeof (NleObjectClass),
NULL, NULL,
NULL, NULL,
(GClassInitFunc) gnl_object_class_init, (GClassInitFunc) nle_object_class_init,
NULL, NULL,
NULL, NULL,
sizeof (GnlObject), sizeof (NleObject),
0, 0,
(GInstanceInitFunc) gnl_object_init, (GInstanceInitFunc) nle_object_init,
}; };
_type = g_type_register_static (GST_TYPE_BIN, _type = g_type_register_static (GST_TYPE_BIN,
"GnlObject", &info, G_TYPE_FLAG_ABSTRACT); "NleObject", &info, G_TYPE_FLAG_ABSTRACT);
g_once_init_leave (&type, _type); g_once_init_leave (&type, _type);
} }
return type; return type;

170
ges/nle/nleobject.h Normal file
View file

@ -0,0 +1,170 @@
/* GStreamer
* Copyright (C) 2001 Wim Taymans <wim.taymans@gmail.com>
* 2004-2008 Edward Hervey <bilboed@bilboed.com>
*
* nleobject.h: Header for base NleObject
*
* 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.
*/
#ifndef __NLE_OBJECT_H__
#define __NLE_OBJECT_H__
#include <gst/gst.h>
#include "nletypes.h"
G_BEGIN_DECLS
#define NLE_TYPE_OBJECT \
(nle_object_get_type())
#define NLE_OBJECT(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),NLE_TYPE_OBJECT,NleObject))
#define NLE_OBJECT_CAST(obj) ((NleObject*) (obj))
#define NLE_OBJECT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),NLE_TYPE_OBJECT,NleObjectClass))
#define NLE_OBJECT_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NLE_TYPE_OBJECT, NleObjectClass))
#define NLE_IS_OBJECT(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),NLE_TYPE_OBJECT))
#define NLE_IS_OBJECT_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),NLE_TYPE_OBJECT))
#define NLE_OBJECT_SRC(obj) (((NleObject *) obj)->srcpad)
/**
* NleObjectFlags:
* @NLE_OBJECT_IS_SOURCE:
* @NLE_OBJECT_IS_OPERATION:
* @NLE_OBJECT_IS_EXPANDABLE: The #NleObject start/stop will extend accross the full composition.
* @NLE_OBJECT_LAST_FLAG:
*/
typedef enum
{
NLE_OBJECT_SOURCE = (GST_BIN_FLAG_LAST << 0),
NLE_OBJECT_OPERATION = (GST_BIN_FLAG_LAST << 1),
NLE_OBJECT_EXPANDABLE = (GST_BIN_FLAG_LAST << 2),
NLE_OBJECT_COMPOSITION = (GST_BIN_FLAG_LAST << 3),
/* padding */
NLE_OBJECT_LAST_FLAG = (GST_BIN_FLAG_LAST << 5)
} NleObjectFlags;
#define NLE_OBJECT_IS_SOURCE(obj) \
(GST_OBJECT_FLAG_IS_SET(obj, NLE_OBJECT_SOURCE))
#define NLE_OBJECT_IS_OPERATION(obj) \
(GST_OBJECT_FLAG_IS_SET(obj, NLE_OBJECT_OPERATION))
#define NLE_OBJECT_IS_EXPANDABLE(obj) \
(GST_OBJECT_FLAG_IS_SET(obj, NLE_OBJECT_EXPANDABLE))
#define NLE_OBJECT_IS_COMPOSITION(obj) \
(GST_OBJECT_FLAG_IS_SET(obj, NLE_OBJECT_COMPOSITION))
/* For internal usage only */
#define NLE_OBJECT_START(obj) (NLE_OBJECT_CAST (obj)->start)
#define NLE_OBJECT_STOP(obj) (NLE_OBJECT_CAST (obj)->stop)
#define NLE_OBJECT_DURATION(obj) (NLE_OBJECT_CAST (obj)->duration)
#define NLE_OBJECT_INPOINT(obj) (NLE_OBJECT_CAST (obj)->inpoint)
#define NLE_OBJECT_PRIORITY(obj) (NLE_OBJECT_CAST (obj)->priority)
#define NLE_OBJECT_IS_COMMITING(obj) (NLE_OBJECT_CAST (obj)->commiting)
struct _NleObject
{
GstBin parent;
GstPad *srcpad;
/* Time positionning */
GstClockTime start;
GstClockTime inpoint;
GstClockTimeDiff duration;
/* Pending time positionning
* Should be == GST_CLOCK_TIME_NONE when nothing to do
*/
GstClockTime pending_start;
GstClockTime pending_inpoint;
GstClockTimeDiff pending_duration;
guint32 pending_priority;
gboolean pending_active;
gboolean commit_needed;
gboolean commiting; /* Set to TRUE during the commiting time only */
gboolean expandable;
/* read-only */
GstClockTime stop;
/* priority in parent */
guint32 priority;
/* active in parent */
gboolean active;
/* Filtering caps */
GstCaps *caps;
/* current segment seek <RO> */
gdouble segment_rate;
GstSeekFlags segment_flags;
gint64 segment_start;
gint64 segment_stop;
gboolean in_composition;
};
struct _NleObjectClass
{
GstBinClass parent_class;
/* Signal method handler */
gboolean (*commit_signal_handler) (NleObject * object, gboolean recurse);
/* virtual methods for subclasses */
gboolean (*prepare) (NleObject * object);
gboolean (*cleanup) (NleObject * object);
gboolean (*commit) (NleObject * object, gboolean recurse);
};
GType nle_object_get_type (void);
gboolean
nle_object_to_media_time (NleObject * object, GstClockTime otime,
GstClockTime * mtime);
gboolean
nle_media_to_object_time (NleObject * object, GstClockTime mtime,
GstClockTime * otime);
void
nle_object_set_caps (NleObject * object, const GstCaps * caps);
void
nle_object_set_commit_needed (NleObject *object);
gboolean
nle_object_commit (NleObject *object, gboolean recurse);
void
nle_object_reset (NleObject *object);
GstStateChangeReturn
nle_object_cleanup (NleObject * object);
G_END_DECLS
#endif /* __NLE_OBJECT_H__ */

View file

@ -23,39 +23,39 @@
#include "config.h" #include "config.h"
#endif #endif
#include "gnl.h" #include "nle.h"
/** /**
* SECTION:element-gnloperation * SECTION:element-nleoperation
* *
* <refsect2> * <refsect2>
* <para> * <para>
* A GnlOperation performs a transformation or mixing operation on the * A NleOperation performs a transformation or mixing operation on the
* data from one or more #GnlSources, which is used to implement filters or * data from one or more #NleSources, which is used to implement filters or
* effects. * effects.
* </para> * </para>
* </refsect2> * </refsect2>
*/ */
static GstStaticPadTemplate gnl_operation_src_template = static GstStaticPadTemplate nle_operation_src_template =
GST_STATIC_PAD_TEMPLATE ("src", GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY); GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate gnl_operation_sink_template = static GstStaticPadTemplate nle_operation_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink%d", GST_STATIC_PAD_TEMPLATE ("sink%d",
GST_PAD_SINK, GST_PAD_SINK,
GST_PAD_REQUEST, GST_PAD_REQUEST,
GST_STATIC_CAPS_ANY); GST_STATIC_CAPS_ANY);
GST_DEBUG_CATEGORY_STATIC (gnloperation); GST_DEBUG_CATEGORY_STATIC (nleoperation);
#define GST_CAT_DEFAULT gnloperation #define GST_CAT_DEFAULT nleoperation
#define _do_init \ #define _do_init \
GST_DEBUG_CATEGORY_INIT (gnloperation, "gnloperation", GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GNonLin Operation element"); GST_DEBUG_CATEGORY_INIT (nleoperation, "nleoperation", GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GNonLin Operation element");
#define gnl_operation_parent_class parent_class #define nle_operation_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GnlOperation, gnl_operation, GNL_TYPE_OBJECT, G_DEFINE_TYPE_WITH_CODE (NleOperation, nle_operation, NLE_TYPE_OBJECT,
_do_init); _do_init);
enum enum
@ -70,50 +70,50 @@ enum
LAST_SIGNAL LAST_SIGNAL
}; };
static guint gnl_operation_signals[LAST_SIGNAL] = { 0 }; static guint nle_operation_signals[LAST_SIGNAL] = { 0 };
static void gnl_operation_dispose (GObject * object); static void nle_operation_dispose (GObject * object);
static void gnl_operation_set_property (GObject * object, guint prop_id, static void nle_operation_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
static void gnl_operation_get_property (GObject * object, guint prop_id, static void nle_operation_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
static gboolean gnl_operation_prepare (GnlObject * object); static gboolean nle_operation_prepare (NleObject * object);
static gboolean gnl_operation_cleanup (GnlObject * object); static gboolean nle_operation_cleanup (NleObject * object);
static gboolean gnl_operation_add_element (GstBin * bin, GstElement * element); static gboolean nle_operation_add_element (GstBin * bin, GstElement * element);
static gboolean gnl_operation_remove_element (GstBin * bin, static gboolean nle_operation_remove_element (GstBin * bin,
GstElement * element); GstElement * element);
static GstPad *gnl_operation_request_new_pad (GstElement * element, static GstPad *nle_operation_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name, const GstCaps * caps); GstPadTemplate * templ, const gchar * name, const GstCaps * caps);
static void gnl_operation_release_pad (GstElement * element, GstPad * pad); static void nle_operation_release_pad (GstElement * element, GstPad * pad);
static void synchronize_sinks (GnlOperation * operation); static void synchronize_sinks (NleOperation * operation);
static gboolean remove_sink_pad (GnlOperation * operation, GstPad * sinkpad); static gboolean remove_sink_pad (NleOperation * operation, GstPad * sinkpad);
static void static void
gnl_operation_class_init (GnlOperationClass * klass) nle_operation_class_init (NleOperationClass * klass)
{ {
GObjectClass *gobject_class = (GObjectClass *) klass; GObjectClass *gobject_class = (GObjectClass *) klass;
GstBinClass *gstbin_class = (GstBinClass *) klass; GstBinClass *gstbin_class = (GstBinClass *) klass;
GstElementClass *gstelement_class = (GstElementClass *) klass; GstElementClass *gstelement_class = (GstElementClass *) klass;
GnlObjectClass *gnlobject_class = (GnlObjectClass *) klass; NleObjectClass *nleobject_class = (NleObjectClass *) klass;
gst_element_class_set_static_metadata (gstelement_class, "GNonLin Operation", gst_element_class_set_static_metadata (gstelement_class, "GNonLin Operation",
"Filter/Editor", "Filter/Editor",
"Encapsulates filters/effects for use with GNL Objects", "Encapsulates filters/effects for use with NLE Objects",
"Wim Taymans <wim.taymans@gmail.com>, Edward Hervey <bilboed@bilboed.com>"); "Wim Taymans <wim.taymans@gmail.com>, Edward Hervey <bilboed@bilboed.com>");
gobject_class->dispose = GST_DEBUG_FUNCPTR (gnl_operation_dispose); gobject_class->dispose = GST_DEBUG_FUNCPTR (nle_operation_dispose);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gnl_operation_set_property); gobject_class->set_property = GST_DEBUG_FUNCPTR (nle_operation_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gnl_operation_get_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (nle_operation_get_property);
/** /**
* GnlOperation:sinks: * NleOperation:sinks:
* *
* Specifies the number of sink pads the operation should provide. * Specifies the number of sink pads the operation should provide.
* If the sinks property is -1 (the default) pads are only created as * If the sinks property is -1 (the default) pads are only created as
@ -125,47 +125,47 @@ gnl_operation_class_init (GnlOperationClass * klass)
G_PARAM_READWRITE)); G_PARAM_READWRITE));
/** /**
* GnlOperation:input-priority-changed: * NleOperation:input-priority-changed:
* @pad: The operation's input pad whose priority changed. * @pad: The operation's input pad whose priority changed.
* @priority: The new priority * @priority: The new priority
* *
* Signals that the @priority of the stream being fed to the given @pad * Signals that the @priority of the stream being fed to the given @pad
* might have changed. * might have changed.
*/ */
gnl_operation_signals[INPUT_PRIORITY_CHANGED] = nle_operation_signals[INPUT_PRIORITY_CHANGED] =
g_signal_new ("input-priority-changed", G_TYPE_FROM_CLASS (klass), g_signal_new ("input-priority-changed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GnlOperationClass, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (NleOperationClass,
input_priority_changed), NULL, NULL, g_cclosure_marshal_generic, input_priority_changed), NULL, NULL, g_cclosure_marshal_generic,
G_TYPE_NONE, 2, GST_TYPE_PAD, G_TYPE_UINT); G_TYPE_NONE, 2, GST_TYPE_PAD, G_TYPE_UINT);
gstelement_class->request_new_pad = gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gnl_operation_request_new_pad); GST_DEBUG_FUNCPTR (nle_operation_request_new_pad);
gstelement_class->release_pad = GST_DEBUG_FUNCPTR (gnl_operation_release_pad); gstelement_class->release_pad = GST_DEBUG_FUNCPTR (nle_operation_release_pad);
gstbin_class->add_element = GST_DEBUG_FUNCPTR (gnl_operation_add_element); gstbin_class->add_element = GST_DEBUG_FUNCPTR (nle_operation_add_element);
gstbin_class->remove_element = gstbin_class->remove_element =
GST_DEBUG_FUNCPTR (gnl_operation_remove_element); GST_DEBUG_FUNCPTR (nle_operation_remove_element);
gnlobject_class->prepare = GST_DEBUG_FUNCPTR (gnl_operation_prepare); nleobject_class->prepare = GST_DEBUG_FUNCPTR (nle_operation_prepare);
gnlobject_class->cleanup = GST_DEBUG_FUNCPTR (gnl_operation_cleanup); nleobject_class->cleanup = GST_DEBUG_FUNCPTR (nle_operation_cleanup);
gst_element_class_add_pad_template (gstelement_class, gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gnl_operation_src_template)); gst_static_pad_template_get (&nle_operation_src_template));
gst_element_class_add_pad_template (gstelement_class, gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gnl_operation_sink_template)); gst_static_pad_template_get (&nle_operation_sink_template));
} }
static void static void
gnl_operation_dispose (GObject * object) nle_operation_dispose (GObject * object)
{ {
GnlOperation *oper = (GnlOperation *) object; NleOperation *oper = (NleOperation *) object;
GST_DEBUG_OBJECT (object, "Disposing of source pad"); GST_DEBUG_OBJECT (object, "Disposing of source pad");
gnl_object_ghost_pad_set_target (GNL_OBJECT (object), nle_object_ghost_pad_set_target (NLE_OBJECT (object),
GNL_OBJECT (object)->srcpad, NULL); NLE_OBJECT (object)->srcpad, NULL);
GST_DEBUG_OBJECT (object, "Disposing of sink pad(s)"); GST_DEBUG_OBJECT (object, "Disposing of sink pad(s)");
while (oper->sinks) { while (oper->sinks) {
@ -178,7 +178,7 @@ gnl_operation_dispose (GObject * object)
} }
static void static void
gnl_operation_reset (GnlOperation * operation) nle_operation_reset (NleOperation * operation)
{ {
operation->num_sinks = 1; operation->num_sinks = 1;
operation->realsinks = 0; operation->realsinks = 0;
@ -186,9 +186,9 @@ gnl_operation_reset (GnlOperation * operation)
} }
static void static void
gnl_operation_init (GnlOperation * operation) nle_operation_init (NleOperation * operation)
{ {
gnl_operation_reset (operation); nle_operation_reset (operation);
operation->element = NULL; operation->element = NULL;
} }
@ -296,7 +296,7 @@ get_src_pad (GstElement * element)
* Returns : The number of static sink pads of the controlled element. * Returns : The number of static sink pads of the controlled element.
*/ */
static guint static guint
get_nb_static_sinks (GnlOperation * oper) get_nb_static_sinks (NleOperation * oper)
{ {
GstIterator *sinkpads; GstIterator *sinkpads;
gboolean done = FALSE; gboolean done = FALSE;
@ -332,9 +332,9 @@ get_nb_static_sinks (GnlOperation * oper)
} }
static gboolean static gboolean
gnl_operation_add_element (GstBin * bin, GstElement * element) nle_operation_add_element (GstBin * bin, GstElement * element)
{ {
GnlOperation *operation = (GnlOperation *) bin; NleOperation *operation = (NleOperation *) bin;
gboolean res = FALSE; gboolean res = FALSE;
gboolean isdynamic; gboolean isdynamic;
@ -360,8 +360,8 @@ gnl_operation_add_element (GstBin * bin, GstElement * element)
operation->element = element; operation->element = element;
operation->dynamicsinks = isdynamic; operation->dynamicsinks = isdynamic;
gnl_object_ghost_pad_set_target (GNL_OBJECT (operation), nle_object_ghost_pad_set_target (NLE_OBJECT (operation),
GNL_OBJECT (operation)->srcpad, srcpad); NLE_OBJECT (operation)->srcpad, srcpad);
/* Remove the reference get_src_pad gave us */ /* Remove the reference get_src_pad gave us */
gst_object_unref (srcpad); gst_object_unref (srcpad);
@ -379,9 +379,9 @@ gnl_operation_add_element (GstBin * bin, GstElement * element)
} }
static gboolean static gboolean
gnl_operation_remove_element (GstBin * bin, GstElement * element) nle_operation_remove_element (GstBin * bin, GstElement * element)
{ {
GnlOperation *operation = (GnlOperation *) bin; NleOperation *operation = (NleOperation *) bin;
gboolean res = FALSE; gboolean res = FALSE;
if (operation->element) { if (operation->element) {
@ -396,7 +396,7 @@ gnl_operation_remove_element (GstBin * bin, GstElement * element)
} }
static void static void
gnl_operation_set_sinks (GnlOperation * operation, guint sinks) nle_operation_set_sinks (NleOperation * operation, guint sinks)
{ {
/* FIXME : Check if sinkpad of element is on-demand .... */ /* FIXME : Check if sinkpad of element is on-demand .... */
@ -405,14 +405,14 @@ gnl_operation_set_sinks (GnlOperation * operation, guint sinks)
} }
static void static void
gnl_operation_set_property (GObject * object, guint prop_id, nle_operation_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
GnlOperation *operation = (GnlOperation *) object; NleOperation *operation = (NleOperation *) object;
switch (prop_id) { switch (prop_id) {
case ARG_SINKS: case ARG_SINKS:
gnl_operation_set_sinks (operation, g_value_get_int (value)); nle_operation_set_sinks (operation, g_value_get_int (value));
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -421,10 +421,10 @@ gnl_operation_set_property (GObject * object, guint prop_id,
} }
static void static void
gnl_operation_get_property (GObject * object, guint prop_id, nle_operation_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec) GValue * value, GParamSpec * pspec)
{ {
GnlOperation *operation = (GnlOperation *) object; NleOperation *operation = (NleOperation *) object;
switch (prop_id) { switch (prop_id) {
case ARG_SINKS: case ARG_SINKS:
@ -443,7 +443,7 @@ gnl_operation_get_property (GObject * object, guint prop_id,
* Returns NULL if there's no more unused sink pads. * Returns NULL if there's no more unused sink pads.
*/ */
static GstPad * static GstPad *
get_unused_static_sink_pad (GnlOperation * operation) get_unused_static_sink_pad (NleOperation * operation)
{ {
GstIterator *pads; GstIterator *pads;
gboolean done = FALSE; gboolean done = FALSE;
@ -513,7 +513,7 @@ get_unused_static_sink_pad (GnlOperation * operation)
} }
GstPad * GstPad *
get_unlinked_sink_ghost_pad (GnlOperation * operation) get_unlinked_sink_ghost_pad (NleOperation * operation)
{ {
GstIterator *pads; GstIterator *pads;
gboolean done = FALSE; gboolean done = FALSE;
@ -566,7 +566,7 @@ get_unlinked_sink_ghost_pad (GnlOperation * operation)
} }
static GstPad * static GstPad *
get_request_sink_pad (GnlOperation * operation) get_request_sink_pad (NleOperation * operation)
{ {
GstPad *pad = NULL; GstPad *pad = NULL;
GList *templates; GList *templates;
@ -597,7 +597,7 @@ get_request_sink_pad (GnlOperation * operation)
} }
static GstPad * static GstPad *
add_sink_pad (GnlOperation * operation) add_sink_pad (NleOperation * operation)
{ {
GstPad *gpad = NULL; GstPad *gpad = NULL;
GstPad *ret = NULL; GstPad *ret = NULL;
@ -614,7 +614,7 @@ add_sink_pad (GnlOperation * operation)
/* static sink pads */ /* static sink pads */
ret = get_unused_static_sink_pad (operation); ret = get_unused_static_sink_pad (operation);
if (ret) { if (ret) {
gpad = gnl_object_ghost_pad ((GnlObject *) operation, GST_PAD_NAME (ret), gpad = nle_object_ghost_pad ((NleObject *) operation, GST_PAD_NAME (ret),
ret); ret);
gst_object_unref (ret); gst_object_unref (ret);
} }
@ -624,7 +624,7 @@ add_sink_pad (GnlOperation * operation)
/* request sink pads */ /* request sink pads */
ret = get_request_sink_pad (operation); ret = get_request_sink_pad (operation);
if (ret) { if (ret) {
gpad = gnl_object_ghost_pad ((GnlObject *) operation, GST_PAD_NAME (ret), gpad = nle_object_ghost_pad ((NleObject *) operation, GST_PAD_NAME (ret),
ret); ret);
gst_object_unref (ret); gst_object_unref (ret);
} }
@ -643,7 +643,7 @@ add_sink_pad (GnlOperation * operation)
} }
static gboolean static gboolean
remove_sink_pad (GnlOperation * operation, GstPad * sinkpad) remove_sink_pad (NleOperation * operation, GstPad * sinkpad)
{ {
gboolean ret = TRUE; gboolean ret = TRUE;
@ -668,13 +668,13 @@ remove_sink_pad (GnlOperation * operation, GstPad * sinkpad)
if (target) { if (target) {
/* release the target pad */ /* release the target pad */
gnl_object_ghost_pad_set_target ((GnlObject *) operation, sinkpad, NULL); nle_object_ghost_pad_set_target ((NleObject *) operation, sinkpad, NULL);
if (operation->dynamicsinks) if (operation->dynamicsinks)
gst_element_release_request_pad (operation->element, target); gst_element_release_request_pad (operation->element, target);
gst_object_unref (target); gst_object_unref (target);
} }
operation->sinks = g_list_remove (operation->sinks, sinkpad); operation->sinks = g_list_remove (operation->sinks, sinkpad);
gnl_object_remove_ghost_pad ((GnlObject *) operation, sinkpad); nle_object_remove_ghost_pad ((NleObject *) operation, sinkpad);
operation->realsinks--; operation->realsinks--;
} }
@ -683,7 +683,7 @@ beach:
} }
static void static void
synchronize_sinks (GnlOperation * operation) synchronize_sinks (NleOperation * operation)
{ {
GST_DEBUG_OBJECT (operation, "num_sinks:%d , realsinks:%d, dynamicsinks:%d", GST_DEBUG_OBJECT (operation, "num_sinks:%d , realsinks:%d, dynamicsinks:%d",
@ -707,29 +707,29 @@ synchronize_sinks (GnlOperation * operation)
} }
static gboolean static gboolean
gnl_operation_prepare (GnlObject * object) nle_operation_prepare (NleObject * object)
{ {
/* Prepare the pads */ /* Prepare the pads */
synchronize_sinks ((GnlOperation *) object); synchronize_sinks ((NleOperation *) object);
return TRUE; return TRUE;
} }
static gboolean static gboolean
gnl_operation_cleanup (GnlObject * object) nle_operation_cleanup (NleObject * object)
{ {
GnlOperation *oper = (GnlOperation *) object; NleOperation *oper = (NleOperation *) object;
if (oper->dynamicsinks) { if (oper->dynamicsinks) {
GST_DEBUG ("Resetting dynamic sinks"); GST_DEBUG ("Resetting dynamic sinks");
gnl_operation_set_sinks (oper, 0); nle_operation_set_sinks (oper, 0);
} }
return TRUE; return TRUE;
} }
void void
gnl_operation_hard_cleanup (GnlOperation * operation) nle_operation_hard_cleanup (NleOperation * operation)
{ {
gboolean done = FALSE; gboolean done = FALSE;
@ -764,15 +764,15 @@ gnl_operation_hard_cleanup (GnlOperation * operation)
break; break;
} }
} }
gnl_object_cleanup (GNL_OBJECT (operation)); nle_object_cleanup (NLE_OBJECT (operation));
} }
static GstPad * static GstPad *
gnl_operation_request_new_pad (GstElement * element, GstPadTemplate * templ, nle_operation_request_new_pad (GstElement * element, GstPadTemplate * templ,
const gchar * name, const GstCaps * caps) const gchar * name, const GstCaps * caps)
{ {
GnlOperation *operation = (GnlOperation *) element; NleOperation *operation = (NleOperation *) element;
GstPad *ret; GstPad *ret;
GST_DEBUG ("template:%s name:%s", templ->name_template, name); GST_DEBUG ("template:%s name:%s", templ->name_template, name);
@ -784,34 +784,34 @@ gnl_operation_request_new_pad (GstElement * element, GstPadTemplate * templ,
return NULL; return NULL;
} }
ret = add_sink_pad ((GnlOperation *) element); ret = add_sink_pad ((NleOperation *) element);
return ret; return ret;
} }
static void static void
gnl_operation_release_pad (GstElement * element, GstPad * pad) nle_operation_release_pad (GstElement * element, GstPad * pad)
{ {
GST_DEBUG ("pad %s:%s", GST_DEBUG_PAD_NAME (pad)); GST_DEBUG ("pad %s:%s", GST_DEBUG_PAD_NAME (pad));
remove_sink_pad ((GnlOperation *) element, pad); remove_sink_pad ((NleOperation *) element, pad);
} }
void void
gnl_operation_signal_input_priority_changed (GnlOperation * operation, nle_operation_signal_input_priority_changed (NleOperation * operation,
GstPad * pad, guint32 priority) GstPad * pad, guint32 priority)
{ {
GST_DEBUG_OBJECT (operation, "pad:%s:%s, priority:%d", GST_DEBUG_OBJECT (operation, "pad:%s:%s, priority:%d",
GST_DEBUG_PAD_NAME (pad), priority); GST_DEBUG_PAD_NAME (pad), priority);
g_signal_emit (operation, gnl_operation_signals[INPUT_PRIORITY_CHANGED], g_signal_emit (operation, nle_operation_signals[INPUT_PRIORITY_CHANGED],
0, pad, priority); 0, pad, priority);
} }
void void
gnl_operation_update_base_time (GnlOperation * operation, nle_operation_update_base_time (NleOperation * operation,
GstClockTime timestamp) GstClockTime timestamp)
{ {
if (!gnl_object_to_media_time (GNL_OBJECT (operation), if (!nle_object_to_media_time (NLE_OBJECT (operation),
timestamp, &operation->next_base_time)) { timestamp, &operation->next_base_time)) {
GST_WARNING_OBJECT (operation, "Trying to set a basetime outside of " GST_WARNING_OBJECT (operation, "Trying to set a basetime outside of "
"ourself"); "ourself");

View file

@ -2,7 +2,7 @@
* Copyright (C) 2001 Wim Taymans <wim.taymans@chello.be> * Copyright (C) 2001 Wim Taymans <wim.taymans@chello.be>
* 2004 Edward Hervey <bilboed@bilboed.com> * 2004 Edward Hervey <bilboed@bilboed.com>
* *
* gnloperation.h: Header for base GnlOperation * nleoperation.h: Header for base NleOperation
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -21,26 +21,26 @@
*/ */
#ifndef __GNL_OPERATION_H__ #ifndef __NLE_OPERATION_H__
#define __GNL_OPERATION_H__ #define __NLE_OPERATION_H__
#include <gst/gst.h> #include <gst/gst.h>
#include "gnlobject.h" #include "nleobject.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define GNL_TYPE_OPERATION \ #define NLE_TYPE_OPERATION \
(gnl_operation_get_type()) (nle_operation_get_type())
#define GNL_OPERATION(obj) \ #define NLE_OPERATION(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GNL_TYPE_OPERATION,GnlOperation)) (G_TYPE_CHECK_INSTANCE_CAST((obj),NLE_TYPE_OPERATION,NleOperation))
#define GNL_OPERATION_CLASS(klass) \ #define NLE_OPERATION_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GNL_TYPE_OPERATION,GnlOperationClass)) (G_TYPE_CHECK_CLASS_CAST((klass),NLE_TYPE_OPERATION,NleOperationClass))
#define GNL_IS_OPERATION(obj) \ #define NLE_IS_OPERATION(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GNL_TYPE_OPERATION)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),NLE_TYPE_OPERATION))
#define GNL_IS_OPERATION_CLASS(obj) \ #define NLE_IS_OPERATION_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GNL_TYPE_OPERATION)) (G_TYPE_CHECK_CLASS_TYPE((klass),NLE_TYPE_OPERATION))
struct _GnlOperation struct _NleOperation
{ {
GnlObject parent; NleObject parent;
/* <private> */ /* <private> */
@ -64,27 +64,27 @@ G_BEGIN_DECLS
GstClockTime next_base_time; GstClockTime next_base_time;
}; };
struct _GnlOperationClass struct _NleOperationClass
{ {
GnlObjectClass parent_class; NleObjectClass parent_class;
void (*input_priority_changed) (GnlOperation * operation, GstPad *pad, guint32 priority); void (*input_priority_changed) (NleOperation * operation, GstPad *pad, guint32 priority);
}; };
GstPad * get_unlinked_sink_ghost_pad (GnlOperation * operation); GstPad * get_unlinked_sink_ghost_pad (NleOperation * operation);
void void
gnl_operation_signal_input_priority_changed(GnlOperation * operation, GstPad *pad, nle_operation_signal_input_priority_changed(NleOperation * operation, GstPad *pad,
guint32 priority); guint32 priority);
void gnl_operation_update_base_time (GnlOperation *operation, void nle_operation_update_base_time (NleOperation *operation,
GstClockTime timestamp); GstClockTime timestamp);
void gnl_operation_hard_cleanup (GnlOperation *operation); void nle_operation_hard_cleanup (NleOperation *operation);
/* normal GOperation stuff */ /* normal GOperation stuff */
GType gnl_operation_get_type (void); GType nle_operation_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GNL_OPERATION_H__ */ #endif /* __NLE_OPERATION_H__ */

View file

@ -23,30 +23,30 @@
#include "config.h" #include "config.h"
#endif #endif
#include "gnl.h" #include "nle.h"
/** /**
* SECTION:element-gnlsource * SECTION:element-nlesource
* *
* The GnlSource encapsulates a pipeline which produces data for processing * The NleSource encapsulates a pipeline which produces data for processing
* in a #GnlComposition. * in a #NleComposition.
*/ */
static GstStaticPadTemplate gnl_source_src_template = static GstStaticPadTemplate nle_source_src_template =
GST_STATIC_PAD_TEMPLATE ("src", GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY); GST_STATIC_CAPS_ANY);
GST_DEBUG_CATEGORY_STATIC (gnlsource); GST_DEBUG_CATEGORY_STATIC (nlesource);
#define GST_CAT_DEFAULT gnlsource #define GST_CAT_DEFAULT nlesource
#define _do_init \ #define _do_init \
GST_DEBUG_CATEGORY_INIT (gnlsource, "gnlsource", GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GNonLin Source Element"); GST_DEBUG_CATEGORY_INIT (nlesource, "nlesource", GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GNonLin Source Element");
#define gnl_source_parent_class parent_class #define nle_source_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GnlSource, gnl_source, GNL_TYPE_OBJECT, _do_init); G_DEFINE_TYPE_WITH_CODE (NleSource, nle_source, NLE_TYPE_OBJECT, _do_init);
struct _GnlSourcePrivate struct _NleSourcePrivate
{ {
gboolean dispose_has_run; gboolean dispose_has_run;
@ -60,69 +60,69 @@ struct _GnlSourcePrivate
GstPad *staticpad; /* The only pad. We keep an extra ref */ GstPad *staticpad; /* The only pad. We keep an extra ref */
}; };
static gboolean gnl_source_prepare (GnlObject * object); static gboolean nle_source_prepare (NleObject * object);
static gboolean gnl_source_add_element (GstBin * bin, GstElement * element); static gboolean nle_source_add_element (GstBin * bin, GstElement * element);
static gboolean gnl_source_remove_element (GstBin * bin, GstElement * element); static gboolean nle_source_remove_element (GstBin * bin, GstElement * element);
static void gnl_source_dispose (GObject * object); static void nle_source_dispose (GObject * object);
static gboolean static gboolean
gnl_source_control_element_func (GnlSource * source, GstElement * element); nle_source_control_element_func (NleSource * source, GstElement * element);
static void static void
gnl_source_class_init (GnlSourceClass * klass) nle_source_class_init (NleSourceClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
GstBinClass *gstbin_class; GstBinClass *gstbin_class;
GnlObjectClass *gnlobject_class; NleObjectClass *nleobject_class;
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gstbin_class = (GstBinClass *) klass; gstbin_class = (GstBinClass *) klass;
gnlobject_class = (GnlObjectClass *) klass; nleobject_class = (NleObjectClass *) klass;
g_type_class_add_private (klass, sizeof (GnlSourcePrivate)); g_type_class_add_private (klass, sizeof (NleSourcePrivate));
gst_element_class_set_static_metadata (gstelement_class, "GNonLin Source", gst_element_class_set_static_metadata (gstelement_class, "GNonLin Source",
"Filter/Editor", "Filter/Editor",
"Manages source elements", "Manages source elements",
"Wim Taymans <wim.taymans@gmail.com>, Edward Hervey <bilboed@bilboed.com>"); "Wim Taymans <wim.taymans@gmail.com>, Edward Hervey <bilboed@bilboed.com>");
parent_class = g_type_class_ref (GNL_TYPE_OBJECT); parent_class = g_type_class_ref (NLE_TYPE_OBJECT);
klass->control_element = GST_DEBUG_FUNCPTR (gnl_source_control_element_func); klass->control_element = GST_DEBUG_FUNCPTR (nle_source_control_element_func);
gnlobject_class->prepare = GST_DEBUG_FUNCPTR (gnl_source_prepare); nleobject_class->prepare = GST_DEBUG_FUNCPTR (nle_source_prepare);
gstbin_class->add_element = GST_DEBUG_FUNCPTR (gnl_source_add_element); gstbin_class->add_element = GST_DEBUG_FUNCPTR (nle_source_add_element);
gstbin_class->remove_element = GST_DEBUG_FUNCPTR (gnl_source_remove_element); gstbin_class->remove_element = GST_DEBUG_FUNCPTR (nle_source_remove_element);
gobject_class->dispose = GST_DEBUG_FUNCPTR (gnl_source_dispose); gobject_class->dispose = GST_DEBUG_FUNCPTR (nle_source_dispose);
gst_element_class_add_pad_template (gstelement_class, gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gnl_source_src_template)); gst_static_pad_template_get (&nle_source_src_template));
} }
static void static void
gnl_source_init (GnlSource * source) nle_source_init (NleSource * source)
{ {
GST_OBJECT_FLAG_SET (source, GNL_OBJECT_SOURCE); GST_OBJECT_FLAG_SET (source, NLE_OBJECT_SOURCE);
source->element = NULL; source->element = NULL;
source->priv = source->priv =
G_TYPE_INSTANCE_GET_PRIVATE (source, GNL_TYPE_SOURCE, GnlSourcePrivate); G_TYPE_INSTANCE_GET_PRIVATE (source, NLE_TYPE_SOURCE, NleSourcePrivate);
GST_DEBUG_OBJECT (source, "Setting GstBin async-handling to TRUE"); GST_DEBUG_OBJECT (source, "Setting GstBin async-handling to TRUE");
g_object_set (G_OBJECT (source), "async-handling", TRUE, NULL); g_object_set (G_OBJECT (source), "async-handling", TRUE, NULL);
} }
static void static void
gnl_source_dispose (GObject * object) nle_source_dispose (GObject * object)
{ {
GnlObject *gnlobject = (GnlObject *) object; NleObject *nleobject = (NleObject *) object;
GnlSource *source = (GnlSource *) object; NleSource *source = (NleSource *) object;
GnlSourcePrivate *priv = source->priv; NleSourcePrivate *priv = source->priv;
GST_DEBUG_OBJECT (object, "dispose"); GST_DEBUG_OBJECT (object, "dispose");
@ -136,7 +136,7 @@ gnl_source_dispose (GObject * object)
priv->dispose_has_run = TRUE; priv->dispose_has_run = TRUE;
if (priv->ghostedpad) if (priv->ghostedpad)
gnl_object_ghost_pad_set_target (gnlobject, gnlobject->srcpad, NULL); nle_object_ghost_pad_set_target (nleobject, nleobject->srcpad, NULL);
if (priv->staticpad) { if (priv->staticpad) {
gst_object_unref (priv->staticpad); gst_object_unref (priv->staticpad);
@ -148,11 +148,11 @@ gnl_source_dispose (GObject * object)
static void static void
element_pad_added_cb (GstElement * element G_GNUC_UNUSED, GstPad * pad, element_pad_added_cb (GstElement * element G_GNUC_UNUSED, GstPad * pad,
GnlSource * source) NleSource * source)
{ {
GstCaps *srccaps; GstCaps *srccaps;
GnlSourcePrivate *priv = source->priv; NleSourcePrivate *priv = source->priv;
GnlObject *gnlobject = (GnlObject *) source; NleObject *nleobject = (NleObject *) source;
GST_DEBUG_OBJECT (source, "pad %s:%s", GST_DEBUG_PAD_NAME (pad)); GST_DEBUG_OBJECT (source, "pad %s:%s", GST_DEBUG_PAD_NAME (pad));
@ -166,7 +166,7 @@ element_pad_added_cb (GstElement * element G_GNUC_UNUSED, GstPad * pad,
/* FIXME: pass filter caps to query_caps directly */ /* FIXME: pass filter caps to query_caps directly */
srccaps = gst_pad_query_caps (pad, NULL); srccaps = gst_pad_query_caps (pad, NULL);
if (gnlobject->caps && !gst_caps_can_intersect (srccaps, gnlobject->caps)) { if (nleobject->caps && !gst_caps_can_intersect (srccaps, nleobject->caps)) {
gst_caps_unref (srccaps); gst_caps_unref (srccaps);
GST_DEBUG_OBJECT (source, "Pad doesn't have valid caps, ignoring"); GST_DEBUG_OBJECT (source, "Pad doesn't have valid caps, ignoring");
return; return;
@ -174,8 +174,8 @@ element_pad_added_cb (GstElement * element G_GNUC_UNUSED, GstPad * pad,
gst_caps_unref (srccaps); gst_caps_unref (srccaps);
priv->ghostedpad = pad; priv->ghostedpad = pad;
GST_DEBUG_OBJECT (gnlobject, "SET target %" GST_PTR_FORMAT, pad); GST_DEBUG_OBJECT (nleobject, "SET target %" GST_PTR_FORMAT, pad);
gnl_object_ghost_pad_set_target (gnlobject, gnlobject->srcpad, pad); nle_object_ghost_pad_set_target (nleobject, nleobject->srcpad, pad);
GST_DEBUG_OBJECT (source, "Using pad pad %s:%s as a target now!", GST_DEBUG_OBJECT (source, "Using pad pad %s:%s as a target now!",
GST_DEBUG_PAD_NAME (pad)); GST_DEBUG_PAD_NAME (pad));
@ -183,10 +183,10 @@ element_pad_added_cb (GstElement * element G_GNUC_UNUSED, GstPad * pad,
static void static void
element_pad_removed_cb (GstElement * element G_GNUC_UNUSED, GstPad * pad, element_pad_removed_cb (GstElement * element G_GNUC_UNUSED, GstPad * pad,
GnlSource * source) NleSource * source)
{ {
GnlSourcePrivate *priv = source->priv; NleSourcePrivate *priv = source->priv;
GnlObject *gnlobject = (GnlObject *) source; NleObject *nleobject = (NleObject *) source;
GST_DEBUG_OBJECT (source, "pad %s:%s (controlled pad %s:%s)", GST_DEBUG_OBJECT (source, "pad %s:%s (controlled pad %s:%s)",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_PAD_NAME (priv->ghostedpad)); GST_DEBUG_PAD_NAME (pad), GST_DEBUG_PAD_NAME (priv->ghostedpad));
@ -197,7 +197,7 @@ element_pad_removed_cb (GstElement * element G_GNUC_UNUSED, GstPad * pad,
GST_DEBUG_OBJECT (source, "Clearing up ghostpad"); GST_DEBUG_OBJECT (source, "Clearing up ghostpad");
gnl_object_ghost_pad_set_target (GNL_OBJECT (source), gnlobject->srcpad, nle_object_ghost_pad_set_target (NLE_OBJECT (source), nleobject->srcpad,
NULL); NULL);
priv->ghostedpad = NULL; priv->ghostedpad = NULL;
} else { } else {
@ -228,12 +228,12 @@ compare_src_pad (GValue * item, GstCaps * caps)
/* /*
get_valid_src_pad get_valid_src_pad
Returns True if there's a src pad compatible with the GnlObject caps in the Returns True if there's a src pad compatible with the NleObject caps in the
given element. Fills in pad if so. The returned pad has an incremented refcount given element. Fills in pad if so. The returned pad has an incremented refcount
*/ */
static gboolean static gboolean
get_valid_src_pad (GnlSource * source, GstElement * element, GstPad ** pad) get_valid_src_pad (NleSource * source, GstElement * element, GstPad ** pad)
{ {
gboolean res = FALSE; gboolean res = FALSE;
GstIterator *srcpads; GstIterator *srcpads;
@ -243,7 +243,7 @@ get_valid_src_pad (GnlSource * source, GstElement * element, GstPad ** pad)
srcpads = gst_element_iterate_src_pads (element); srcpads = gst_element_iterate_src_pads (element);
if (gst_iterator_find_custom (srcpads, (GCompareFunc) compare_src_pad, &item, if (gst_iterator_find_custom (srcpads, (GCompareFunc) compare_src_pad, &item,
GNL_OBJECT (source)->caps)) { NLE_OBJECT (source)->caps)) {
*pad = g_value_get_object (&item); *pad = g_value_get_object (&item);
gst_object_ref (*pad); gst_object_ref (*pad);
g_value_reset (&item); g_value_reset (&item);
@ -285,9 +285,9 @@ has_dynamic_srcpads (GstElement * element)
} }
static gboolean static gboolean
gnl_source_control_element_func (GnlSource * source, GstElement * element) nle_source_control_element_func (NleSource * source, GstElement * element)
{ {
GnlSourcePrivate *priv = source->priv; NleSourcePrivate *priv = source->priv;
GstPad *pad = NULL; GstPad *pad = NULL;
g_return_val_if_fail (source->element == NULL, FALSE); g_return_val_if_fail (source->element == NULL, FALSE);
@ -300,8 +300,8 @@ gnl_source_control_element_func (GnlSource * source, GstElement * element)
if (get_valid_src_pad (source, source->element, &pad)) { if (get_valid_src_pad (source, source->element, &pad)) {
priv->staticpad = pad; priv->staticpad = pad;
gnl_object_ghost_pad_set_target (GNL_OBJECT (source), nle_object_ghost_pad_set_target (NLE_OBJECT (source),
GNL_OBJECT_SRC (source), pad); NLE_OBJECT_SRC (source), pad);
priv->dynamicpads = FALSE; priv->dynamicpads = FALSE;
} else { } else {
priv->dynamicpads = has_dynamic_srcpads (element); priv->dynamicpads = has_dynamic_srcpads (element);
@ -322,15 +322,15 @@ gnl_source_control_element_func (GnlSource * source, GstElement * element)
} }
static gboolean static gboolean
gnl_source_add_element (GstBin * bin, GstElement * element) nle_source_add_element (GstBin * bin, GstElement * element)
{ {
GnlSource *source = (GnlSource *) bin; NleSource *source = (NleSource *) bin;
gboolean pret; gboolean pret;
GST_DEBUG_OBJECT (source, "Adding element %s", GST_ELEMENT_NAME (element)); GST_DEBUG_OBJECT (source, "Adding element %s", GST_ELEMENT_NAME (element));
if (source->element) { if (source->element) {
GST_WARNING_OBJECT (bin, "GnlSource can only handle one element at a time"); GST_WARNING_OBJECT (bin, "NleSource can only handle one element at a time");
return FALSE; return FALSE;
} }
@ -338,17 +338,17 @@ gnl_source_add_element (GstBin * bin, GstElement * element)
pret = GST_BIN_CLASS (parent_class)->add_element (bin, element); pret = GST_BIN_CLASS (parent_class)->add_element (bin, element);
if (pret) { if (pret) {
gnl_source_control_element_func (source, element); nle_source_control_element_func (source, element);
} }
return pret; return pret;
} }
static gboolean static gboolean
gnl_source_remove_element (GstBin * bin, GstElement * element) nle_source_remove_element (GstBin * bin, GstElement * element)
{ {
GnlSource *source = (GnlSource *) bin; NleSource *source = (NleSource *) bin;
GnlObject *gnlobject = (GnlObject *) element; NleObject *nleobject = (NleObject *) element;
GnlSourcePrivate *priv = source->priv; NleSourcePrivate *priv = source->priv;
gboolean pret; gboolean pret;
GST_DEBUG_OBJECT (source, "Removing element %s", GST_ELEMENT_NAME (element)); GST_DEBUG_OBJECT (source, "Removing element %s", GST_ELEMENT_NAME (element));
@ -361,7 +361,7 @@ gnl_source_remove_element (GstBin * bin, GstElement * element)
} }
if (pret) { if (pret) {
gnl_object_ghost_pad_set_target (GNL_OBJECT (source), gnlobject->srcpad, nle_object_ghost_pad_set_target (NLE_OBJECT (source), nleobject->srcpad,
NULL); NULL);
/* remove signal handlers */ /* remove signal handlers */
@ -382,17 +382,17 @@ gnl_source_remove_element (GstBin * bin, GstElement * element)
} }
static gboolean static gboolean
gnl_source_prepare (GnlObject * object) nle_source_prepare (NleObject * object)
{ {
GstPad *pad; GstPad *pad;
GnlSource *source = GNL_SOURCE (object); NleSource *source = NLE_SOURCE (object);
GnlSourcePrivate *priv = source->priv; NleSourcePrivate *priv = source->priv;
GstElement *parent = GstElement *parent =
(GstElement *) gst_element_get_parent ((GstElement *) object); (GstElement *) gst_element_get_parent ((GstElement *) object);
if (!source->element) { if (!source->element) {
GST_WARNING_OBJECT (source, GST_WARNING_OBJECT (source,
"GnlSource doesn't have an element to control !"); "NleSource doesn't have an element to control !");
if (parent) if (parent)
gst_object_unref (parent); gst_object_unref (parent);
return FALSE; return FALSE;

View file

@ -2,7 +2,7 @@
* Copyright (C) 2001 Wim Taymans <wim.taymans@gmail.com> * Copyright (C) 2001 Wim Taymans <wim.taymans@gmail.com>
* 2004-2008 Edward Hervey <bilboed@bilboed.com> * 2004-2008 Edward Hervey <bilboed@bilboed.com>
* *
* gnlsource.h: Header for base GnlSource * nlesource.h: Header for base NleSource
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -21,46 +21,46 @@
*/ */
#ifndef __GNL_SOURCE_H__ #ifndef __NLE_SOURCE_H__
#define __GNL_SOURCE_H__ #define __NLE_SOURCE_H__
#include <gst/gst.h> #include <gst/gst.h>
#include "gnlobject.h" #include "nleobject.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define GNL_TYPE_SOURCE \ #define NLE_TYPE_SOURCE \
(gnl_source_get_type()) (nle_source_get_type())
#define GNL_SOURCE(obj) \ #define NLE_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GNL_TYPE_SOURCE,GnlSource)) (G_TYPE_CHECK_INSTANCE_CAST((obj),NLE_TYPE_SOURCE,NleSource))
#define GNL_SOURCE_CLASS(klass) \ #define NLE_SOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GNL_TYPE_SOURCE,GnlSourceClass)) (G_TYPE_CHECK_CLASS_CAST((klass),NLE_TYPE_SOURCE,NleSourceClass))
#define GNL_SOURCE_GET_CLASS(obj) \ #define NLE_SOURCE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GNL_TYPE_SOURCE, GnlSourceClass)) (G_TYPE_INSTANCE_GET_CLASS ((obj), NLE_TYPE_SOURCE, NleSourceClass))
#define GNL_IS_SOURCE(obj) \ #define NLE_IS_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GNL_TYPE_SOURCE)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),NLE_TYPE_SOURCE))
#define GNL_IS_SOURCE_CLASS(obj) \ #define NLE_IS_SOURCE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GNL_TYPE_SOURCE)) (G_TYPE_CHECK_CLASS_TYPE((klass),NLE_TYPE_SOURCE))
typedef struct _GnlSourcePrivate GnlSourcePrivate; typedef struct _NleSourcePrivate NleSourcePrivate;
struct _GnlSource struct _NleSource
{ {
GnlObject parent; NleObject parent;
/* controlled source element, acces with gst_bin_[add|remove]_element */ /* controlled source element, acces with gst_bin_[add|remove]_element */
GstElement *element; GstElement *element;
GnlSourcePrivate *priv; NleSourcePrivate *priv;
}; };
struct _GnlSourceClass struct _NleSourceClass
{ {
GnlObjectClass parent_class; NleObjectClass parent_class;
/* control_element() takes care of controlling the given element */ /* control_element() takes care of controlling the given element */
gboolean (*control_element) (GnlSource * source, GstElement * element); gboolean (*control_element) (NleSource * source, GstElement * element);
}; };
GType gnl_source_get_type (void); GType nle_source_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GNL_SOURCE_H__ */ #endif /* __NLE_SOURCE_H__ */

View file

@ -1,7 +1,7 @@
/* GStreamer /* GStreamer
* Copyright (C) 2004 Edward Hervey <bilboed@bilboed.com> * Copyright (C) 2004 Edward Hervey <bilboed@bilboed.com>
* *
* gnltypes.h: Header for class definition * nletypes.h: Header for class definition
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -19,24 +19,24 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef __GNL_TYPES_H__ #ifndef __NLE_TYPES_H__
#define __GNL_TYPES_H__ #define __NLE_TYPES_H__
#include <glib.h> #include <glib.h>
typedef struct _GnlObject GnlObject; typedef struct _NleObject NleObject;
typedef struct _GnlObjectClass GnlObjectClass; typedef struct _NleObjectClass NleObjectClass;
typedef struct _GnlComposition GnlComposition; typedef struct _NleComposition NleComposition;
typedef struct _GnlCompositionClass GnlCompositionClass; typedef struct _NleCompositionClass NleCompositionClass;
typedef struct _GnlOperation GnlOperation; typedef struct _NleOperation NleOperation;
typedef struct _GnlOperationClass GnlOperationClass; typedef struct _NleOperationClass NleOperationClass;
typedef struct _GnlSource GnlSource; typedef struct _NleSource NleSource;
typedef struct _GnlSourceClass GnlSourceClass; typedef struct _NleSourceClass NleSourceClass;
typedef struct _GnlURISource GnlURISource; typedef struct _NleURISource NleURISource;
typedef struct _GnlURISourceClass GnlURISourceClass; typedef struct _NleURISourceClass NleURISourceClass;
#endif #endif

View file

@ -22,30 +22,30 @@
#include "config.h" #include "config.h"
#endif #endif
#include "gnl.h" #include "nle.h"
#include "gnlurisource.h" #include "nleurisource.h"
/** /**
* SECTION:element-gnlurisource * SECTION:element-nleurisource
* *
* GnlURISource is a #GnlSource which reads and decodes the contents * NleURISource is a #NleSource which reads and decodes the contents
* of a given file. The data in the file is decoded using any available * of a given file. The data in the file is decoded using any available
* GStreamer plugins. * GStreamer plugins.
*/ */
static GstStaticPadTemplate gnl_urisource_src_template = static GstStaticPadTemplate nle_urisource_src_template =
GST_STATIC_PAD_TEMPLATE ("src", GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_SOMETIMES, GST_PAD_SOMETIMES,
GST_STATIC_CAPS_ANY); GST_STATIC_CAPS_ANY);
GST_DEBUG_CATEGORY_STATIC (gnlurisource); GST_DEBUG_CATEGORY_STATIC (nleurisource);
#define GST_CAT_DEFAULT gnlurisource #define GST_CAT_DEFAULT nleurisource
#define _do_init \ #define _do_init \
GST_DEBUG_CATEGORY_INIT (gnlurisource, "gnlurisource", GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GNonLin URI Source Element"); GST_DEBUG_CATEGORY_INIT (nleurisource, "nleurisource", GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GNonLin URI Source Element");
#define gnl_urisource_parent_class parent_class #define nle_urisource_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GnlURISource, gnl_urisource, GNL_TYPE_SOURCE, G_DEFINE_TYPE_WITH_CODE (NleURISource, nle_urisource, NLE_TYPE_SOURCE,
_do_init); _do_init);
enum enum
@ -54,51 +54,51 @@ enum
ARG_URI, ARG_URI,
}; };
static gboolean gnl_urisource_prepare (GnlObject * object); static gboolean nle_urisource_prepare (NleObject * object);
static void static void
gnl_urisource_set_property (GObject * object, guint prop_id, nle_urisource_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
static void static void
gnl_urisource_get_property (GObject * object, guint prop_id, nle_urisource_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
static void static void
gnl_urisource_class_init (GnlURISourceClass * klass) nle_urisource_class_init (NleURISourceClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GnlObjectClass *gnlobject_class; NleObjectClass *nleobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gnlobject_class = (GnlObjectClass *) klass; nleobject_class = (NleObjectClass *) klass;
parent_class = g_type_class_ref (GNL_TYPE_SOURCE); parent_class = g_type_class_ref (NLE_TYPE_SOURCE);
gst_element_class_set_static_metadata (gstelement_class, "GNonLin URI Source", gst_element_class_set_static_metadata (gstelement_class, "GNonLin URI Source",
"Filter/Editor", "Filter/Editor",
"High-level URI Source element", "Edward Hervey <bilboed@bilboed.com>"); "High-level URI Source element", "Edward Hervey <bilboed@bilboed.com>");
gobject_class->set_property = GST_DEBUG_FUNCPTR (gnl_urisource_set_property); gobject_class->set_property = GST_DEBUG_FUNCPTR (nle_urisource_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gnl_urisource_get_property); gobject_class->get_property = GST_DEBUG_FUNCPTR (nle_urisource_get_property);
g_object_class_install_property (gobject_class, ARG_URI, g_object_class_install_property (gobject_class, ARG_URI,
g_param_spec_string ("uri", "Uri", g_param_spec_string ("uri", "Uri",
"Uri of the file to use", NULL, G_PARAM_READWRITE)); "Uri of the file to use", NULL, G_PARAM_READWRITE));
gst_element_class_add_pad_template (gstelement_class, gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gnl_urisource_src_template)); gst_static_pad_template_get (&nle_urisource_src_template));
gnlobject_class->prepare = gnl_urisource_prepare; nleobject_class->prepare = nle_urisource_prepare;
} }
static void static void
gnl_urisource_init (GnlURISource * urisource) nle_urisource_init (NleURISource * urisource)
{ {
GstElement *decodebin = NULL; GstElement *decodebin = NULL;
GST_OBJECT_FLAG_SET (urisource, GNL_OBJECT_SOURCE); GST_OBJECT_FLAG_SET (urisource, NLE_OBJECT_SOURCE);
/* We create a bin with source and decodebin within */ /* We create a bin with source and decodebin within */
decodebin = decodebin =
@ -109,20 +109,20 @@ gnl_urisource_init (GnlURISource * urisource)
} }
static inline void static inline void
gnl_urisource_set_uri (GnlURISource * fs, const gchar * uri) nle_urisource_set_uri (NleURISource * fs, const gchar * uri)
{ {
g_object_set (GNL_SOURCE (fs)->element, "uri", uri, NULL); g_object_set (NLE_SOURCE (fs)->element, "uri", uri, NULL);
} }
static void static void
gnl_urisource_set_property (GObject * object, guint prop_id, nle_urisource_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
GnlURISource *fs = (GnlURISource *) object; NleURISource *fs = (NleURISource *) object;
switch (prop_id) { switch (prop_id) {
case ARG_URI: case ARG_URI:
gnl_urisource_set_uri (fs, g_value_get_string (value)); nle_urisource_set_uri (fs, g_value_get_string (value));
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -131,14 +131,14 @@ gnl_urisource_set_property (GObject * object, guint prop_id,
} }
static void static void
gnl_urisource_get_property (GObject * object, guint prop_id, nle_urisource_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec) GValue * value, GParamSpec * pspec)
{ {
GnlURISource *fs = (GnlURISource *) object; NleURISource *fs = (NleURISource *) object;
switch (prop_id) { switch (prop_id) {
case ARG_URI: case ARG_URI:
g_object_get_property ((GObject *) GNL_SOURCE (fs)->element, "uri", g_object_get_property ((GObject *) NLE_SOURCE (fs)->element, "uri",
value); value);
break; break;
default: default:
@ -149,9 +149,9 @@ gnl_urisource_get_property (GObject * object, guint prop_id,
} }
static gboolean static gboolean
gnl_urisource_prepare (GnlObject * object) nle_urisource_prepare (NleObject * object)
{ {
GnlSource *fs = (GnlSource *) object; NleSource *fs = (NleSource *) object;
GST_DEBUG ("prepare"); GST_DEBUG ("prepare");
@ -162,5 +162,5 @@ gnl_urisource_prepare (GnlObject * object)
g_object_set (fs->element, "caps", object->caps, NULL); g_object_set (fs->element, "caps", object->caps, NULL);
} }
return GNL_OBJECT_CLASS (parent_class)->prepare (object); return NLE_OBJECT_CLASS (parent_class)->prepare (object);
} }

View file

@ -2,7 +2,7 @@
* Copyright (C) 2001 Wim Taymans <wim.taymans@gmail.com> * Copyright (C) 2001 Wim Taymans <wim.taymans@gmail.com>
* 2004-2008 Edward Hervey <bilboed@bilboed.com> * 2004-2008 Edward Hervey <bilboed@bilboed.com>
* *
* gnlurisource.h: Header for GnlURISource * nleurisource.h: Header for NleURISource
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -21,37 +21,37 @@
*/ */
#ifndef __GNL_URI_SOURCE_H__ #ifndef __NLE_URI_SOURCE_H__
#define __GNL_URI_SOURCE_H__ #define __NLE_URI_SOURCE_H__
#include <gst/gst.h> #include <gst/gst.h>
#include "gnlsource.h" #include "nlesource.h"
G_BEGIN_DECLS G_BEGIN_DECLS
#define GNL_TYPE_URI_SOURCE \ #define NLE_TYPE_URI_SOURCE \
(gnl_urisource_get_type()) (nle_urisource_get_type())
#define GNL_URI_SOURCE(obj) \ #define NLE_URI_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GNL_TYPE_URI_SOURCE,GnlURIsource)) (G_TYPE_CHECK_INSTANCE_CAST((obj),NLE_TYPE_URI_SOURCE,NleURIsource))
#define GNL_URI_SOURCE_CLASS(klass) \ #define NLE_URI_SOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GNL_TYPE_URI_SOURCE,GnlURIsourceClass)) (G_TYPE_CHECK_CLASS_CAST((klass),NLE_TYPE_URI_SOURCE,NleURIsourceClass))
#define GNL_IS_URI_SOURCE(obj) \ #define NLE_IS_URI_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GNL_TYPE_URI_SOURCE)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),NLE_TYPE_URI_SOURCE))
#define GNL_IS_URI_SOURCE_CLASS(obj) \ #define NLE_IS_URI_SOURCE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GNL_TYPE_URI_SOURCE)) (G_TYPE_CHECK_CLASS_TYPE((klass),NLE_TYPE_URI_SOURCE))
struct _GnlURISource struct _NleURISource
{ {
GnlSource parent; NleSource parent;
gchar *uri; gchar *uri;
}; };
struct _GnlURISourceClass struct _NleURISourceClass
{ {
GnlSourceClass parent_class; NleSourceClass parent_class;
}; };
GType gnl_urisource_get_type (void); GType nle_urisource_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GNL_URI_SOURCE_H__ */ #endif /* __NLE_URI_SOURCE_H__ */

View file

@ -1,46 +0,0 @@
plugin_LTLIBRARIES = libgnl.la
libgnl_la_SOURCES = \
gnl.c \
gnlobject.c \
gnlcomposition.c \
gnlghostpad.c \
gnloperation.c \
gnlsource.c \
gnlurisource.c
libgnl_la_CFLAGS = $(GST_CFLAGS)
libgnl_la_LIBADD = $(GST_LIBS)
libgnl_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgnl_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
gnl_headers = \
gnl.h \
gnlobject.h \
gnlcomposition.h \
gnltypes.h \
gnlghostpad.h \
gnloperation.h \
gnlsource.h \
gnltypes.h \
gnlurisource.h
DISTCLEANFILE = $(CLEANFILES)
#files built on make all/check/instal
BUILT_SOURCES = $(built_header_configure)
noinst_HEADERS = $(gnl_headers) $(built_header_configure)
Android.mk: Makefile.am $(BUILT_SOURCES)
androgenizer \
-:PROJECT libgnl -:SHARED libgnl \
-:TAGS eng debug \
-:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
-:SOURCES $(libgnl_la_SOURCES) \
-:CFLAGS $(DEFS) $(DEFAULT_INCLUDES) $(libgnl_la_CFLAGS) \
-:LDFLAGS $(libgnl_la_LDFLAGS) \
$(libgnl_la_LIBADD) \
-ldl \
-:PASSTHROUGH LOCAL_ARM_MODE:=arm \
LOCAL_MODULE_PATH:='$$(TARGET_OUT)/lib/gstreamer-@GST_API_VERSION@' \
> $@

View file

@ -1,60 +0,0 @@
/* Gnonlin
* Copyright (C) <2001> Wim Taymans <wim.taymans@gmail.com>
* <2004-2008> Edward Hervey <bilboed@bilboed.com>
*
* 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 "gnl.h"
struct _elements_entry
{
const gchar *name;
GType (*type) (void);
};
static struct _elements_entry _elements[] = {
{"gnlsource", gnl_source_get_type},
{"gnlcomposition", gnl_composition_get_type},
{"gnloperation", gnl_operation_get_type},
{"gnlurisource", gnl_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;
gnl_init_ghostpad_category ();
return TRUE;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
gnonlin,
"Standard elements for non-linear multimedia editing",
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);

View file

@ -1,170 +0,0 @@
/* GStreamer
* Copyright (C) 2001 Wim Taymans <wim.taymans@gmail.com>
* 2004-2008 Edward Hervey <bilboed@bilboed.com>
*
* gnlobject.h: Header for base GnlObject
*
* 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.
*/
#ifndef __GNL_OBJECT_H__
#define __GNL_OBJECT_H__
#include <gst/gst.h>
#include "gnltypes.h"
G_BEGIN_DECLS
#define GNL_TYPE_OBJECT \
(gnl_object_get_type())
#define GNL_OBJECT(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GNL_TYPE_OBJECT,GnlObject))
#define GNL_OBJECT_CAST(obj) ((GnlObject*) (obj))
#define GNL_OBJECT_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GNL_TYPE_OBJECT,GnlObjectClass))
#define GNL_OBJECT_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GNL_TYPE_OBJECT, GnlObjectClass))
#define GNL_IS_OBJECT(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GNL_TYPE_OBJECT))
#define GNL_IS_OBJECT_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GNL_TYPE_OBJECT))
#define GNL_OBJECT_SRC(obj) (((GnlObject *) obj)->srcpad)
/**
* GnlObjectFlags:
* @GNL_OBJECT_IS_SOURCE:
* @GNL_OBJECT_IS_OPERATION:
* @GNL_OBJECT_IS_EXPANDABLE: The #GnlObject start/stop will extend accross the full composition.
* @GNL_OBJECT_LAST_FLAG:
*/
typedef enum
{
GNL_OBJECT_SOURCE = (GST_BIN_FLAG_LAST << 0),
GNL_OBJECT_OPERATION = (GST_BIN_FLAG_LAST << 1),
GNL_OBJECT_EXPANDABLE = (GST_BIN_FLAG_LAST << 2),
GNL_OBJECT_COMPOSITION = (GST_BIN_FLAG_LAST << 3),
/* padding */
GNL_OBJECT_LAST_FLAG = (GST_BIN_FLAG_LAST << 5)
} GnlObjectFlags;
#define GNL_OBJECT_IS_SOURCE(obj) \
(GST_OBJECT_FLAG_IS_SET(obj, GNL_OBJECT_SOURCE))
#define GNL_OBJECT_IS_OPERATION(obj) \
(GST_OBJECT_FLAG_IS_SET(obj, GNL_OBJECT_OPERATION))
#define GNL_OBJECT_IS_EXPANDABLE(obj) \
(GST_OBJECT_FLAG_IS_SET(obj, GNL_OBJECT_EXPANDABLE))
#define GNL_OBJECT_IS_COMPOSITION(obj) \
(GST_OBJECT_FLAG_IS_SET(obj, GNL_OBJECT_COMPOSITION))
/* For internal usage only */
#define GNL_OBJECT_START(obj) (GNL_OBJECT_CAST (obj)->start)
#define GNL_OBJECT_STOP(obj) (GNL_OBJECT_CAST (obj)->stop)
#define GNL_OBJECT_DURATION(obj) (GNL_OBJECT_CAST (obj)->duration)
#define GNL_OBJECT_INPOINT(obj) (GNL_OBJECT_CAST (obj)->inpoint)
#define GNL_OBJECT_PRIORITY(obj) (GNL_OBJECT_CAST (obj)->priority)
#define GNL_OBJECT_IS_COMMITING(obj) (GNL_OBJECT_CAST (obj)->commiting)
struct _GnlObject
{
GstBin parent;
GstPad *srcpad;
/* Time positionning */
GstClockTime start;
GstClockTime inpoint;
GstClockTimeDiff duration;
/* Pending time positionning
* Should be == GST_CLOCK_TIME_NONE when nothing to do
*/
GstClockTime pending_start;
GstClockTime pending_inpoint;
GstClockTimeDiff pending_duration;
guint32 pending_priority;
gboolean pending_active;
gboolean commit_needed;
gboolean commiting; /* Set to TRUE during the commiting time only */
gboolean expandable;
/* read-only */
GstClockTime stop;
/* priority in parent */
guint32 priority;
/* active in parent */
gboolean active;
/* Filtering caps */
GstCaps *caps;
/* current segment seek <RO> */
gdouble segment_rate;
GstSeekFlags segment_flags;
gint64 segment_start;
gint64 segment_stop;
gboolean in_composition;
};
struct _GnlObjectClass
{
GstBinClass parent_class;
/* Signal method handler */
gboolean (*commit_signal_handler) (GnlObject * object, gboolean recurse);
/* virtual methods for subclasses */
gboolean (*prepare) (GnlObject * object);
gboolean (*cleanup) (GnlObject * object);
gboolean (*commit) (GnlObject * object, gboolean recurse);
};
GType gnl_object_get_type (void);
gboolean
gnl_object_to_media_time (GnlObject * object, GstClockTime otime,
GstClockTime * mtime);
gboolean
gnl_media_to_object_time (GnlObject * object, GstClockTime mtime,
GstClockTime * otime);
void
gnl_object_set_caps (GnlObject * object, const GstCaps * caps);
void
gnl_object_set_commit_needed (GnlObject *object);
gboolean
gnl_object_commit (GnlObject *object, gboolean recurse);
void
gnl_object_reset (GnlObject *object);
GstStateChangeReturn
gnl_object_cleanup (GnlObject * object);
G_END_DECLS
#endif /* __GNL_OBJECT_H__ */

View file

@ -17,10 +17,10 @@ common_ldadd=$(top_builddir)/ges/libges-@GST_API_VERSION@.la \
$(GST_OBJ_LIBS) $(GST_CHECK_LIBS) $(GST_OBJ_LIBS) $(GST_CHECK_LIBS)
testutils_noisnt_libraries=libtestutils.la testutils_noisnt_libraries=libtestutils.la
testutils_noinst_headers=ges/test-utils.h testutils_noinst_headers=ges/test-utils.h nle/common.h
libtestutils_la_LIBADD=$(common_ldadd) libtestutils_la_LIBADD=$(common_ldadd)
libtestutils_la_CFLAGS=$(common_cflags) libtestutils_la_CFLAGS=$(common_cflags)
libtestutils_la_SOURCES=ges/test-utils.c libtestutils_la_SOURCES=ges/test-utils.c nle/common.c
SUPPRESSIONS = $(top_srcdir)/common/gst.supp # $(srcdir)/gst-plugins-bad.supp SUPPRESSIONS = $(top_srcdir)/common/gst.supp # $(srcdir)/gst-plugins-bad.supp
@ -41,7 +41,12 @@ check_PROGRAMS = \
ges/text_properties\ ges/text_properties\
ges/mixers\ ges/mixers\
ges/group\ ges/group\
ges/project ges/project\
nle/simple \
nle/complex \
nle/nlesource \
nle/nleoperation \
nle/nlecomposition
noinst_LTLIBRARIES=$(testutils_noisnt_libraries) noinst_LTLIBRARIES=$(testutils_noisnt_libraries)
noinst_HEADERS=$(testutils_noinst_headers) noinst_HEADERS=$(testutils_noinst_headers)

View file

@ -84,8 +84,8 @@ GST_START_TEST (test_test_source_properties)
fail_unless (ges_timeline_commit (timeline)); fail_unless (ges_timeline_commit (timeline));
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12, nle_object_check (ges_track_element_get_nleobject (trackelement), 42, 51, 12,
51, MIN_GNL_PRIO, TRUE); 51, MIN_NLE_PRIO, TRUE);
/* Change more properties, see if they propagate */ /* Change more properties, see if they propagate */
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510, g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
@ -99,18 +99,18 @@ GST_START_TEST (test_test_source_properties)
fail_unless (ges_timeline_commit (timeline)); fail_unless (ges_timeline_commit (timeline));
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510, nle_object_check (ges_track_element_get_nleobject (trackelement), 420, 510,
120, 510, MIN_GNL_PRIO + 0, TRUE); 120, 510, MIN_NLE_PRIO + 0, TRUE);
/* Test mute support */ /* Test mute support */
g_object_set (clip, "mute", TRUE, NULL); g_object_set (clip, "mute", TRUE, NULL);
fail_unless (ges_timeline_commit (timeline)); fail_unless (ges_timeline_commit (timeline));
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510, nle_object_check (ges_track_element_get_nleobject (trackelement), 420, 510,
120, 510, MIN_GNL_PRIO + 0, FALSE); 120, 510, MIN_NLE_PRIO + 0, FALSE);
g_object_set (clip, "mute", FALSE, NULL); g_object_set (clip, "mute", FALSE, NULL);
fail_unless (ges_timeline_commit (timeline)); fail_unless (ges_timeline_commit (timeline));
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510, nle_object_check (ges_track_element_get_nleobject (trackelement), 420, 510,
120, 510, MIN_GNL_PRIO + 0, TRUE); 120, 510, MIN_NLE_PRIO + 0, TRUE);
ges_container_remove (GES_CONTAINER (clip), ges_container_remove (GES_CONTAINER (clip),
GES_TIMELINE_ELEMENT (trackelement)); GES_TIMELINE_ELEMENT (trackelement));
@ -213,7 +213,7 @@ find_composition_func (const GValue * velement)
GstElementFactory *fac = gst_element_get_factory (element); GstElementFactory *fac = gst_element_get_factory (element);
const gchar *name = gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (fac)); const gchar *name = gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (fac));
if (g_strcmp0 (name, "gnlcomposition") == 0) if (g_strcmp0 (name, "nlecomposition") == 0)
return 0; return 0;
return 1; return 1;
@ -236,10 +236,10 @@ find_composition (GESTrack * track)
return ret; return ret;
} }
#define gap_object_check(gnlobj, start, duration, priority) \ #define gap_object_check(nleobj, start, duration, priority) \
{ \ { \
guint64 pstart, pdur, pprio; \ guint64 pstart, pdur, pprio; \
g_object_get (gnlobj, "start", &pstart, "duration", &pdur, \ g_object_get (nleobj, "start", &pstart, "duration", &pdur, \
"priority", &pprio, NULL); \ "priority", &pprio, NULL); \
assert_equals_uint64 (pstart, start); \ assert_equals_uint64 (pstart, start); \
assert_equals_uint64 (pdur, duration); \ assert_equals_uint64 (pdur, duration); \
@ -255,7 +255,7 @@ GST_START_TEST (test_gap_filling_basic)
GESLayer *layer; GESLayer *layer;
GESClip *clip, *clip1, *clip2; GESClip *clip, *clip1, *clip2;
GstElement *gnlsrc, *gnlsrc1, *gap = NULL; GstElement *nlesrc, *nlesrc1, *gap = NULL;
GESTrackElement *trackelement, *trackelement1, *trackelement2; GESTrackElement *trackelement, *trackelement1, *trackelement2;
ges_init (); ges_init ();
@ -288,8 +288,8 @@ GST_START_TEST (test_gap_filling_basic)
fail_unless (trackelement != NULL); fail_unless (trackelement != NULL);
fail_unless (ges_track_element_get_track (trackelement) == track); fail_unless (ges_track_element_get_track (trackelement) == track);
gnlsrc = ges_track_element_get_gnlobject (trackelement); nlesrc = ges_track_element_get_nleobject (trackelement);
fail_unless (gnlsrc != NULL); fail_unless (nlesrc != NULL);
/* Check that trackelement has the same properties */ /* Check that trackelement has the same properties */
assert_equals_uint64 (_START (trackelement), 0); assert_equals_uint64 (_START (trackelement), 0);
@ -312,8 +312,8 @@ GST_START_TEST (test_gap_filling_basic)
trackelement1 = GES_CONTAINER_CHILDREN (clip1)->data; trackelement1 = GES_CONTAINER_CHILDREN (clip1)->data;
fail_unless (trackelement1 != NULL); fail_unless (trackelement1 != NULL);
fail_unless (ges_track_element_get_track (trackelement1) == track); fail_unless (ges_track_element_get_track (trackelement1) == track);
gnlsrc1 = ges_track_element_get_gnlobject (trackelement1); nlesrc1 = ges_track_element_get_nleobject (trackelement1);
fail_unless (gnlsrc1 != NULL); fail_unless (nlesrc1 != NULL);
/* Check that trackelement1 has the same properties */ /* Check that trackelement1 has the same properties */
assert_equals_uint64 (_START (trackelement1), 15); assert_equals_uint64 (_START (trackelement1), 15);
@ -324,11 +324,11 @@ GST_START_TEST (test_gap_filling_basic)
for (tmp = GST_BIN_CHILDREN (composition); tmp; tmp = tmp->next) { for (tmp = GST_BIN_CHILDREN (composition); tmp; tmp = tmp->next) {
guint prio; guint prio;
GstElement *tmp_gnlobj = GST_ELEMENT (tmp->data); GstElement *tmp_nleobj = GST_ELEMENT (tmp->data);
g_object_get (tmp_gnlobj, "priority", &prio, NULL); g_object_get (tmp_nleobj, "priority", &prio, NULL);
if (tmp_gnlobj != gnlsrc && tmp_gnlobj != gnlsrc1 && prio == 1) { if (tmp_nleobj != nlesrc && tmp_nleobj != nlesrc1 && prio == 1) {
gap = tmp_gnlobj; gap = tmp_nleobj;
} }
} }
fail_unless (gap != NULL); fail_unless (gap != NULL);

View file

@ -66,8 +66,8 @@ GST_START_TEST (test_object_properties)
assert_equals_uint64 (_INPOINT (trackelement), 12); assert_equals_uint64 (_INPOINT (trackelement), 12);
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12, nle_object_check (ges_track_element_get_nleobject (trackelement), 42, 51, 12,
51, MIN_GNL_PRIO, TRUE); 51, MIN_NLE_PRIO, TRUE);
/* Change more properties, see if they propagate */ /* Change more properties, see if they propagate */
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510, g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
@ -81,8 +81,8 @@ GST_START_TEST (test_object_properties)
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
ges_timeline_commit (timeline); ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510, nle_object_check (ges_track_element_get_nleobject (trackelement), 420, 510,
120, 510, MIN_GNL_PRIO + 0, TRUE); 120, 510, MIN_NLE_PRIO + 0, TRUE);
/* This time, we move the trackelement to see if the changes move /* This time, we move the trackelement to see if the changes move
@ -91,8 +91,8 @@ GST_START_TEST (test_object_properties)
ges_timeline_commit (timeline); ges_timeline_commit (timeline);
assert_equals_uint64 (_START (clip), 400); assert_equals_uint64 (_START (clip), 400);
assert_equals_uint64 (_START (trackelement), 400); assert_equals_uint64 (_START (trackelement), 400);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 400, 510, nle_object_check (ges_track_element_get_nleobject (trackelement), 400, 510,
120, 510, MIN_GNL_PRIO + 0, TRUE); 120, 510, MIN_NLE_PRIO + 0, TRUE);
ges_container_remove (GES_CONTAINER (clip), ges_container_remove (GES_CONTAINER (clip),
GES_TIMELINE_ELEMENT (trackelement)); GES_TIMELINE_ELEMENT (trackelement));
@ -145,8 +145,8 @@ GST_START_TEST (test_split_object)
assert_equals_uint64 (_INPOINT (trackelement), 12); assert_equals_uint64 (_INPOINT (trackelement), 12);
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 50, 12, nle_object_check (ges_track_element_get_nleobject (trackelement), 42, 50, 12,
50, MIN_GNL_PRIO, TRUE); 50, MIN_NLE_PRIO, TRUE);
splitclip = ges_clip_split (clip, 67); splitclip = ges_clip_split (clip, 67);
fail_unless (GES_IS_CLIP (splitclip)); fail_unless (GES_IS_CLIP (splitclip));
@ -463,38 +463,38 @@ GST_START_TEST (test_effects_priorities)
fail_unless (ges_container_add (GES_CONTAINER (clip), fail_unless (ges_container_add (GES_CONTAINER (clip),
GES_TIMELINE_ELEMENT (effect2))); GES_TIMELINE_ELEMENT (effect2)));
fail_unless_equals_int (MIN_GNL_PRIO + 0, _PRIORITY (effect)); fail_unless_equals_int (MIN_NLE_PRIO + 0, _PRIORITY (effect));
fail_unless_equals_int (MIN_GNL_PRIO + 1, _PRIORITY (effect1)); fail_unless_equals_int (MIN_NLE_PRIO + 1, _PRIORITY (effect1));
fail_unless_equals_int (MIN_GNL_PRIO + 2, _PRIORITY (effect2)); fail_unless_equals_int (MIN_NLE_PRIO + 2, _PRIORITY (effect2));
fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect), fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect),
2)); 2));
fail_unless_equals_int (MIN_GNL_PRIO + 0, _PRIORITY (effect1)); fail_unless_equals_int (MIN_NLE_PRIO + 0, _PRIORITY (effect1));
fail_unless_equals_int (MIN_GNL_PRIO + 1, _PRIORITY (effect2)); fail_unless_equals_int (MIN_NLE_PRIO + 1, _PRIORITY (effect2));
fail_unless_equals_int (MIN_GNL_PRIO + 2, _PRIORITY (effect)); fail_unless_equals_int (MIN_NLE_PRIO + 2, _PRIORITY (effect));
fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect), fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect),
0)); 0));
fail_unless_equals_int (MIN_GNL_PRIO + 0, _PRIORITY (effect)); fail_unless_equals_int (MIN_NLE_PRIO + 0, _PRIORITY (effect));
fail_unless_equals_int (MIN_GNL_PRIO + 1, _PRIORITY (effect1)); fail_unless_equals_int (MIN_NLE_PRIO + 1, _PRIORITY (effect1));
fail_unless_equals_int (MIN_GNL_PRIO + 2, _PRIORITY (effect2)); fail_unless_equals_int (MIN_NLE_PRIO + 2, _PRIORITY (effect2));
fail_unless (ges_clip_move_to_layer (clip, layer1)); fail_unless (ges_clip_move_to_layer (clip, layer1));
fail_unless_equals_int (LAYER_HEIGHT + MIN_GNL_PRIO + 0, _PRIORITY (effect)); fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + 0, _PRIORITY (effect));
fail_unless_equals_int (LAYER_HEIGHT + MIN_GNL_PRIO + 1, _PRIORITY (effect1)); fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + 1, _PRIORITY (effect1));
fail_unless_equals_int (LAYER_HEIGHT + MIN_GNL_PRIO + 2, _PRIORITY (effect2)); fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + 2, _PRIORITY (effect2));
fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect), fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect),
2)); 2));
fail_unless_equals_int (LAYER_HEIGHT + MIN_GNL_PRIO + 0, _PRIORITY (effect1)); fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + 0, _PRIORITY (effect1));
fail_unless_equals_int (LAYER_HEIGHT + MIN_GNL_PRIO + 1, _PRIORITY (effect2)); fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + 1, _PRIORITY (effect2));
fail_unless_equals_int (LAYER_HEIGHT + MIN_GNL_PRIO + 2, _PRIORITY (effect)); fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + 2, _PRIORITY (effect));
fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect), fail_unless (ges_clip_set_top_effect_priority (clip, GES_BASE_EFFECT (effect),
0)); 0));
fail_unless_equals_int (LAYER_HEIGHT + MIN_GNL_PRIO + 0, _PRIORITY (effect)); fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + 0, _PRIORITY (effect));
fail_unless_equals_int (LAYER_HEIGHT + MIN_GNL_PRIO + 1, _PRIORITY (effect1)); fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + 1, _PRIORITY (effect1));
fail_unless_equals_int (LAYER_HEIGHT + MIN_GNL_PRIO + 2, _PRIORITY (effect2)); fail_unless_equals_int (LAYER_HEIGHT + MIN_NLE_PRIO + 2, _PRIORITY (effect2));
gst_object_unref (timeline); gst_object_unref (timeline);
} }

View file

@ -111,7 +111,7 @@ GST_START_TEST (test_get_effects_from_tl)
assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (source)), 1); assert_equals_int (g_list_length (GES_CONTAINER_CHILDREN (source)), 1);
video_source = GES_CONTAINER_CHILDREN (source)->data; video_source = GES_CONTAINER_CHILDREN (source)->data;
fail_unless (GES_IS_VIDEO_TEST_SOURCE (video_source)); fail_unless (GES_IS_VIDEO_TEST_SOURCE (video_source));
assert_equals_int (_PRIORITY (video_source), MIN_GNL_PRIO); assert_equals_int (_PRIORITY (video_source), MIN_NLE_PRIO);
GST_DEBUG ("Create effect"); GST_DEBUG ("Create effect");
effect = ges_effect_new ("agingtv"); effect = ges_effect_new ("agingtv");
@ -127,17 +127,17 @@ GST_START_TEST (test_get_effects_from_tl)
GES_TIMELINE_ELEMENT (effect))); GES_TIMELINE_ELEMENT (effect)));
fail_unless (ges_track_element_get_track (GES_TRACK_ELEMENT (effect)) == fail_unless (ges_track_element_get_track (GES_TRACK_ELEMENT (effect)) ==
track_video); track_video);
assert_equals_int (_PRIORITY (effect), MIN_GNL_PRIO + 0); assert_equals_int (_PRIORITY (effect), MIN_NLE_PRIO + 0);
assert_equals_int (_PRIORITY (video_source), MIN_GNL_PRIO + 1); assert_equals_int (_PRIORITY (video_source), MIN_NLE_PRIO + 1);
GST_DEBUG ("Adding effect 1"); GST_DEBUG ("Adding effect 1");
fail_unless (ges_container_add (GES_CONTAINER (source), fail_unless (ges_container_add (GES_CONTAINER (source),
GES_TIMELINE_ELEMENT (effect1))); GES_TIMELINE_ELEMENT (effect1)));
fail_unless (ges_track_element_get_track (GES_TRACK_ELEMENT (effect1)) == fail_unless (ges_track_element_get_track (GES_TRACK_ELEMENT (effect1)) ==
track_video); track_video);
assert_equals_int (_PRIORITY (effect), MIN_GNL_PRIO); assert_equals_int (_PRIORITY (effect), MIN_NLE_PRIO);
assert_equals_int (_PRIORITY (effect1), MIN_GNL_PRIO + 1); assert_equals_int (_PRIORITY (effect1), MIN_NLE_PRIO + 1);
assert_equals_int (_PRIORITY (video_source), MIN_GNL_PRIO + 2); assert_equals_int (_PRIORITY (video_source), MIN_NLE_PRIO + 2);
GST_DEBUG ("Adding effect 2"); GST_DEBUG ("Adding effect 2");
fail_unless (ges_container_add (GES_CONTAINER (source), fail_unless (ges_container_add (GES_CONTAINER (source),
@ -282,8 +282,8 @@ GST_START_TEST (test_priorities_clip)
fail_unless (GES_IS_EFFECT (video_effect)); fail_unless (GES_IS_EFFECT (video_effect));
/* FIXME This is ridiculus, both effects should have the same priority (0) */ /* FIXME This is ridiculus, both effects should have the same priority (0) */
assert_equals_int (_PRIORITY (audio_effect), MIN_GNL_PRIO); assert_equals_int (_PRIORITY (audio_effect), MIN_NLE_PRIO);
assert_equals_int (_PRIORITY (video_effect), MIN_GNL_PRIO + 1); assert_equals_int (_PRIORITY (video_effect), MIN_NLE_PRIO + 1);
assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 2); assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 2);
effect = ges_effect_new ("agingtv"); effect = ges_effect_new ("agingtv");
@ -303,14 +303,14 @@ GST_START_TEST (test_priorities_clip)
fail_unless (ges_clip_set_top_effect_priority (GES_CLIP (effect_clip), fail_unless (ges_clip_set_top_effect_priority (GES_CLIP (effect_clip),
GES_BASE_EFFECT (effect1), 0)); GES_BASE_EFFECT (effect1), 0));
assert_equals_int (_PRIORITY (effect), 3 + MIN_GNL_PRIO); assert_equals_int (_PRIORITY (effect), 3 + MIN_NLE_PRIO);
assert_equals_int (_PRIORITY (effect1), 0 + MIN_GNL_PRIO); assert_equals_int (_PRIORITY (effect1), 0 + MIN_NLE_PRIO);
assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 4); assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 4);
fail_unless (ges_clip_set_top_effect_priority (GES_CLIP (effect_clip), fail_unless (ges_clip_set_top_effect_priority (GES_CLIP (effect_clip),
GES_BASE_EFFECT (effect1), 3)); GES_BASE_EFFECT (effect1), 3));
assert_equals_int (_PRIORITY (effect), 2 + MIN_GNL_PRIO); assert_equals_int (_PRIORITY (effect), 2 + MIN_NLE_PRIO);
assert_equals_int (_PRIORITY (effect1), 3 + MIN_GNL_PRIO); assert_equals_int (_PRIORITY (effect1), 3 + MIN_NLE_PRIO);
assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 4); assert_equals_int (GES_CONTAINER_HEIGHT (effect_clip), 4);
effects = ges_clip_get_top_effects (GES_CLIP (effect_clip)); effects = ges_clip_get_top_effects (GES_CLIP (effect_clip));

View file

@ -74,32 +74,32 @@ GST_START_TEST (test_layer_properties)
assert_equals_uint64 (_INPOINT (clip), 12); assert_equals_uint64 (_INPOINT (clip), 12);
assert_equals_uint64 (_PRIORITY (clip), 0); assert_equals_uint64 (_PRIORITY (clip), 0);
ges_timeline_commit (timeline); ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12, nle_object_check (ges_track_element_get_nleobject (trackelement), 42, 51, 12,
51, MIN_GNL_PRIO, TRUE); 51, MIN_NLE_PRIO, TRUE);
/* Change the priority of the layer */ /* Change the priority of the layer */
g_object_set (layer, "priority", 1, NULL); g_object_set (layer, "priority", 1, NULL);
assert_equals_int (ges_layer_get_priority (layer), 1); assert_equals_int (ges_layer_get_priority (layer), 1);
assert_equals_uint64 (_PRIORITY (clip), 0); assert_equals_uint64 (_PRIORITY (clip), 0);
ges_timeline_commit (timeline); ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12, nle_object_check (ges_track_element_get_nleobject (trackelement), 42, 51, 12,
51, LAYER_HEIGHT + MIN_GNL_PRIO, TRUE); 51, LAYER_HEIGHT + MIN_NLE_PRIO, TRUE);
/* Change it to an insanely high value */ /* Change it to an insanely high value */
g_object_set (layer, "priority", 31, NULL); g_object_set (layer, "priority", 31, NULL);
assert_equals_int (ges_layer_get_priority (layer), 31); assert_equals_int (ges_layer_get_priority (layer), 31);
assert_equals_uint64 (_PRIORITY (clip), 0); assert_equals_uint64 (_PRIORITY (clip), 0);
ges_timeline_commit (timeline); ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12, nle_object_check (ges_track_element_get_nleobject (trackelement), 42, 51, 12,
51, MIN_GNL_PRIO + LAYER_HEIGHT * 31, TRUE); 51, MIN_NLE_PRIO + LAYER_HEIGHT * 31, TRUE);
/* and back to 0 */ /* and back to 0 */
g_object_set (layer, "priority", 0, NULL); g_object_set (layer, "priority", 0, NULL);
assert_equals_int (ges_layer_get_priority (layer), 0); assert_equals_int (ges_layer_get_priority (layer), 0);
assert_equals_uint64 (_PRIORITY (clip), 0); assert_equals_uint64 (_PRIORITY (clip), 0);
ges_timeline_commit (timeline); ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12, nle_object_check (ges_track_element_get_nleobject (trackelement), 42, 51, 12,
51, MIN_GNL_PRIO + 0, TRUE); 51, MIN_NLE_PRIO + 0, TRUE);
gst_object_unref (trackelement); gst_object_unref (trackelement);
fail_unless (ges_layer_remove_clip (layer, clip)); fail_unless (ges_layer_remove_clip (layer, clip));
@ -117,7 +117,7 @@ GST_START_TEST (test_layer_priorities)
GESLayer *layer1, *layer2, *layer3; GESLayer *layer1, *layer2, *layer3;
GESTrackElement *trackelement1, *trackelement2, *trackelement3; GESTrackElement *trackelement1, *trackelement2, *trackelement3;
GESClip *clip1, *clip2, *clip3; GESClip *clip1, *clip2, *clip3;
GstElement *gnlobj1, *gnlobj2, *gnlobj3; GstElement *nleobj1, *nleobj2, *nleobj3;
guint prio1, prio2, prio3; guint prio1, prio2, prio3;
GList *objs, *tmp; GList *objs, *tmp;
@ -179,25 +179,25 @@ GST_START_TEST (test_layer_priorities)
ges_timeline_commit (timeline); ges_timeline_commit (timeline);
assert_equals_int (_PRIORITY (clip1), 0); assert_equals_int (_PRIORITY (clip1), 0);
gnlobj1 = ges_track_element_get_gnlobject (trackelement1); nleobj1 = ges_track_element_get_nleobject (trackelement1);
fail_unless (gnlobj1 != NULL); fail_unless (nleobj1 != NULL);
g_object_get (gnlobj1, "priority", &prio1, NULL); g_object_get (nleobj1, "priority", &prio1, NULL);
assert_equals_int (prio1, MIN_GNL_PRIO); assert_equals_int (prio1, MIN_NLE_PRIO);
assert_equals_int (_PRIORITY (clip2), 1); assert_equals_int (_PRIORITY (clip2), 1);
gnlobj2 = ges_track_element_get_gnlobject (trackelement2); nleobj2 = ges_track_element_get_nleobject (trackelement2);
fail_unless (gnlobj2 != NULL); fail_unless (nleobj2 != NULL);
g_object_get (gnlobj2, "priority", &prio2, NULL); g_object_get (nleobj2, "priority", &prio2, NULL);
/* clip2 is on the second layer and has a priority of 1 */ /* clip2 is on the second layer and has a priority of 1 */
assert_equals_int (prio2, MIN_GNL_PRIO + LAYER_HEIGHT + 1); assert_equals_int (prio2, MIN_NLE_PRIO + LAYER_HEIGHT + 1);
assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT - 1); assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT - 1);
gnlobj3 = ges_track_element_get_gnlobject (trackelement3); nleobj3 = ges_track_element_get_nleobject (trackelement3);
fail_unless (gnlobj3 != NULL); fail_unless (nleobj3 != NULL);
/* clip3 is on the third layer and has a priority of LAYER_HEIGHT + 1 /* clip3 is on the third layer and has a priority of LAYER_HEIGHT + 1
* it priority must have the maximum priority of this layer*/ * it priority must have the maximum priority of this layer*/
g_object_get (gnlobj3, "priority", &prio3, NULL); g_object_get (nleobj3, "priority", &prio3, NULL);
assert_equals_int (prio3, MIN_GNL_PRIO + LAYER_HEIGHT * 3 - 1); assert_equals_int (prio3, MIN_NLE_PRIO + LAYER_HEIGHT * 3 - 1);
/* Move layers around */ /* Move layers around */
g_object_set (layer1, "priority", 2, NULL); g_object_set (layer1, "priority", 2, NULL);
@ -212,12 +212,12 @@ GST_START_TEST (test_layer_priorities)
assert_equals_int (_PRIORITY (clip1), 0); assert_equals_int (_PRIORITY (clip1), 0);
assert_equals_int (_PRIORITY (clip2), 1); assert_equals_int (_PRIORITY (clip2), 1);
assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT - 1); assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT - 1);
g_object_get (gnlobj1, "priority", &prio1, NULL); g_object_get (nleobj1, "priority", &prio1, NULL);
g_object_get (gnlobj2, "priority", &prio2, NULL); g_object_get (nleobj2, "priority", &prio2, NULL);
g_object_get (gnlobj3, "priority", &prio3, NULL); g_object_get (nleobj3, "priority", &prio3, NULL);
assert_equals_int (prio1, 2 * LAYER_HEIGHT + MIN_GNL_PRIO); assert_equals_int (prio1, 2 * LAYER_HEIGHT + MIN_NLE_PRIO);
assert_equals_int (prio2, MIN_GNL_PRIO + 1); assert_equals_int (prio2, MIN_NLE_PRIO + 1);
assert_equals_int (prio3, LAYER_HEIGHT * 2 - 1 + MIN_GNL_PRIO); assert_equals_int (prio3, LAYER_HEIGHT * 2 - 1 + MIN_NLE_PRIO);
/* And move objects around */ /* And move objects around */
fail_unless (ges_clip_move_to_layer (clip2, layer1)); fail_unless (ges_clip_move_to_layer (clip2, layer1));
@ -238,12 +238,12 @@ GST_START_TEST (test_layer_priorities)
assert_equals_int (_PRIORITY (clip1), 0); assert_equals_int (_PRIORITY (clip1), 0);
assert_equals_int (_PRIORITY (clip2), 1); assert_equals_int (_PRIORITY (clip2), 1);
assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT - 1); assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT - 1);
g_object_get (gnlobj1, "priority", &prio1, NULL); g_object_get (nleobj1, "priority", &prio1, NULL);
g_object_get (gnlobj2, "priority", &prio2, NULL); g_object_get (nleobj2, "priority", &prio2, NULL);
g_object_get (gnlobj3, "priority", &prio3, NULL); g_object_get (nleobj3, "priority", &prio3, NULL);
assert_equals_int (prio1, 2 * LAYER_HEIGHT + MIN_GNL_PRIO); assert_equals_int (prio1, 2 * LAYER_HEIGHT + MIN_NLE_PRIO);
assert_equals_int (prio2, 2 * LAYER_HEIGHT + 1 + MIN_GNL_PRIO); assert_equals_int (prio2, 2 * LAYER_HEIGHT + 1 + MIN_NLE_PRIO);
assert_equals_int (prio3, LAYER_HEIGHT * 3 - 1 + MIN_GNL_PRIO); assert_equals_int (prio3, LAYER_HEIGHT * 3 - 1 + MIN_NLE_PRIO);
/* And change TrackElement-s priorities and check that changes are not /* And change TrackElement-s priorities and check that changes are not
* refected on it containing Clip * refected on it containing Clip
@ -252,7 +252,7 @@ GST_START_TEST (test_layer_priorities)
* ges_timeline_element_set_priority (GES_TIMELINE_ELEMENT (trackelement3), * ges_timeline_element_set_priority (GES_TIMELINE_ELEMENT (trackelement3),
* ges_timeline_commit (timeline); * ges_timeline_commit (timeline);
* LAYER_HEIGHT * 2); * LAYER_HEIGHT * 2);
* g_object_get (gnlobj3, "priority", &prio3, NULL); * g_object_get (nleobj3, "priority", &prio3, NULL);
* assert_equals_int (prio3, 2 * LAYER_HEIGHT); * assert_equals_int (prio3, 2 * LAYER_HEIGHT);
* assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT - 1); */ * assert_equals_int (_PRIORITY (clip3), LAYER_HEIGHT - 1); */

View file

@ -80,8 +80,8 @@ GST_START_TEST (test_overlay_properties)
assert_equals_uint64 (_INPOINT (trackelement), 12); assert_equals_uint64 (_INPOINT (trackelement), 12);
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12, nle_object_check (ges_track_element_get_nleobject (trackelement), 42, 51, 12,
51, MIN_GNL_PRIO, TRUE); 51, MIN_NLE_PRIO, TRUE);
/* Change more properties, see if they propagate */ /* Change more properties, see if they propagate */
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510, g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
@ -95,8 +95,8 @@ GST_START_TEST (test_overlay_properties)
assert_equals_uint64 (_INPOINT (trackelement), 120); assert_equals_uint64 (_INPOINT (trackelement), 120);
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510, nle_object_check (ges_track_element_get_nleobject (trackelement), 420, 510,
120, 510, MIN_GNL_PRIO + 0, TRUE); 120, 510, MIN_NLE_PRIO + 0, TRUE);
ges_container_remove (GES_CONTAINER (clip), ges_container_remove (GES_CONTAINER (clip),
GES_TIMELINE_ELEMENT (trackelement)); GES_TIMELINE_ELEMENT (trackelement));

View file

@ -267,11 +267,11 @@ _test_project (GESProject * project, GESTimeline * timeline)
"scratch-lines", &nb_scratch_lines, NULL); "scratch-lines", &nb_scratch_lines, NULL);
assert_equals_int (nb_scratch_lines, 12); assert_equals_int (nb_scratch_lines, 12);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), nle_object_check (ges_track_element_get_nleobject (trackelement),
0, 1000000000, 0, 1000000000, MIN_GNL_PRIO, TRUE); 0, 1000000000, 0, 1000000000, MIN_NLE_PRIO, TRUE);
} else { } else {
gnl_object_check (ges_track_element_get_gnlobject (trackelement), nle_object_check (ges_track_element_get_nleobject (trackelement),
0, 1000000000, 0, 1000000000, MIN_GNL_PRIO + 1, TRUE); 0, 1000000000, 0, 1000000000, MIN_NLE_PRIO + 1, TRUE);
} }
} }
break; break;

View file

@ -26,11 +26,11 @@
#include <gst/check/gstcheck.h> #include <gst/check/gstcheck.h>
GESPipeline * ges_test_create_pipeline (GESTimeline *timeline); GESPipeline * ges_test_create_pipeline (GESTimeline *timeline);
/* The first 2 GNL priorities are used for: /* The first 2 NLE priorities are used for:
* 0- The Mixing element * 0- The Mixing element
* 1- The Gaps * 1- The Gaps
*/ */
#define MIN_GNL_PRIO 2 #define MIN_NLE_PRIO 2
#define LAYER_HEIGHT 1000 #define LAYER_HEIGHT 1000
@ -49,9 +49,9 @@ ges_generate_test_file_audio_video (const gchar * filedest,
gboolean gboolean
play_timeline (GESTimeline * timeline); play_timeline (GESTimeline * timeline);
#define gnl_object_check(gnlobj, start, duration, mstart, mduration, priority, active) { \ #define nle_object_check(nleobj, start, duration, mstart, mduration, priority, active) { \
guint64 pstart, pdur, inpoint, pprio, pact; \ guint64 pstart, pdur, inpoint, pprio, pact; \
g_object_get (gnlobj, "start", &pstart, "duration", &pdur, \ g_object_get (nleobj, "start", &pstart, "duration", &pdur, \
"inpoint", &inpoint, "priority", &pprio, "active", &pact, \ "inpoint", &inpoint, "priority", &pprio, "active", &pact, \
NULL); \ NULL); \
assert_equals_uint64 (pstart, start); \ assert_equals_uint64 (pstart, start); \
@ -61,7 +61,7 @@ play_timeline (GESTimeline * timeline);
assert_equals_int (pact, active); \ assert_equals_int (pact, active); \
} }
/* copied from gnl */ /* copied from nle */
#define fail_error_message(msg) \ #define fail_error_message(msg) \
G_STMT_START { \ G_STMT_START { \
GError *error; \ GError *error; \

View file

@ -80,8 +80,8 @@ GST_START_TEST (test_title_source_properties)
assert_equals_uint64 (_INPOINT (trackelement), 12); assert_equals_uint64 (_INPOINT (trackelement), 12);
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12, nle_object_check (ges_track_element_get_nleobject (trackelement), 42, 51, 12,
51, MIN_GNL_PRIO, TRUE); 51, MIN_NLE_PRIO, TRUE);
/* Change more properties, see if they propagate */ /* Change more properties, see if they propagate */
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510, g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
@ -95,8 +95,8 @@ GST_START_TEST (test_title_source_properties)
assert_equals_uint64 (_INPOINT (trackelement), 120); assert_equals_uint64 (_INPOINT (trackelement), 120);
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510, nle_object_check (ges_track_element_get_nleobject (trackelement), 420, 510,
120, 510, MIN_GNL_PRIO + 0, TRUE); 120, 510, MIN_NLE_PRIO + 0, TRUE);
ges_container_remove (GES_CONTAINER (clip), ges_container_remove (GES_CONTAINER (clip),
GES_TIMELINE_ELEMENT (trackelement)); GES_TIMELINE_ELEMENT (trackelement));

View file

@ -109,8 +109,8 @@ GST_START_TEST (test_transition_properties)
assert_equals_uint64 (_INPOINT (trackelement), 12); assert_equals_uint64 (_INPOINT (trackelement), 12);
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12, nle_object_check (ges_track_element_get_nleobject (trackelement), 42, 51, 12,
51, MIN_GNL_PRIO, TRUE); 51, MIN_NLE_PRIO, TRUE);
/* Change more properties, see if they propagate */ /* Change more properties, see if they propagate */
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510, g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
@ -124,8 +124,8 @@ GST_START_TEST (test_transition_properties)
assert_equals_uint64 (_INPOINT (trackelement), 120); assert_equals_uint64 (_INPOINT (trackelement), 120);
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510, nle_object_check (ges_track_element_get_nleobject (trackelement), 420, 510,
120, 510, MIN_GNL_PRIO + 0, TRUE); 120, 510, MIN_NLE_PRIO + 0, TRUE);
/* test changing vtype */ /* test changing vtype */
GST_DEBUG ("Setting to crossfade"); GST_DEBUG ("Setting to crossfade");

View file

@ -167,8 +167,8 @@ GST_START_TEST (test_filesource_properties)
assert_equals_uint64 (_INPOINT (trackelement), 12); assert_equals_uint64 (_INPOINT (trackelement), 12);
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 42, 51, 12, nle_object_check (ges_track_element_get_nleobject (trackelement), 42, 51, 12,
51, MIN_GNL_PRIO, TRUE); 51, MIN_NLE_PRIO, TRUE);
/* Change more properties, see if they propagate */ /* Change more properties, see if they propagate */
g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510, g_object_set (clip, "start", (guint64) 420, "duration", (guint64) 510,
@ -182,18 +182,18 @@ GST_START_TEST (test_filesource_properties)
assert_equals_uint64 (_INPOINT (trackelement), 120); assert_equals_uint64 (_INPOINT (trackelement), 120);
/* And let's also check that it propagated correctly to GNonLin */ /* And let's also check that it propagated correctly to GNonLin */
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510, nle_object_check (ges_track_element_get_nleobject (trackelement), 420, 510,
120, 510, MIN_GNL_PRIO + 0, TRUE); 120, 510, MIN_NLE_PRIO + 0, TRUE);
/* Test mute support */ /* Test mute support */
g_object_set (clip, "mute", TRUE, NULL); g_object_set (clip, "mute", TRUE, NULL);
ges_timeline_commit (timeline); ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510, nle_object_check (ges_track_element_get_nleobject (trackelement), 420, 510,
120, 510, MIN_GNL_PRIO + 0, FALSE); 120, 510, MIN_NLE_PRIO + 0, FALSE);
g_object_set (clip, "mute", FALSE, NULL); g_object_set (clip, "mute", FALSE, NULL);
ges_timeline_commit (timeline); ges_timeline_commit (timeline);
gnl_object_check (ges_track_element_get_gnlobject (trackelement), 420, 510, nle_object_check (ges_track_element_get_nleobject (trackelement), 420, 510,
120, 510, MIN_GNL_PRIO + 0, TRUE); 120, 510, MIN_NLE_PRIO + 0, TRUE);
ges_container_remove (GES_CONTAINER (clip), ges_container_remove (GES_CONTAINER (clip),
GES_TIMELINE_ELEMENT (trackelement)); GES_TIMELINE_ELEMENT (trackelement));

View file

@ -167,25 +167,25 @@ sinkpad_probe (GstPad * sinkpad, GstPadProbeInfo * info,
} }
static GstElement * static GstElement *
new_gnl_src (const gchar * name, guint64 start, gint64 duration, gint priority) new_nle_src (const gchar * name, guint64 start, gint64 duration, gint priority)
{ {
GstElement *gnlsource = NULL; GstElement *nlesource = NULL;
gnlsource = gst_element_factory_make_or_warn ("gnlsource", name); nlesource = gst_element_factory_make_or_warn ("nlesource", name);
fail_if (gnlsource == NULL); fail_if (nlesource == NULL);
g_object_set (G_OBJECT (gnlsource), g_object_set (G_OBJECT (nlesource),
"start", start, "start", start,
"duration", duration, "inpoint", start, "priority", priority, NULL); "duration", duration, "inpoint", start, "priority", priority, NULL);
return gnlsource; return nlesource;
} }
GstElement * GstElement *
videotest_gnl_src (const gchar * name, guint64 start, gint64 duration, videotest_nle_src (const gchar * name, guint64 start, gint64 duration,
gint pattern, guint priority) gint pattern, guint priority)
{ {
GstElement *gnlsource = NULL; GstElement *nlesource = NULL;
GstElement *videotestsrc = NULL; GstElement *videotestsrc = NULL;
GstCaps *caps = GstCaps *caps =
gst_caps_from_string gst_caps_from_string
@ -196,35 +196,35 @@ videotest_gnl_src (const gchar * name, guint64 start, gint64 duration,
videotestsrc = gst_element_factory_make_or_warn ("videotestsrc", NULL); videotestsrc = gst_element_factory_make_or_warn ("videotestsrc", NULL);
g_object_set (G_OBJECT (videotestsrc), "pattern", pattern, NULL); g_object_set (G_OBJECT (videotestsrc), "pattern", pattern, NULL);
gnlsource = new_gnl_src (name, start, duration, priority); nlesource = new_nle_src (name, start, duration, priority);
g_object_set (G_OBJECT (gnlsource), "caps", caps, NULL); g_object_set (G_OBJECT (nlesource), "caps", caps, NULL);
gst_caps_unref (caps); gst_caps_unref (caps);
gst_bin_add (GST_BIN (gnlsource), videotestsrc); gst_bin_add (GST_BIN (nlesource), videotestsrc);
return gnlsource; return nlesource;
} }
GstElement * GstElement *
videotest_gnl_src_full (const gchar * name, guint64 start, gint64 duration, videotest_nle_src_full (const gchar * name, guint64 start, gint64 duration,
guint64 inpoint, gint pattern, guint priority) guint64 inpoint, gint pattern, guint priority)
{ {
GstElement *gnls; GstElement *nles;
gnls = videotest_gnl_src (name, start, duration, pattern, priority); nles = videotest_nle_src (name, start, duration, pattern, priority);
if (gnls) { if (nles) {
g_object_set (G_OBJECT (gnls), "inpoint", inpoint, NULL); g_object_set (G_OBJECT (nles), "inpoint", inpoint, NULL);
} }
return gnls; return nles;
} }
GstElement * GstElement *
videotest_in_bin_gnl_src (const gchar * name, guint64 start, gint64 duration, videotest_in_bin_nle_src (const gchar * name, guint64 start, gint64 duration,
gint pattern, guint priority) gint pattern, guint priority)
{ {
GstElement *gnlsource = NULL; GstElement *nlesource = NULL;
GstElement *videotestsrc = NULL; GstElement *videotestsrc = NULL;
GstElement *bin = NULL; GstElement *bin = NULL;
GstElement *alpha = NULL; GstElement *alpha = NULL;
@ -238,7 +238,7 @@ videotest_in_bin_gnl_src (const gchar * name, guint64 start, gint64 duration,
g_object_set (G_OBJECT (videotestsrc), "pattern", pattern, NULL); g_object_set (G_OBJECT (videotestsrc), "pattern", pattern, NULL);
bin = gst_bin_new (NULL); bin = gst_bin_new (NULL);
gnlsource = new_gnl_src (name, start, duration, priority); nlesource = new_nle_src (name, start, duration, priority);
gst_bin_add (GST_BIN (bin), videotestsrc); gst_bin_add (GST_BIN (bin), videotestsrc);
gst_bin_add (GST_BIN (bin), alpha); gst_bin_add (GST_BIN (bin), alpha);
@ -246,7 +246,7 @@ videotest_in_bin_gnl_src (const gchar * name, guint64 start, gint64 duration,
gst_element_link_pads_full (videotestsrc, "src", alpha, "sink", gst_element_link_pads_full (videotestsrc, "src", alpha, "sink",
GST_PAD_LINK_CHECK_NOTHING); GST_PAD_LINK_CHECK_NOTHING);
gst_bin_add (GST_BIN (gnlsource), bin); gst_bin_add (GST_BIN (nlesource), bin);
srcpad = gst_element_get_static_pad (alpha, "src"); srcpad = gst_element_get_static_pad (alpha, "src");
@ -254,7 +254,7 @@ videotest_in_bin_gnl_src (const gchar * name, guint64 start, gint64 duration,
gst_object_unref (srcpad); gst_object_unref (srcpad);
return gnlsource; return nlesource;
} }
GstElement * GstElement *
@ -272,7 +272,7 @@ audiotest_bin_src (const gchar * name, guint64 start,
audiotestsrc = gst_element_factory_make_or_warn ("audiotestsrc", NULL); audiotestsrc = gst_element_factory_make_or_warn ("audiotestsrc", NULL);
identity = gst_element_factory_make_or_warn ("identity", NULL); identity = gst_element_factory_make_or_warn ("identity", NULL);
bin = gst_bin_new (NULL); bin = gst_bin_new (NULL);
source = new_gnl_src (name, start, duration, priority); source = new_nle_src (name, start, duration, priority);
audioconvert = gst_element_factory_make_or_warn ("audioconvert", NULL); audioconvert = gst_element_factory_make_or_warn ("audioconvert", NULL);
if (intaudio) if (intaudio)
@ -302,18 +302,18 @@ GstElement *
new_operation (const gchar * name, const gchar * factory, guint64 start, new_operation (const gchar * name, const gchar * factory, guint64 start,
gint64 duration, guint priority) gint64 duration, guint priority)
{ {
GstElement *gnloperation = NULL; GstElement *nleoperation = NULL;
GstElement *operation = NULL; GstElement *operation = NULL;
operation = gst_element_factory_make_or_warn (factory, NULL); operation = gst_element_factory_make_or_warn (factory, NULL);
gnloperation = gst_element_factory_make_or_warn ("gnloperation", name); nleoperation = gst_element_factory_make_or_warn ("nleoperation", name);
g_object_set (G_OBJECT (gnloperation), g_object_set (G_OBJECT (nleoperation),
"start", start, "duration", duration, "priority", priority, NULL); "start", start, "duration", duration, "priority", priority, NULL);
gst_bin_add (GST_BIN (gnloperation), operation); gst_bin_add (GST_BIN (nleoperation), operation);
return gnloperation; return nleoperation;
} }
@ -376,7 +376,7 @@ commit_and_wait (GstElement * comp, gboolean * ret)
} }
gboolean gboolean
gnl_composition_remove (GstBin * comp, GstElement * object) nle_composition_remove (GstBin * comp, GstElement * object)
{ {
gboolean ret; gboolean ret;
@ -390,7 +390,7 @@ gnl_composition_remove (GstBin * comp, GstElement * object)
} }
gboolean gboolean
gnl_composition_add (GstBin * comp, GstElement * object) nle_composition_add (GstBin * comp, GstElement * object)
{ {
return gst_bin_add (comp, object); return gst_bin_add (comp, object);
} }

View file

@ -1,5 +1,6 @@
#include <gst/check/gstcheck.h> #include <gst/check/gstcheck.h>
#include <ges/ges.h>
#define fail_error_message(msg) \ #define fail_error_message(msg) \
G_STMT_START { \ G_STMT_START { \
@ -53,13 +54,13 @@ typedef struct _CollectStructure {
void poll_the_bus(GstBus *bus); void poll_the_bus(GstBus *bus);
void composition_pad_added_cb (GstElement *composition, GstPad *pad, CollectStructure * collect); void composition_pad_added_cb (GstElement *composition, GstPad *pad, CollectStructure * collect);
GstPadProbeReturn sinkpad_probe (GstPad *sinkpad, GstPadProbeInfo * info, CollectStructure * collect); GstPadProbeReturn sinkpad_probe (GstPad *sinkpad, GstPadProbeInfo * info, CollectStructure * collect);
GstElement *videotest_gnl_src (const gchar * name, guint64 start, gint64 duration, GstElement *videotest_nle_src (const gchar * name, guint64 start, gint64 duration,
gint pattern, guint priority); gint pattern, guint priority);
GstElement * videotest_gnl_src_full (const gchar * name, guint64 start, gint64 duration, GstElement * videotest_nle_src_full (const gchar * name, guint64 start, gint64 duration,
guint64 inpoint, guint64 inpoint,
gint pattern, guint priority); gint pattern, guint priority);
GstElement * GstElement *
videotest_in_bin_gnl_src (const gchar * name, guint64 start, gint64 duration, gint pattern, guint priority); videotest_in_bin_nle_src (const gchar * name, guint64 start, gint64 duration, gint pattern, guint priority);
GstElement * GstElement *
audiotest_bin_src (const gchar * name, guint64 start, audiotest_bin_src (const gchar * name, guint64 start,
gint64 duration, guint priority, gboolean intaudio); gint64 duration, guint priority, gboolean intaudio);
@ -73,5 +74,5 @@ Segment *
segment_new (gdouble rate, GstFormat format, gint64 start, gint64 stop, gint64 position); segment_new (gdouble rate, GstFormat format, gint64 start, gint64 stop, gint64 position);
void commit_and_wait (GstElement *comp, gboolean *ret); void commit_and_wait (GstElement *comp, gboolean *ret);
gboolean gnl_composition_remove (GstBin * comp, GstElement * object); gboolean nle_composition_remove (GstBin * comp, GstElement * object);
gboolean gnl_composition_add (GstBin * comp, GstElement * object); gboolean nle_composition_add (GstBin * comp, GstElement * object);

View file

@ -151,7 +151,7 @@ GST_START_TEST (test_one_space_another)
GList *segments = NULL; GList *segments = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
fail_if (comp == NULL); fail_if (comp == NULL);
@ -168,7 +168,7 @@ GST_START_TEST (test_one_space_another)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source1 = videotest_gnl_src ("source1", 0, 1 * GST_SECOND, 2, 1); source1 = videotest_nle_src ("source1", 0, 1 * GST_SECOND, 2, 1);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -178,14 +178,14 @@ GST_START_TEST (test_one_space_another)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source2 = videotest_gnl_src ("source2", 2 * GST_SECOND, 1 * GST_SECOND, 3, 1); source2 = videotest_nle_src ("source2", 2 * GST_SECOND, 1 * GST_SECOND, 3, 1);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 2 * GST_SECOND, 3 * GST_SECOND, check_start_stop_duration (source2, 2 * GST_SECOND, 3 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
/* Add one source */ /* Add one source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
GST_ERROR ("doing one commit"); GST_ERROR ("doing one commit");
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -193,7 +193,7 @@ GST_START_TEST (test_one_space_another)
/* Second source */ /* Second source */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
ASSERT_OBJECT_REFCOUNT (source2, "source2", 1); ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
@ -201,14 +201,14 @@ GST_START_TEST (test_one_space_another)
/* Remove first source */ /* Remove first source */
gst_object_ref (source1); gst_object_ref (source1);
gnl_composition_remove (GST_BIN (comp), source1); nle_composition_remove (GST_BIN (comp), source1);
check_start_stop_duration (comp, 2 * GST_SECOND, 3 * GST_SECOND, check_start_stop_duration (comp, 2 * GST_SECOND, 3 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
ASSERT_OBJECT_REFCOUNT (source1, "source1", 1); ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
/* Re-add first source */ /* Re-add first source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND); check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
gst_object_unref (source1); gst_object_unref (source1);
@ -230,7 +230,7 @@ GST_START_TEST (test_one_default_another)
GList *segments = NULL; GList *segments = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
fail_if (comp == NULL); fail_if (comp == NULL);
@ -251,7 +251,7 @@ GST_START_TEST (test_one_default_another)
*/ */
defaultsrc = defaultsrc =
videotest_gnl_src ("defaultsrc", 0, 5 * GST_SECOND, 2, G_MAXUINT32); videotest_nle_src ("defaultsrc", 0, 5 * GST_SECOND, 2, G_MAXUINT32);
g_object_set (defaultsrc, "expandable", TRUE, NULL); g_object_set (defaultsrc, "expandable", TRUE, NULL);
fail_if (defaultsrc == NULL); fail_if (defaultsrc == NULL);
check_start_stop_duration (defaultsrc, 0, 5 * GST_SECOND, 5 * GST_SECOND); check_start_stop_duration (defaultsrc, 0, 5 * GST_SECOND, 5 * GST_SECOND);
@ -262,7 +262,7 @@ GST_START_TEST (test_one_default_another)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source1 = videotest_gnl_src ("source1", 1 * GST_SECOND, 1 * GST_SECOND, 3, 1); source1 = videotest_nle_src ("source1", 1 * GST_SECOND, 1 * GST_SECOND, 3, 1);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, GST_SECOND, 2 * GST_SECOND, check_start_stop_duration (source1, GST_SECOND, 2 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
@ -273,7 +273,7 @@ GST_START_TEST (test_one_default_another)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source2 = videotest_gnl_src ("source2", 3 * GST_SECOND, 1 * GST_SECOND, 2, 1); source2 = videotest_nle_src ("source2", 3 * GST_SECOND, 1 * GST_SECOND, 2, 1);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 3 * GST_SECOND, 4 * GST_SECOND, check_start_stop_duration (source2, 3 * GST_SECOND, 4 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
@ -284,7 +284,7 @@ GST_START_TEST (test_one_default_another)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source3 = videotest_gnl_src ("source3", 4 * GST_SECOND, 1 * GST_SECOND, 2, 1); source3 = videotest_nle_src ("source3", 4 * GST_SECOND, 1 * GST_SECOND, 2, 1);
fail_if (source3 == NULL); fail_if (source3 == NULL);
check_start_stop_duration (source3, 4 * GST_SECOND, 5 * GST_SECOND, check_start_stop_duration (source3, 4 * GST_SECOND, 5 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
@ -292,14 +292,14 @@ GST_START_TEST (test_one_default_another)
/* Add one source */ /* Add one source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, GST_SECOND, 2 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (comp, GST_SECOND, 2 * GST_SECOND, 1 * GST_SECOND);
ASSERT_OBJECT_REFCOUNT (source1, "source1", 1); ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
/* defaultsrc source */ /* defaultsrc source */
gnl_composition_add (GST_BIN (comp), defaultsrc); nle_composition_add (GST_BIN (comp), defaultsrc);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
check_start_stop_duration (defaultsrc, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (defaultsrc, 0, 2 * GST_SECOND, 2 * GST_SECOND);
@ -308,10 +308,10 @@ GST_START_TEST (test_one_default_another)
/* Second source */ /* Second source */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
ASSERT_OBJECT_REFCOUNT (source2, "source2", 1); ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
/* Third source */ /* Third source */
gnl_composition_add (GST_BIN (comp), source3); nle_composition_add (GST_BIN (comp), source3);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
fail_unless (ret); fail_unless (ret);
check_start_stop_duration (comp, 0, 5 * GST_SECOND, 5 * GST_SECOND); check_start_stop_duration (comp, 0, 5 * GST_SECOND, 5 * GST_SECOND);
@ -347,7 +347,7 @@ GST_START_TEST (test_one_expandable_another)
gboolean ret = FALSE; gboolean ret = FALSE;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
fail_if (comp == NULL); fail_if (comp == NULL);
@ -366,7 +366,7 @@ GST_START_TEST (test_one_expandable_another)
Priority : 1000 Priority : 1000
*/ */
defaultsrc = videotest_gnl_src ("defaultsrc", 0, 5 * GST_SECOND, 2, 1000); defaultsrc = videotest_nle_src ("defaultsrc", 0, 5 * GST_SECOND, 2, 1000);
g_object_set (defaultsrc, "expandable", TRUE, NULL); g_object_set (defaultsrc, "expandable", TRUE, NULL);
fail_if (defaultsrc == NULL); fail_if (defaultsrc == NULL);
check_start_stop_duration (defaultsrc, 0, 5 * GST_SECOND, 5 * GST_SECOND); check_start_stop_duration (defaultsrc, 0, 5 * GST_SECOND, 5 * GST_SECOND);
@ -377,7 +377,7 @@ GST_START_TEST (test_one_expandable_another)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source1 = videotest_gnl_src ("source1", 1 * GST_SECOND, 1 * GST_SECOND, 3, 1); source1 = videotest_nle_src ("source1", 1 * GST_SECOND, 1 * GST_SECOND, 3, 1);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, GST_SECOND, 2 * GST_SECOND, check_start_stop_duration (source1, GST_SECOND, 2 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
@ -388,7 +388,7 @@ GST_START_TEST (test_one_expandable_another)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source2 = videotest_gnl_src ("source2", 3 * GST_SECOND, 1 * GST_SECOND, 2, 1); source2 = videotest_nle_src ("source2", 3 * GST_SECOND, 1 * GST_SECOND, 2, 1);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 3 * GST_SECOND, 4 * GST_SECOND, check_start_stop_duration (source2, 3 * GST_SECOND, 4 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
@ -399,7 +399,7 @@ GST_START_TEST (test_one_expandable_another)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source3 = videotest_gnl_src ("source3", 4 * GST_SECOND, 1 * GST_SECOND, 2, 1); source3 = videotest_nle_src ("source3", 4 * GST_SECOND, 1 * GST_SECOND, 2, 1);
fail_if (source3 == NULL); fail_if (source3 == NULL);
check_start_stop_duration (source3, 4 * GST_SECOND, 5 * GST_SECOND, check_start_stop_duration (source3, 4 * GST_SECOND, 5 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
@ -407,7 +407,7 @@ GST_START_TEST (test_one_expandable_another)
/* Add one source */ /* Add one source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, GST_SECOND, 2 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (comp, GST_SECOND, 2 * GST_SECOND, 1 * GST_SECOND);
@ -415,7 +415,7 @@ GST_START_TEST (test_one_expandable_another)
/* defaultsrc source */ /* defaultsrc source */
gnl_composition_add (GST_BIN (comp), defaultsrc); nle_composition_add (GST_BIN (comp), defaultsrc);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
check_start_stop_duration (defaultsrc, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (defaultsrc, 0, 2 * GST_SECOND, 2 * GST_SECOND);
@ -424,7 +424,7 @@ GST_START_TEST (test_one_expandable_another)
/* Second source */ /* Second source */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 4 * GST_SECOND, 4 * GST_SECOND); check_start_stop_duration (comp, 0, 4 * GST_SECOND, 4 * GST_SECOND);
check_start_stop_duration (defaultsrc, 0, 4 * GST_SECOND, 4 * GST_SECOND); check_start_stop_duration (defaultsrc, 0, 4 * GST_SECOND, 4 * GST_SECOND);
@ -434,7 +434,7 @@ GST_START_TEST (test_one_expandable_another)
/* Third source */ /* Third source */
gnl_composition_add (GST_BIN (comp), source3); nle_composition_add (GST_BIN (comp), source3);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 5 * GST_SECOND, 5 * GST_SECOND); check_start_stop_duration (comp, 0, 5 * GST_SECOND, 5 * GST_SECOND);
check_start_stop_duration (defaultsrc, 0, 5 * GST_SECOND, 5 * GST_SECOND); check_start_stop_duration (defaultsrc, 0, 5 * GST_SECOND, 5 * GST_SECOND);
@ -479,7 +479,7 @@ GST_START_TEST (test_renegotiation)
pipeline = gst_pipeline_new ("test_pipeline"); pipeline = gst_pipeline_new ("test_pipeline");
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
fail_if (comp == NULL); fail_if (comp == NULL);
@ -518,7 +518,7 @@ GST_START_TEST (test_renegotiation)
/* Add one source */ /* Add one source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -526,7 +526,7 @@ GST_START_TEST (test_renegotiation)
/* Second source */ /* Second source */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
@ -535,7 +535,7 @@ GST_START_TEST (test_renegotiation)
/* Third source */ /* Third source */
gnl_composition_add (GST_BIN (comp), source3); nle_composition_add (GST_BIN (comp), source3);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND); check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
@ -685,7 +685,7 @@ GST_START_TEST (test_one_bin_space_another)
GList *segments = NULL; GList *segments = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
fail_if (comp == NULL); fail_if (comp == NULL);
@ -695,7 +695,7 @@ GST_START_TEST (test_one_bin_space_another)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source1 = videotest_in_bin_gnl_src ("source1", 0, 1 * GST_SECOND, 3, 1); source1 = videotest_in_bin_nle_src ("source1", 0, 1 * GST_SECOND, 3, 1);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -706,7 +706,7 @@ GST_START_TEST (test_one_bin_space_another)
Priority : 1 Priority : 1
*/ */
source2 = source2 =
videotest_in_bin_gnl_src ("source2", 2 * GST_SECOND, 1 * GST_SECOND, 2, videotest_in_bin_nle_src ("source2", 2 * GST_SECOND, 1 * GST_SECOND, 2,
1); 1);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 2 * GST_SECOND, 3 * GST_SECOND, check_start_stop_duration (source2, 2 * GST_SECOND, 3 * GST_SECOND,
@ -714,26 +714,26 @@ GST_START_TEST (test_one_bin_space_another)
/* Add one source */ /* Add one source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND);
/* Second source */ /* Second source */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND); check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
/* Remove second source */ /* Remove second source */
gst_object_ref (source1); gst_object_ref (source1);
gnl_composition_remove (GST_BIN (comp), source1); nle_composition_remove (GST_BIN (comp), source1);
check_start_stop_duration (comp, 2 * GST_SECOND, 3 * GST_SECOND, check_start_stop_duration (comp, 2 * GST_SECOND, 3 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
/* Re-add second source */ /* Re-add second source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND); check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
gst_object_unref (source1); gst_object_unref (source1);
@ -754,7 +754,7 @@ GST_START_TEST (test_one_above_another)
GList *segments = NULL; GList *segments = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
fail_if (comp == NULL); fail_if (comp == NULL);
@ -764,7 +764,7 @@ GST_START_TEST (test_one_above_another)
Duration : 2s Duration : 2s
Priority : 2 Priority : 2
*/ */
source1 = videotest_gnl_src ("source1", 0, 2 * GST_SECOND, 3, 2); source1 = videotest_nle_src ("source1", 0, 2 * GST_SECOND, 3, 2);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND);
@ -774,33 +774,33 @@ GST_START_TEST (test_one_above_another)
Duration : 2s Duration : 2s
Priority : 1 Priority : 1
*/ */
source2 = videotest_gnl_src ("source2", 1 * GST_SECOND, 2 * GST_SECOND, 2, 1); source2 = videotest_nle_src ("source2", 1 * GST_SECOND, 2 * GST_SECOND, 2, 1);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 1 * GST_SECOND, 3 * GST_SECOND, check_start_stop_duration (source2, 1 * GST_SECOND, 3 * GST_SECOND,
2 * GST_SECOND); 2 * GST_SECOND);
/* Add one source */ /* Add one source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
/* Second source */ /* Second source */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND); check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
/* Remove second source */ /* Remove second source */
gst_object_ref (source1); gst_object_ref (source1);
gnl_composition_remove (GST_BIN (comp), source1); nle_composition_remove (GST_BIN (comp), source1);
check_start_stop_duration (comp, 1 * GST_SECOND, 3 * GST_SECOND, check_start_stop_duration (comp, 1 * GST_SECOND, 3 * GST_SECOND,
2 * GST_SECOND); 2 * GST_SECOND);
/* Re-add second source */ /* Re-add second source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND); check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
gst_object_unref (source1); gst_object_unref (source1);
@ -824,6 +824,7 @@ gnonlin_suite (void)
Suite *s = suite_create ("gnonlin-complex"); Suite *s = suite_create ("gnonlin-complex");
TCase *tc_chain = tcase_create ("complex"); TCase *tc_chain = tcase_create ("complex");
ges_init ();
suite_add_tcase (s, tc_chain); suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_one_space_another); tcase_add_test (tc_chain, test_one_space_another);

View file

@ -47,7 +47,7 @@ GST_START_TEST (test_change_object_start_stop_in_current_stack)
pipeline = gst_pipeline_new ("test_pipeline"); pipeline = gst_pipeline_new ("test_pipeline");
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
@ -63,7 +63,7 @@ GST_START_TEST (test_change_object_start_stop_in_current_stack)
Priority : 2 Priority : 2
*/ */
source1 = videotest_gnl_src ("source1", 0, 2 * GST_SECOND, 2, 2); source1 = videotest_nle_src ("source1", 0, 2 * GST_SECOND, 2, 2);
srcpad = gst_element_get_static_pad (source1, "src"); srcpad = gst_element_get_static_pad (source1, "src");
gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT_UPSTREAM, gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT_UPSTREAM,
(GstPadProbeCallback) on_source1_pad_event_cb, NULL, NULL); (GstPadProbeCallback) on_source1_pad_event_cb, NULL, NULL);
@ -73,7 +73,7 @@ GST_START_TEST (test_change_object_start_stop_in_current_stack)
Priority = G_MAXUINT32 Priority = G_MAXUINT32
*/ */
def = def =
videotest_gnl_src ("default", 0 * GST_SECOND, 0 * GST_SECOND, 2, videotest_nle_src ("default", 0 * GST_SECOND, 0 * GST_SECOND, 2,
G_MAXUINT32); G_MAXUINT32);
g_object_set (def, "expandable", TRUE, NULL); g_object_set (def, "expandable", TRUE, NULL);
@ -82,8 +82,8 @@ GST_START_TEST (test_change_object_start_stop_in_current_stack)
/* Add source 1 */ /* Add source 1 */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
gnl_composition_add (GST_BIN (comp), def); nle_composition_add (GST_BIN (comp), def);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND);
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
@ -137,20 +137,13 @@ GST_START_TEST (test_change_object_start_stop_in_current_stack)
/* keep an extra ref to source1 as we remove it from the bin */ /* keep an extra ref to source1 as we remove it from the bin */
gst_object_ref (source1); gst_object_ref (source1);
fail_unless (gnl_composition_remove (GST_BIN (comp), source1)); fail_unless (nle_composition_remove (GST_BIN (comp), source1));
g_object_set (source1, "start", (guint64) 0 * GST_SECOND, NULL); g_object_set (source1, "start", (guint64) 0 * GST_SECOND, NULL);
/* add the source again and check that the ghostpad is added again */ /* add the source again and check that the ghostpad is added again */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
gst_object_unref (source1); gst_object_unref (source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
g_mutex_lock (&pad_added_lock);
g_cond_wait (&pad_added_cond, &pad_added_lock);
fail_unless_equals_int (composition_pad_added, 2);
fail_unless_equals_int (composition_pad_removed, 1);
g_mutex_unlock (&pad_added_lock);
seek_events_before = seek_events;
g_object_set (source1, "duration", (guint64) 1 * GST_SECOND, NULL); g_object_set (source1, "duration", (guint64) 1 * GST_SECOND, NULL);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
@ -177,16 +170,16 @@ GST_START_TEST (test_remove_invalid_object)
GstBin *composition; GstBin *composition;
GstElement *source1, *source2; GstElement *source1, *source2;
composition = GST_BIN (gst_element_factory_make ("gnlcomposition", composition = GST_BIN (gst_element_factory_make ("nlecomposition",
"composition")); "composition"));
gst_element_set_state (GST_ELEMENT (composition), GST_STATE_READY); gst_element_set_state (GST_ELEMENT (composition), GST_STATE_READY);
source1 = gst_element_factory_make ("gnlsource", "source1"); source1 = gst_element_factory_make ("nlesource", "source1");
source2 = gst_element_factory_make ("gnlsource", "source2"); source2 = gst_element_factory_make ("nlesource", "source2");
gnl_composition_add (composition, source1); nle_composition_add (composition, source1);
gnl_composition_remove (composition, source2); nle_composition_remove (composition, source2);
fail_unless (gnl_composition_remove (composition, source1)); fail_unless (nle_composition_remove (composition, source1));
gst_element_set_state (GST_ELEMENT (composition), GST_STATE_NULL); gst_element_set_state (GST_ELEMENT (composition), GST_STATE_NULL);
gst_object_unref (composition); gst_object_unref (composition);
@ -198,21 +191,21 @@ GST_END_TEST;
GST_START_TEST (test_dispose_on_commit) GST_START_TEST (test_dispose_on_commit)
{ {
GstElement *composition; GstElement *composition;
GstElement *gnlsource; GstElement *nlesource;
GstElement *audiotestsrc; GstElement *audiotestsrc;
GstElement *pipeline, *fakesink; GstElement *pipeline, *fakesink;
gboolean ret; gboolean ret;
composition = gst_element_factory_make ("gnlcomposition", "composition"); composition = gst_element_factory_make ("nlecomposition", "composition");
pipeline = GST_ELEMENT (gst_pipeline_new (NULL)); pipeline = GST_ELEMENT (gst_pipeline_new (NULL));
fakesink = gst_element_factory_make ("fakesink", NULL); fakesink = gst_element_factory_make ("fakesink", NULL);
gnlsource = gst_element_factory_make ("gnlsource", "gnlsource1"); nlesource = gst_element_factory_make ("nlesource", "nlesource1");
audiotestsrc = gst_element_factory_make ("audiotestsrc", "audiotestsrc1"); audiotestsrc = gst_element_factory_make ("audiotestsrc", "audiotestsrc1");
gst_bin_add (GST_BIN (gnlsource), audiotestsrc); gst_bin_add (GST_BIN (nlesource), audiotestsrc);
g_object_set (gnlsource, "start", (guint64) 0 * GST_SECOND, g_object_set (nlesource, "start", (guint64) 0 * GST_SECOND,
"duration", 10 * GST_SECOND, "inpoint", (guint64) 0, "priority", 1, NULL); "duration", 10 * GST_SECOND, "inpoint", (guint64) 0, "priority", 1, NULL);
fail_unless (gnl_composition_add (GST_BIN (composition), gnlsource)); fail_unless (nle_composition_add (GST_BIN (composition), nlesource));
gst_bin_add_many (GST_BIN (pipeline), composition, fakesink, NULL); gst_bin_add_many (GST_BIN (pipeline), composition, fakesink, NULL);
fail_unless (gst_element_link (composition, fakesink) == TRUE); fail_unless (gst_element_link (composition, fakesink) == TRUE);
@ -231,11 +224,11 @@ GST_START_TEST (test_simple_adder)
GstBus *bus; GstBus *bus;
GstMessage *message; GstMessage *message;
GstElement *pipeline; GstElement *pipeline;
GstElement *gnl_adder; GstElement *nle_adder;
GstElement *composition; GstElement *composition;
GstElement *adder, *fakesink; GstElement *adder, *fakesink;
GstClockTime start_playing_time; GstClockTime start_playing_time;
GstElement *gnlsource1, *gnlsource2; GstElement *nlesource1, *nlesource2;
GstElement *audiotestsrc1, *audiotestsrc2; GstElement *audiotestsrc1, *audiotestsrc2;
gboolean carry_on = TRUE, ret; gboolean carry_on = TRUE, ret;
@ -245,34 +238,34 @@ GST_START_TEST (test_simple_adder)
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
GST_ERROR ("Pipeline refcounts: %i", ((GObject *) pipeline)->ref_count); GST_ERROR ("Pipeline refcounts: %i", ((GObject *) pipeline)->ref_count);
composition = gst_element_factory_make ("gnlcomposition", "composition"); composition = gst_element_factory_make ("nlecomposition", "composition");
gst_element_set_state (composition, GST_STATE_READY); gst_element_set_state (composition, GST_STATE_READY);
fakesink = gst_element_factory_make ("fakesink", NULL); fakesink = gst_element_factory_make ("fakesink", NULL);
/* gnl_adder */ /* nle_adder */
gnl_adder = gst_element_factory_make ("gnloperation", "gnl_adder"); nle_adder = gst_element_factory_make ("nleoperation", "nle_adder");
adder = gst_element_factory_make ("adder", "adder"); adder = gst_element_factory_make ("adder", "adder");
fail_unless (adder != NULL); fail_unless (adder != NULL);
gst_bin_add (GST_BIN (gnl_adder), adder); gst_bin_add (GST_BIN (nle_adder), adder);
g_object_set (gnl_adder, "start", (guint64) 0 * GST_SECOND, g_object_set (nle_adder, "start", (guint64) 0 * GST_SECOND,
"duration", total_time, "inpoint", (guint64) 0 * GST_SECOND, "duration", total_time, "inpoint", (guint64) 0 * GST_SECOND,
"priority", 0, NULL); "priority", 0, NULL);
gnl_composition_add (GST_BIN (composition), gnl_adder); nle_composition_add (GST_BIN (composition), nle_adder);
GST_ERROR ("Pipeline refcounts: %i", ((GObject *) pipeline)->ref_count); GST_ERROR ("Pipeline refcounts: %i", ((GObject *) pipeline)->ref_count);
/* source 1 */ /* source 1 */
gnlsource1 = gst_element_factory_make ("gnlsource", "gnlsource1"); nlesource1 = gst_element_factory_make ("nlesource", "nlesource1");
audiotestsrc1 = gst_element_factory_make ("audiotestsrc", "audiotestsrc1"); audiotestsrc1 = gst_element_factory_make ("audiotestsrc", "audiotestsrc1");
gst_bin_add (GST_BIN (gnlsource1), audiotestsrc1); gst_bin_add (GST_BIN (nlesource1), audiotestsrc1);
g_object_set (gnlsource1, "start", (guint64) 0 * GST_SECOND, g_object_set (nlesource1, "start", (guint64) 0 * GST_SECOND,
"duration", total_time / 2, "inpoint", (guint64) 0, "priority", 1, NULL); "duration", total_time / 2, "inpoint", (guint64) 0, "priority", 1, NULL);
fail_unless (gnl_composition_add (GST_BIN (composition), gnlsource1)); fail_unless (nle_composition_add (GST_BIN (composition), nlesource1));
/* gnlsource2 */ /* nlesource2 */
gnlsource2 = gst_element_factory_make ("gnlsource", "gnlsource2"); nlesource2 = gst_element_factory_make ("nlesource", "nlesource2");
audiotestsrc2 = gst_element_factory_make ("audiotestsrc", "audiotestsrc2"); audiotestsrc2 = gst_element_factory_make ("audiotestsrc", "audiotestsrc2");
gst_bin_add (GST_BIN (gnlsource2), GST_ELEMENT (audiotestsrc2)); gst_bin_add (GST_BIN (nlesource2), GST_ELEMENT (audiotestsrc2));
g_object_set (gnlsource2, "start", (guint64) 0 * GST_SECOND, g_object_set (nlesource2, "start", (guint64) 0 * GST_SECOND,
"duration", total_time, "inpoint", (guint64) 0 * GST_SECOND, "priority", "duration", total_time, "inpoint", (guint64) 0 * GST_SECOND, "priority",
2, NULL); 2, NULL);
@ -281,7 +274,7 @@ GST_START_TEST (test_simple_adder)
GST_ERROR ("Pipeline refcounts: %i", ((GObject *) pipeline)->ref_count); GST_ERROR ("Pipeline refcounts: %i", ((GObject *) pipeline)->ref_count);
fail_unless (gnl_composition_add (GST_BIN (composition), gnlsource2)); fail_unless (nle_composition_add (GST_BIN (composition), nlesource2));
fail_unless (gst_element_link (composition, fakesink) == TRUE); fail_unless (gst_element_link (composition, fakesink) == TRUE);
GST_DEBUG ("Setting pipeline to PLAYING"); GST_DEBUG ("Setting pipeline to PLAYING");
@ -298,7 +291,7 @@ GST_START_TEST (test_simple_adder)
fail_error_message (message); fail_error_message (message);
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline), GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline),
GST_DEBUG_GRAPH_SHOW_ALL, "gnl-simple-adder-test-play"); GST_DEBUG_GRAPH_SHOW_ALL, "nle-simple-adder-test-play");
/* Now play the 10 second composition */ /* Now play the 10 second composition */
start_playing_time = gst_util_get_timestamp (); start_playing_time = gst_util_get_timestamp ();
@ -309,7 +302,7 @@ GST_START_TEST (test_simple_adder)
GST_ERROR ("No EOS found after %" GST_TIME_FORMAT " sec", GST_ERROR ("No EOS found after %" GST_TIME_FORMAT " sec",
GST_TIME_ARGS ((total_time / GST_SECOND) + 1)); GST_TIME_ARGS ((total_time / GST_SECOND) + 1));
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline), GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline),
GST_DEBUG_GRAPH_SHOW_ALL, "gnl-simple-adder-test-fail"); GST_DEBUG_GRAPH_SHOW_ALL, "nle-simple-adder-test-fail");
fail_unless ("No EOS received" == NULL); fail_unless ("No EOS received" == NULL);
@ -351,9 +344,10 @@ GST_END_TEST;
static Suite * static Suite *
gnonlin_suite (void) gnonlin_suite (void)
{ {
Suite *s = suite_create ("gnlcomposition"); Suite *s = suite_create ("nlecomposition");
TCase *tc_chain = tcase_create ("gnlcomposition"); TCase *tc_chain = tcase_create ("nlecomposition");
ges_init ();
suite_add_tcase (s, tc_chain); suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_change_object_start_stop_in_current_stack); tcase_add_test (tc_chain, test_change_object_start_stop_in_current_stack);

View file

@ -131,7 +131,7 @@ GST_START_TEST (test_simple_operation)
GList *segments = NULL; GList *segments = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
/* TOPOLOGY /* TOPOLOGY
@ -149,7 +149,7 @@ GST_START_TEST (test_simple_operation)
Priority : 1 Priority : 1
*/ */
source = videotest_gnl_src ("source", 0, 3 * GST_SECOND, 2, 1); source = videotest_nle_src ("source", 0, 3 * GST_SECOND, 2, 1);
fail_if (source == NULL); fail_if (source == NULL);
/* /*
@ -166,7 +166,7 @@ GST_START_TEST (test_simple_operation)
ASSERT_OBJECT_REFCOUNT (source, "source", 1); ASSERT_OBJECT_REFCOUNT (source, "source", 1);
ASSERT_OBJECT_REFCOUNT (oper, "oper", 1); ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
gnl_composition_add (GST_BIN (comp), source); nle_composition_add (GST_BIN (comp), source);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND); check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
@ -174,7 +174,7 @@ GST_START_TEST (test_simple_operation)
/* Add operaton */ /* Add operaton */
gnl_composition_add (GST_BIN (comp), oper); nle_composition_add (GST_BIN (comp), oper);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND); check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
@ -183,14 +183,14 @@ GST_START_TEST (test_simple_operation)
/* remove source */ /* remove source */
gst_object_ref (source); gst_object_ref (source);
gnl_composition_remove (GST_BIN (comp), source); nle_composition_remove (GST_BIN (comp), source);
check_start_stop_duration (comp, 1 * GST_SECOND, 2 * GST_SECOND, check_start_stop_duration (comp, 1 * GST_SECOND, 2 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
ASSERT_OBJECT_REFCOUNT (source, "source", 1); ASSERT_OBJECT_REFCOUNT (source, "source", 1);
/* re-add source */ /* re-add source */
gnl_composition_add (GST_BIN (comp), source); nle_composition_add (GST_BIN (comp), source);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND); check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
gst_object_unref (source); gst_object_unref (source);
@ -219,7 +219,7 @@ GST_START_TEST (test_pyramid_operations)
GList *segments = NULL; GList *segments = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
/* /*
@ -229,7 +229,7 @@ GST_START_TEST (test_pyramid_operations)
Priority : 2 Priority : 2
*/ */
source = videotest_gnl_src ("source", 0, 10 * GST_SECOND, 2, 2); source = videotest_nle_src ("source", 0, 10 * GST_SECOND, 2, 2);
/* /*
operation1 operation1
@ -256,7 +256,7 @@ GST_START_TEST (test_pyramid_operations)
ASSERT_OBJECT_REFCOUNT (oper1, "oper1", 1); ASSERT_OBJECT_REFCOUNT (oper1, "oper1", 1);
ASSERT_OBJECT_REFCOUNT (oper2, "oper2", 1); ASSERT_OBJECT_REFCOUNT (oper2, "oper2", 1);
gnl_composition_add (GST_BIN (comp), source); nle_composition_add (GST_BIN (comp), source);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (source, 0, 10 * GST_SECOND, 10 * GST_SECOND); check_start_stop_duration (source, 0, 10 * GST_SECOND, 10 * GST_SECOND);
check_start_stop_duration (comp, 0, 10 * GST_SECOND, 10 * GST_SECOND); check_start_stop_duration (comp, 0, 10 * GST_SECOND, 10 * GST_SECOND);
@ -265,7 +265,7 @@ GST_START_TEST (test_pyramid_operations)
/* Add operation 1 */ /* Add operation 1 */
gnl_composition_add (GST_BIN (comp), oper1); nle_composition_add (GST_BIN (comp), oper1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (oper1, 4 * GST_SECOND, 6 * GST_SECOND, check_start_stop_duration (oper1, 4 * GST_SECOND, 6 * GST_SECOND,
2 * GST_SECOND); 2 * GST_SECOND);
@ -275,7 +275,7 @@ GST_START_TEST (test_pyramid_operations)
/* Add operation 2 */ /* Add operation 2 */
gnl_composition_add (GST_BIN (comp), oper2); nle_composition_add (GST_BIN (comp), oper2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (oper2, 2 * GST_SECOND, 8 * GST_SECOND, check_start_stop_duration (oper2, 2 * GST_SECOND, 8 * GST_SECOND,
6 * GST_SECOND); 6 * GST_SECOND);
@ -311,7 +311,7 @@ GST_START_TEST (test_pyramid_operations2)
GList *segments = NULL; GList *segments = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
/* /*
@ -321,7 +321,7 @@ GST_START_TEST (test_pyramid_operations2)
Priority : 2 Priority : 2
*/ */
source1 = videotest_gnl_src ("source1", 0, 2 * GST_SECOND, 2, 2); source1 = videotest_nle_src ("source1", 0, 2 * GST_SECOND, 2, 2);
/* /*
operation operation
@ -339,14 +339,14 @@ GST_START_TEST (test_pyramid_operations2)
Priority : 2 Priority : 2
*/ */
source2 = videotest_gnl_src ("source2", 4 * GST_SECOND, 2 * GST_SECOND, 2, 2); source2 = videotest_nle_src ("source2", 4 * GST_SECOND, 2 * GST_SECOND, 2, 2);
/* /*
def (default source) def (default source)
Priority = G_MAXUINT32 Priority = G_MAXUINT32
*/ */
def = def =
videotest_gnl_src ("default", 0 * GST_SECOND, 0 * GST_SECOND, 2, videotest_nle_src ("default", 0 * GST_SECOND, 0 * GST_SECOND, 2,
G_MAXUINT32); G_MAXUINT32);
g_object_set (def, "expandable", TRUE, NULL); g_object_set (def, "expandable", TRUE, NULL);
@ -357,25 +357,25 @@ GST_START_TEST (test_pyramid_operations2)
/* Add source 1 */ /* Add source 1 */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
/* Add source 2 */ /* Add source 2 */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND); check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
/* Add operation */ /* Add operation */
gnl_composition_add (GST_BIN (comp), oper); nle_composition_add (GST_BIN (comp), oper);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND); check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
/* Add default */ /* Add default */
gnl_composition_add (GST_BIN (comp), def); nle_composition_add (GST_BIN (comp), def);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND); check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
@ -408,7 +408,7 @@ GST_START_TEST (test_pyramid_operations_expandable)
GList *segments = NULL; GList *segments = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
/* /*
@ -418,7 +418,7 @@ GST_START_TEST (test_pyramid_operations_expandable)
Priority : 2 Priority : 2
*/ */
source1 = videotest_gnl_src ("source1", 0, 2 * GST_SECOND, 2, 2); source1 = videotest_nle_src ("source1", 0, 2 * GST_SECOND, 2, 2);
/* /*
operation (expandable) operation (expandable)
@ -437,14 +437,14 @@ GST_START_TEST (test_pyramid_operations_expandable)
Priority : 2 Priority : 2
*/ */
source2 = videotest_gnl_src ("source2", 4 * GST_SECOND, 2 * GST_SECOND, 2, 2); source2 = videotest_nle_src ("source2", 4 * GST_SECOND, 2 * GST_SECOND, 2, 2);
/* /*
def (default source) def (default source)
Priority = G_MAXUINT32 Priority = G_MAXUINT32
*/ */
def = def =
videotest_gnl_src ("default", 0 * GST_SECOND, 0 * GST_SECOND, 2, videotest_nle_src ("default", 0 * GST_SECOND, 0 * GST_SECOND, 2,
G_MAXUINT32); G_MAXUINT32);
g_object_set (def, "expandable", TRUE, NULL); g_object_set (def, "expandable", TRUE, NULL);
@ -454,13 +454,13 @@ GST_START_TEST (test_pyramid_operations_expandable)
ASSERT_OBJECT_REFCOUNT (def, "default", 1); ASSERT_OBJECT_REFCOUNT (def, "default", 1);
/* Add source 1 */ /* Add source 1 */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
/* Add source 2 */ /* Add source 2 */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
/* Add operation */ /* Add operation */
gnl_composition_add (GST_BIN (comp), oper); nle_composition_add (GST_BIN (comp), oper);
/* Add default */ /* Add default */
gnl_composition_add (GST_BIN (comp), def); nle_composition_add (GST_BIN (comp), def);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND);
@ -493,7 +493,7 @@ GST_START_TEST (test_complex_operations)
GList *segments = NULL; GList *segments = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
/* TOPOLOGY /* TOPOLOGY
@ -512,7 +512,7 @@ GST_START_TEST (test_complex_operations)
Priority : 3 Priority : 3
*/ */
source1 = videotest_in_bin_gnl_src ("source1", 0, 4 * GST_SECOND, 2, 3); source1 = videotest_in_bin_nle_src ("source1", 0, 4 * GST_SECOND, 2, 3);
fail_if (source1 == NULL); fail_if (source1 == NULL);
/* /*
@ -523,7 +523,7 @@ GST_START_TEST (test_complex_operations)
*/ */
source2 = source2 =
videotest_in_bin_gnl_src ("source2", 2 * GST_SECOND, 4 * GST_SECOND, 2, videotest_in_bin_nle_src ("source2", 2 * GST_SECOND, 4 * GST_SECOND, 2,
2); 2);
fail_if (source2 == NULL); fail_if (source2 == NULL);
@ -543,17 +543,17 @@ GST_START_TEST (test_complex_operations)
ASSERT_OBJECT_REFCOUNT (oper, "oper", 1); ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
/* Add source1 */ /* Add source1 */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
check_start_stop_duration (comp, 0, 0, 0); check_start_stop_duration (comp, 0, 0, 0);
ASSERT_OBJECT_REFCOUNT (source1, "source1", 1); ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
/* Add source2 */ /* Add source2 */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
check_start_stop_duration (comp, 0, 0, 0); check_start_stop_duration (comp, 0, 0, 0);
ASSERT_OBJECT_REFCOUNT (source2, "source2", 1); ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
/* Add operaton */ /* Add operaton */
gnl_composition_add (GST_BIN (comp), oper); nle_composition_add (GST_BIN (comp), oper);
check_start_stop_duration (comp, 0, 0, 0); check_start_stop_duration (comp, 0, 0, 0);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
@ -584,7 +584,7 @@ GST_START_TEST (test_complex_operations_bis)
GList *segments = NULL; GList *segments = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
/* TOPOLOGY /* TOPOLOGY
@ -604,7 +604,7 @@ GST_START_TEST (test_complex_operations_bis)
Priority : 2 Priority : 2
*/ */
source1 = videotest_in_bin_gnl_src ("source1", 0, 4 * GST_SECOND, 3, 2); source1 = videotest_in_bin_nle_src ("source1", 0, 4 * GST_SECOND, 3, 2);
fail_if (source1 == NULL); fail_if (source1 == NULL);
/* /*
@ -615,7 +615,7 @@ GST_START_TEST (test_complex_operations_bis)
*/ */
source2 = source2 =
videotest_in_bin_gnl_src ("source2", 2 * GST_SECOND, 4 * GST_SECOND, 2, videotest_in_bin_nle_src ("source2", 2 * GST_SECOND, 4 * GST_SECOND, 2,
3); 3);
fail_if (source2 == NULL); fail_if (source2 == NULL);
@ -637,14 +637,14 @@ GST_START_TEST (test_complex_operations_bis)
ASSERT_OBJECT_REFCOUNT (oper, "oper", 1); ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
/* Add source1 */ /* Add source1 */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 4 * GST_SECOND, 4 * GST_SECOND); check_start_stop_duration (comp, 0, 4 * GST_SECOND, 4 * GST_SECOND);
ASSERT_OBJECT_REFCOUNT (source1, "source1", 1); ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
/* Add source2 */ /* Add source2 */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND); check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
@ -652,7 +652,7 @@ GST_START_TEST (test_complex_operations_bis)
/* Add operaton */ /* Add operaton */
gnl_composition_add (GST_BIN (comp), oper); nle_composition_add (GST_BIN (comp), oper);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND); check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
/* Since it's expandable, it should have changed to full length */ /* Since it's expandable, it should have changed to full length */
@ -681,9 +681,10 @@ GST_END_TEST;
static Suite * static Suite *
gnonlin_suite (void) gnonlin_suite (void)
{ {
Suite *s = suite_create ("gnloperation"); Suite *s = suite_create ("nleoperation");
TCase *tc_chain = tcase_create ("gnloperation"); TCase *tc_chain = tcase_create ("nleoperation");
ges_init ();
suite_add_tcase (s, tc_chain); suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_simple_operation); tcase_add_test (tc_chain, test_simple_operation);

View file

@ -3,7 +3,7 @@
GST_START_TEST (test_simple_videotestsrc) GST_START_TEST (test_simple_videotestsrc)
{ {
GstElement *pipeline; GstElement *pipeline;
GstElement *gnlsource, *sink; GstElement *nlesource, *sink;
CollectStructure *collect; CollectStructure *collect;
GstBus *bus; GstBus *bus;
GstMessage *message; GstMessage *message;
@ -18,20 +18,20 @@ GST_START_TEST (test_simple_videotestsrc)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
gnlsource = nlesource =
videotest_gnl_src ("source1", 1 * GST_SECOND, 1 * GST_SECOND, 2, 1); videotest_nle_src ("source1", 1 * GST_SECOND, 1 * GST_SECOND, 2, 1);
fail_if (gnlsource == NULL); fail_if (nlesource == NULL);
check_start_stop_duration (gnlsource, 1 * GST_SECOND, 2 * GST_SECOND, check_start_stop_duration (nlesource, 1 * GST_SECOND, 2 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
sink = gst_element_factory_make_or_warn ("fakesink", "sink"); sink = gst_element_factory_make_or_warn ("fakesink", "sink");
fail_if (sink == NULL); fail_if (sink == NULL);
gst_bin_add_many (GST_BIN (pipeline), gnlsource, sink, NULL); gst_bin_add_many (GST_BIN (pipeline), nlesource, sink, NULL);
/* Shared data */ /* Shared data */
collect = g_new0 (CollectStructure, 1); collect = g_new0 (CollectStructure, 1);
collect->comp = gnlsource; collect->comp = nlesource;
collect->sink = sink; collect->sink = sink;
/* Expected segments */ /* Expected segments */
@ -39,7 +39,7 @@ GST_START_TEST (test_simple_videotestsrc)
segment_new (1.0, GST_FORMAT_TIME, segment_new (1.0, GST_FORMAT_TIME,
1 * GST_SECOND, 2 * GST_SECOND, 1 * GST_SECOND)); 1 * GST_SECOND, 2 * GST_SECOND, 1 * GST_SECOND));
gst_element_link (gnlsource, sink); gst_element_link (nlesource, sink);
sinkpad = gst_element_get_static_pad (sink, "sink"); sinkpad = gst_element_get_static_pad (sink, "sink");
fail_if (sinkpad == NULL); fail_if (sinkpad == NULL);
@ -49,7 +49,7 @@ GST_START_TEST (test_simple_videotestsrc)
bus = gst_element_get_bus (pipeline); bus = gst_element_get_bus (pipeline);
GST_DEBUG ("Setting pipeline to PLAYING"); GST_DEBUG ("Setting pipeline to PLAYING");
ASSERT_OBJECT_REFCOUNT (gnlsource, "gnlsource", 1); ASSERT_OBJECT_REFCOUNT (nlesource, "nlesource", 1);
fail_if (gst_element_set_state (GST_ELEMENT (pipeline), fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE); GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
@ -104,7 +104,7 @@ GST_END_TEST;
GST_START_TEST (test_videotestsrc_in_bin) GST_START_TEST (test_videotestsrc_in_bin)
{ {
GstElement *pipeline; GstElement *pipeline;
GstElement *gnlsource, *sink; GstElement *nlesource, *sink;
CollectStructure *collect; CollectStructure *collect;
GstBus *bus; GstBus *bus;
GstMessage *message; GstMessage *message;
@ -119,26 +119,26 @@ GST_START_TEST (test_videotestsrc_in_bin)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
gnlsource = videotest_in_bin_gnl_src ("source1", 0, 1 * GST_SECOND, 2, 1); nlesource = videotest_in_bin_nle_src ("source1", 0, 1 * GST_SECOND, 2, 1);
/* Handle systems which don't have alpha available */ /* Handle systems which don't have alpha available */
if (gnlsource == NULL) if (nlesource == NULL)
return; return;
sink = gst_element_factory_make_or_warn ("fakesink", "sink"); sink = gst_element_factory_make_or_warn ("fakesink", "sink");
fail_if (sink == NULL); fail_if (sink == NULL);
gst_bin_add_many (GST_BIN (pipeline), gnlsource, sink, NULL); gst_bin_add_many (GST_BIN (pipeline), nlesource, sink, NULL);
/* Shared data */ /* Shared data */
collect = g_new0 (CollectStructure, 1); collect = g_new0 (CollectStructure, 1);
collect->comp = gnlsource; collect->comp = nlesource;
collect->sink = sink; collect->sink = sink;
/* Expected segments */ /* Expected segments */
collect->expected_segments = g_list_append (collect->expected_segments, collect->expected_segments = g_list_append (collect->expected_segments,
segment_new (1.0, GST_FORMAT_TIME, 0, 1 * GST_SECOND, 0)); segment_new (1.0, GST_FORMAT_TIME, 0, 1 * GST_SECOND, 0));
gst_element_link (gnlsource, sink); gst_element_link (nlesource, sink);
sinkpad = gst_element_get_static_pad (sink, "sink"); sinkpad = gst_element_get_static_pad (sink, "sink");
fail_if (sinkpad == NULL); fail_if (sinkpad == NULL);
@ -148,7 +148,7 @@ GST_START_TEST (test_videotestsrc_in_bin)
bus = gst_element_get_bus (pipeline); bus = gst_element_get_bus (pipeline);
GST_DEBUG ("Setting pipeline to PLAYING"); GST_DEBUG ("Setting pipeline to PLAYING");
ASSERT_OBJECT_REFCOUNT (gnlsource, "gnlsource", 1); ASSERT_OBJECT_REFCOUNT (nlesource, "nlesource", 1);
fail_if (gst_element_set_state (GST_ELEMENT (pipeline), fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE); GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE);
@ -203,9 +203,10 @@ GST_END_TEST;
static Suite * static Suite *
gnonlin_suite (void) gnonlin_suite (void)
{ {
Suite *s = suite_create ("gnlsource"); Suite *s = suite_create ("nlesource");
TCase *tc_chain = tcase_create ("gnlsource"); TCase *tc_chain = tcase_create ("nlesource");
ges_init ();
suite_add_tcase (s, tc_chain); suite_add_tcase (s, tc_chain);
if (0) if (0)

View file

@ -166,7 +166,7 @@ test_simplest_full (void)
GList *seeks = NULL; GList *seeks = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
fail_if (comp == NULL); fail_if (comp == NULL);
/* /*
@ -177,14 +177,14 @@ test_simplest_full (void)
Priority : 1 Priority : 1
*/ */
source1 = source1 =
videotest_gnl_src_full ("source1", 0, 1 * GST_SECOND, 5 * GST_SECOND, 3, videotest_nle_src_full ("source1", 0, 1 * GST_SECOND, 5 * GST_SECOND, 3,
1); 1);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND);
/* Add one source */ /* Add one source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -230,7 +230,7 @@ test_one_after_other_full (void)
GList *segments = NULL, *seeks = NULL; GList *segments = NULL, *seeks = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
fail_if (comp == NULL); fail_if (comp == NULL);
/* TOPOLOGY /* TOPOLOGY
@ -249,7 +249,7 @@ test_one_after_other_full (void)
Priority : 1 Priority : 1
*/ */
source1 = source1 =
videotest_gnl_src_full ("source1", 0, 1 * GST_SECOND, 5 * GST_SECOND, 3, videotest_nle_src_full ("source1", 0, 1 * GST_SECOND, 5 * GST_SECOND, 3,
1); 1);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -261,15 +261,15 @@ test_one_after_other_full (void)
Media start : 2s Media start : 2s
Priority : 1 Priority : 1
*/ */
source2 = videotest_gnl_src_full ("source2", 1 * GST_SECOND, 1 * GST_SECOND, source2 = videotest_nle_src_full ("source2", 1 * GST_SECOND, 1 * GST_SECOND,
2 * GST_SECOND, 2, 1); 2 * GST_SECOND, 2, 1);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 1 * GST_SECOND, 2 * GST_SECOND, check_start_stop_duration (source2, 1 * GST_SECOND, 2 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
/* Add sources */ /* Add sources */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND);
check_start_stop_duration (source2, 1 * GST_SECOND, 2 * GST_SECOND, check_start_stop_duration (source2, 1 * GST_SECOND, 2 * GST_SECOND,
@ -315,7 +315,7 @@ test_one_under_another_full (void)
GList *segments = NULL, *seeks = NULL; GList *segments = NULL, *seeks = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
fail_if (comp == NULL); fail_if (comp == NULL);
/* TOPOLOGY /* TOPOLOGY
@ -333,7 +333,7 @@ test_one_under_another_full (void)
Duration : 2s Duration : 2s
Priority : 1 Priority : 1
*/ */
source1 = videotest_gnl_src ("source1", 0, 2 * GST_SECOND, 3, 1); source1 = videotest_nle_src ("source1", 0, 2 * GST_SECOND, 3, 1);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND);
@ -343,15 +343,15 @@ test_one_under_another_full (void)
Duration : 2s Duration : 2s
Priority : 2 Priority : 2
*/ */
source2 = videotest_gnl_src ("source2", 1 * GST_SECOND, 2 * GST_SECOND, 2, 2); source2 = videotest_nle_src ("source2", 1 * GST_SECOND, 2 * GST_SECOND, 2, 2);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 1 * GST_SECOND, 3 * GST_SECOND, check_start_stop_duration (source2, 1 * GST_SECOND, 3 * GST_SECOND,
2 * GST_SECOND); 2 * GST_SECOND);
/* Add two sources */ /* Add two sources */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND);
check_start_stop_duration (source2, 1 * GST_SECOND, 3 * GST_SECOND, check_start_stop_duration (source2, 1 * GST_SECOND, 3 * GST_SECOND,
@ -396,7 +396,7 @@ test_one_bin_after_other_full (void)
GList *segments = NULL, *seeks = NULL; GList *segments = NULL, *seeks = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
fail_if (comp == NULL); fail_if (comp == NULL);
/* /*
@ -405,7 +405,7 @@ test_one_bin_after_other_full (void)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source1 = videotest_in_bin_gnl_src ("source1", 0, 1 * GST_SECOND, 3, 1); source1 = videotest_in_bin_nle_src ("source1", 0, 1 * GST_SECOND, 3, 1);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -416,17 +416,17 @@ test_one_bin_after_other_full (void)
Priority : 1 Priority : 1
*/ */
source2 = source2 =
videotest_in_bin_gnl_src ("source2", 1 * GST_SECOND, 1 * GST_SECOND, 2, videotest_in_bin_nle_src ("source2", 1 * GST_SECOND, 1 * GST_SECOND, 2,
1); 1);
fail_if (source2 == NULL); fail_if (source2 == NULL);
/* Add one source */ /* Add one source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
/* Second source */ /* Second source */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND);
check_start_stop_duration (source2, 1 * GST_SECOND, 2 * GST_SECOND, check_start_stop_duration (source2, 1 * GST_SECOND, 2 * GST_SECOND,
@ -476,7 +476,7 @@ GST_START_TEST (test_complex_operations)
GList *segments = NULL, *seeks = NULL; GList *segments = NULL, *seeks = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
/* TOPOLOGY /* TOPOLOGY
* *
@ -494,7 +494,7 @@ GST_START_TEST (test_complex_operations)
Priority : 3 Priority : 3
*/ */
source1 = videotest_in_bin_gnl_src ("source1", 0, 4 * GST_SECOND, 2, 3); source1 = videotest_in_bin_nle_src ("source1", 0, 4 * GST_SECOND, 2, 3);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 4 * GST_SECOND, 4 * GST_SECOND); check_start_stop_duration (source1, 0, 4 * GST_SECOND, 4 * GST_SECOND);
@ -506,7 +506,7 @@ GST_START_TEST (test_complex_operations)
*/ */
source2 = source2 =
videotest_in_bin_gnl_src ("source2", 2 * GST_SECOND, 4 * GST_SECOND, 2, videotest_in_bin_nle_src ("source2", 2 * GST_SECOND, 4 * GST_SECOND, 2,
2); 2);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 2 * GST_SECOND, 6 * GST_SECOND, check_start_stop_duration (source2, 2 * GST_SECOND, 6 * GST_SECOND,
@ -531,14 +531,14 @@ GST_START_TEST (test_complex_operations)
ASSERT_OBJECT_REFCOUNT (oper, "oper", 1); ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
/* Add source1 */ /* Add source1 */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 4 * GST_SECOND, 4 * GST_SECOND); check_start_stop_duration (comp, 0, 4 * GST_SECOND, 4 * GST_SECOND);
ASSERT_OBJECT_REFCOUNT (source1, "source1", 1); ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
/* Add source2 */ /* Add source2 */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND); check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
@ -546,7 +546,7 @@ GST_START_TEST (test_complex_operations)
/* Add operaton */ /* Add operaton */
gnl_composition_add (GST_BIN (comp), oper); nle_composition_add (GST_BIN (comp), oper);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND); check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
@ -593,7 +593,7 @@ GST_START_TEST (test_complex_operations_bis)
GList *segments = NULL, *seeks = NULL; GList *segments = NULL, *seeks = NULL;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
/* TOPOLOGY /* TOPOLOGY
* *
@ -612,7 +612,7 @@ GST_START_TEST (test_complex_operations_bis)
Priority : 2 Priority : 2
*/ */
source1 = videotest_in_bin_gnl_src ("source1", 0, 4 * GST_SECOND, 3, 2); source1 = videotest_in_bin_nle_src ("source1", 0, 4 * GST_SECOND, 3, 2);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 4 * GST_SECOND, 4 * GST_SECOND); check_start_stop_duration (source1, 0, 4 * GST_SECOND, 4 * GST_SECOND);
@ -624,7 +624,7 @@ GST_START_TEST (test_complex_operations_bis)
*/ */
source2 = source2 =
videotest_in_bin_gnl_src ("source2", 2 * GST_SECOND, 4 * GST_SECOND, 2, videotest_in_bin_nle_src ("source2", 2 * GST_SECOND, 4 * GST_SECOND, 2,
3); 3);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 2 * GST_SECOND, 6 * GST_SECOND, check_start_stop_duration (source2, 2 * GST_SECOND, 6 * GST_SECOND,
@ -651,14 +651,14 @@ GST_START_TEST (test_complex_operations_bis)
ASSERT_OBJECT_REFCOUNT (oper, "oper", 1); ASSERT_OBJECT_REFCOUNT (oper, "oper", 1);
/* Add source1 */ /* Add source1 */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 4 * GST_SECOND, 4 * GST_SECOND); check_start_stop_duration (comp, 0, 4 * GST_SECOND, 4 * GST_SECOND);
ASSERT_OBJECT_REFCOUNT (source1, "source1", 1); ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
/* Add source2 */ /* Add source2 */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND); check_start_stop_duration (comp, 0, 6 * GST_SECOND, 6 * GST_SECOND);
@ -666,7 +666,7 @@ GST_START_TEST (test_complex_operations_bis)
/* Add operaton */ /* Add operaton */
gnl_composition_add (GST_BIN (comp), oper); nle_composition_add (GST_BIN (comp), oper);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (source1, 0, 4 * GST_SECOND, 4 * GST_SECOND); check_start_stop_duration (source1, 0, 4 * GST_SECOND, 4 * GST_SECOND);
check_start_stop_duration (source2, 2 * GST_SECOND, 6 * GST_SECOND, check_start_stop_duration (source2, 2 * GST_SECOND, 6 * GST_SECOND,
@ -750,6 +750,7 @@ gnonlin_suite (void)
Suite *s = suite_create ("gnonlin-seek"); Suite *s = suite_create ("gnonlin-seek");
TCase *tc_chain = tcase_create ("general"); TCase *tc_chain = tcase_create ("general");
ges_init ();
suite_add_tcase (s, tc_chain); suite_add_tcase (s, tc_chain);
if (gst_registry_check_feature_version (gst_registry_get (), "compositor", 1, if (gst_registry_check_feature_version (gst_registry_get (), "compositor", 1,

View file

@ -12,7 +12,7 @@ test_simplest_full (void)
pipeline = gst_pipeline_new ("test_pipeline"); pipeline = gst_pipeline_new ("test_pipeline");
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
fail_if (comp == NULL); fail_if (comp == NULL);
@ -25,14 +25,14 @@ test_simplest_full (void)
Priority : 1 Priority : 1
*/ */
source1 = source1 =
videotest_gnl_src_full ("source1", 0, 1 * GST_SECOND, 5 * GST_SECOND, 3, videotest_nle_src_full ("source1", 0, 1 * GST_SECOND, 5 * GST_SECOND, 3,
1); 1);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND);
/* Add one source */ /* Add one source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
fail_unless (ret); fail_unless (ret);
check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -116,7 +116,7 @@ test_time_duration_full (void)
GstElement *comp, *source1, *source2; GstElement *comp, *source1, *source2;
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
/* /*
@ -125,7 +125,7 @@ test_time_duration_full (void)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source1 = videotest_gnl_src ("source1", 0, 1 * GST_SECOND, 3, 1); source1 = videotest_nle_src ("source1", 0, 1 * GST_SECOND, 3, 1);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -135,7 +135,7 @@ test_time_duration_full (void)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source2 = videotest_gnl_src ("source2", 1 * GST_SECOND, 1 * GST_SECOND, 2, 1); source2 = videotest_nle_src ("source2", 1 * GST_SECOND, 1 * GST_SECOND, 2, 1);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 1 * GST_SECOND, 2 * GST_SECOND, check_start_stop_duration (source2, 1 * GST_SECOND, 2 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
@ -144,7 +144,7 @@ test_time_duration_full (void)
ASSERT_OBJECT_REFCOUNT (source1, "source1", 1); ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
ASSERT_OBJECT_REFCOUNT (source2, "source2", 1); ASSERT_OBJECT_REFCOUNT (source2, "source2", 1);
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
fail_unless (ret == TRUE); fail_unless (ret == TRUE);
check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -154,7 +154,7 @@ test_time_duration_full (void)
/* Second source */ /* Second source */
ret = FALSE; ret = FALSE;
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
fail_unless (ret == TRUE); fail_unless (ret == TRUE);
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
@ -167,7 +167,7 @@ test_time_duration_full (void)
gst_object_ref (source1); gst_object_ref (source1);
ASSERT_OBJECT_REFCOUNT (source1, "source1", 2); ASSERT_OBJECT_REFCOUNT (source1, "source1", 2);
GST_ERROR_OBJECT (source1, "Num refs : %i", ((GObject *) source1)->ref_count); GST_ERROR_OBJECT (source1, "Num refs : %i", ((GObject *) source1)->ref_count);
gnl_composition_remove (GST_BIN (comp), source1); nle_composition_remove (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
GST_ERROR_OBJECT (source1, "Num refs : %i", ((GObject *) source1)->ref_count); GST_ERROR_OBJECT (source1, "Num refs : %i", ((GObject *) source1)->ref_count);
check_start_stop_duration (comp, 1 * GST_SECOND, 2 * GST_SECOND, check_start_stop_duration (comp, 1 * GST_SECOND, 2 * GST_SECOND,
@ -177,7 +177,7 @@ test_time_duration_full (void)
/* Re-add first source */ /* Re-add first source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
gst_object_unref (source1); gst_object_unref (source1);
@ -203,7 +203,7 @@ test_one_after_other_full (void)
pipeline = gst_pipeline_new ("test_pipeline"); pipeline = gst_pipeline_new ("test_pipeline");
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
fail_if (comp == NULL); fail_if (comp == NULL);
@ -215,7 +215,7 @@ test_one_after_other_full (void)
Priority : 1 Priority : 1
*/ */
source1 = source1 =
videotest_gnl_src_full ("source1", 0, 1 * GST_SECOND, 5 * GST_SECOND, 3, videotest_nle_src_full ("source1", 0, 1 * GST_SECOND, 5 * GST_SECOND, 3,
1); 1);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -227,21 +227,21 @@ test_one_after_other_full (void)
Media start : 2s Media start : 2s
Priority : 1 Priority : 1
*/ */
source2 = videotest_gnl_src_full ("source2", 1 * GST_SECOND, 1 * GST_SECOND, source2 = videotest_nle_src_full ("source2", 1 * GST_SECOND, 1 * GST_SECOND,
2 * GST_SECOND, 2, 1); 2 * GST_SECOND, 2, 1);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 1 * GST_SECOND, 2 * GST_SECOND, check_start_stop_duration (source2, 1 * GST_SECOND, 2 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
/* Add one source */ /* Add one source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND);
ASSERT_OBJECT_REFCOUNT (source1, "source1", 1); ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
/* Second source */ /* Second source */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
fail_unless (ret); fail_unless (ret);
check_start_stop_duration (source1, 0 * GST_SECOND, 1 * GST_SECOND, check_start_stop_duration (source1, 0 * GST_SECOND, 1 * GST_SECOND,
@ -391,7 +391,7 @@ test_one_under_another_full (void)
pipeline = gst_pipeline_new ("test_pipeline"); pipeline = gst_pipeline_new ("test_pipeline");
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
fail_if (comp == NULL); fail_if (comp == NULL);
@ -409,7 +409,7 @@ test_one_under_another_full (void)
Duration : 2s Duration : 2s
Priority : 1 Priority : 1
*/ */
source1 = videotest_gnl_src ("source1", 0, 2 * GST_SECOND, 18, 1); source1 = videotest_nle_src ("source1", 0, 2 * GST_SECOND, 18, 1);
fail_if (source1 == NULL); fail_if (source1 == NULL);
check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND);
@ -419,15 +419,15 @@ test_one_under_another_full (void)
Duration : 2s Duration : 2s
Priority : 2 Priority : 2
*/ */
source2 = videotest_gnl_src ("source2", 1 * GST_SECOND, 2 * GST_SECOND, 0, 2); source2 = videotest_nle_src ("source2", 1 * GST_SECOND, 2 * GST_SECOND, 0, 2);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 1 * GST_SECOND, 3 * GST_SECOND, check_start_stop_duration (source2, 1 * GST_SECOND, 3 * GST_SECOND,
2 * GST_SECOND); 2 * GST_SECOND);
/* Add two sources */ /* Add two sources */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
check_start_stop_duration (comp, 0, 0 * GST_SECOND, 0 * GST_SECOND); check_start_stop_duration (comp, 0, 0 * GST_SECOND, 0 * GST_SECOND);
/* Now commiting changes */ /* Now commiting changes */
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
@ -439,13 +439,13 @@ test_one_under_another_full (void)
/* Remove second source */ /* Remove second source */
gst_object_ref (source1); gst_object_ref (source1);
gnl_composition_remove (GST_BIN (comp), source1); nle_composition_remove (GST_BIN (comp), source1);
check_start_stop_duration (comp, 1 * GST_SECOND, 3 * GST_SECOND, check_start_stop_duration (comp, 1 * GST_SECOND, 3 * GST_SECOND,
2 * GST_SECOND); 2 * GST_SECOND);
/* Re-add second source */ /* Re-add second source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND); check_start_stop_duration (comp, 0, 3 * GST_SECOND, 3 * GST_SECOND);
gst_object_unref (source1); gst_object_unref (source1);
@ -534,7 +534,7 @@ test_one_bin_after_other_full (void)
pipeline = gst_pipeline_new ("test_pipeline"); pipeline = gst_pipeline_new ("test_pipeline");
comp = comp =
gst_element_factory_make_or_warn ("gnlcomposition", "test_composition"); gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
gst_element_set_state (comp, GST_STATE_READY); gst_element_set_state (comp, GST_STATE_READY);
fail_if (comp == NULL); fail_if (comp == NULL);
@ -544,7 +544,7 @@ test_one_bin_after_other_full (void)
Duration : 1s Duration : 1s
Priority : 1 Priority : 1
*/ */
source1 = videotest_in_bin_gnl_src ("source1", 0, 1 * GST_SECOND, 3, 1); source1 = videotest_in_bin_nle_src ("source1", 0, 1 * GST_SECOND, 3, 1);
if (source1 == NULL) { if (source1 == NULL) {
gst_object_unref (pipeline); gst_object_unref (pipeline);
gst_object_unref (comp); gst_object_unref (comp);
@ -559,7 +559,7 @@ test_one_bin_after_other_full (void)
Priority : 1 Priority : 1
*/ */
source2 = source2 =
videotest_in_bin_gnl_src ("source2", 1 * GST_SECOND, 1 * GST_SECOND, 2, videotest_in_bin_nle_src ("source2", 1 * GST_SECOND, 1 * GST_SECOND, 2,
1); 1);
fail_if (source2 == NULL); fail_if (source2 == NULL);
check_start_stop_duration (source2, 1 * GST_SECOND, 2 * GST_SECOND, check_start_stop_duration (source2, 1 * GST_SECOND, 2 * GST_SECOND,
@ -567,7 +567,7 @@ test_one_bin_after_other_full (void)
/* Add one source */ /* Add one source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
fail_unless (ret); fail_unless (ret);
check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (comp, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -577,7 +577,7 @@ test_one_bin_after_other_full (void)
/* Second source */ /* Second source */
gnl_composition_add (GST_BIN (comp), source2); nle_composition_add (GST_BIN (comp), source2);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND); check_start_stop_duration (source1, 0, 1 * GST_SECOND, 1 * GST_SECOND);
@ -589,7 +589,7 @@ test_one_bin_after_other_full (void)
/* Remove first source */ /* Remove first source */
gst_object_ref (source1); gst_object_ref (source1);
gnl_composition_remove (GST_BIN (comp), source1); nle_composition_remove (GST_BIN (comp), source1);
check_start_stop_duration (comp, 1 * GST_SECOND, 2 * GST_SECOND, check_start_stop_duration (comp, 1 * GST_SECOND, 2 * GST_SECOND,
1 * GST_SECOND); 1 * GST_SECOND);
@ -597,7 +597,7 @@ test_one_bin_after_other_full (void)
/* Re-add first source */ /* Re-add first source */
gnl_composition_add (GST_BIN (comp), source1); nle_composition_add (GST_BIN (comp), source1);
commit_and_wait (comp, &ret); commit_and_wait (comp, &ret);
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND); check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
gst_object_unref (source1); gst_object_unref (source1);
@ -766,6 +766,8 @@ gnonlin_suite (void)
suite_add_tcase (s, tc_chain); suite_add_tcase (s, tc_chain);
ges_init ();
tcase_add_test (tc_chain, test_time_duration); tcase_add_test (tc_chain, test_time_duration);
tcase_add_test (tc_chain, test_simplest); tcase_add_test (tc_chain, test_simplest);
tcase_add_test (tc_chain, test_one_after_other); tcase_add_test (tc_chain, test_one_after_other);

View file

@ -58,7 +58,7 @@ gboolean
print_transition_data (GESClip * tr) print_transition_data (GESClip * tr)
{ {
GESTrackElement *trackelement; GESTrackElement *trackelement;
GstElement *gnlobj; GstElement *nleobj;
guint64 start, duration; guint64 start, duration;
gint priority; gint priority;
char *name; char *name;
@ -71,12 +71,12 @@ print_transition_data (GESClip * tr)
return FALSE; return FALSE;
if (!(trackelement = GES_TRACK_ELEMENT (trackelements->data))) if (!(trackelement = GES_TRACK_ELEMENT (trackelements->data)))
return FALSE; return FALSE;
if (!(gnlobj = ges_track_element_get_gnlobject (trackelement))) if (!(nleobj = ges_track_element_get_nleobject (trackelement)))
return FALSE; return FALSE;
g_object_get (gnlobj, "start", &start, "duration", &duration, g_object_get (nleobj, "start", &start, "duration", &duration,
"priority", &priority, "name", &name, NULL); "priority", &priority, "name", &name, NULL);
g_print ("gnlobject for %s: %f %f %d\n", name, g_print ("nleobject for %s: %f %f %d\n", name,
((gfloat) start) / GST_SECOND, ((gfloat) start) / GST_SECOND,
((gfloat) duration) / GST_SECOND, priority); ((gfloat) duration) / GST_SECOND, priority);