2012-09-23 00:23:20 +00:00
|
|
|
/**
|
|
|
|
* Gstreamer Editing Services
|
|
|
|
*
|
|
|
|
* Copyright (C) <2012> Thibault Saunier <thibault.saunier@collabora.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
|
2012-11-04 00:25:20 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2012-09-23 00:23:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GES_TEST_UTILS
|
|
|
|
#define _GES_TEST_UTILS
|
|
|
|
|
|
|
|
#include <ges/ges.h>
|
2013-05-29 20:48:03 +00:00
|
|
|
#include <gst/check/gstcheck.h>
|
2012-09-23 00:23:20 +00:00
|
|
|
|
2013-07-01 14:27:54 +00:00
|
|
|
GESPipeline * ges_test_create_pipeline (GESTimeline *timeline);
|
2014-08-15 13:48:14 +00:00
|
|
|
/* The first 2 NLE priorities are used for:
|
2013-03-29 18:23:00 +00:00
|
|
|
* 0- The Mixing element
|
|
|
|
* 1- The Gaps
|
|
|
|
*/
|
2014-08-15 13:48:14 +00:00
|
|
|
#define MIN_NLE_PRIO 2
|
2013-03-29 18:23:00 +00:00
|
|
|
|
2014-06-05 02:20:15 +00:00
|
|
|
#define LAYER_HEIGHT 1000
|
|
|
|
|
2014-10-27 15:51:42 +00:00
|
|
|
gchar * ges_test_get_tmp_uri (const gchar * filename);
|
2012-09-23 00:23:20 +00:00
|
|
|
gchar * ges_test_get_audio_only_uri (void);
|
|
|
|
gchar * ges_test_get_audio_video_uri (void);
|
2013-03-22 00:42:31 +00:00
|
|
|
gchar * ges_test_get_image_uri (void);
|
2012-09-23 00:23:20 +00:00
|
|
|
gchar * ges_test_file_uri (const gchar *filename);
|
2013-04-25 22:03:21 +00:00
|
|
|
|
2013-07-03 16:48:58 +00:00
|
|
|
void check_destroyed (GObject *object_to_unref, GObject *first_object, ...) G_GNUC_NULL_TERMINATED;
|
2013-04-25 22:03:21 +00:00
|
|
|
gchar * ges_test_file_name (const gchar *filename);
|
|
|
|
gboolean
|
2013-04-27 22:22:42 +00:00
|
|
|
ges_generate_test_file_audio_video (const gchar * filedest,
|
|
|
|
const gchar * audio_enc,
|
|
|
|
const gchar * video_enc,
|
|
|
|
const gchar * mux, const gchar * video_pattern, const gchar * audio_wave);
|
2013-08-25 15:08:00 +00:00
|
|
|
gboolean
|
|
|
|
play_timeline (GESTimeline * timeline);
|
2012-09-23 00:23:20 +00:00
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
#define nle_object_check(nleobj, start, duration, mstart, mduration, priority, active) { \
|
2013-06-09 16:29:05 +00:00
|
|
|
guint64 pstart, pdur, inpoint, pprio, pact; \
|
2014-08-15 13:48:14 +00:00
|
|
|
g_object_get (nleobj, "start", &pstart, "duration", &pdur, \
|
2013-06-09 16:29:05 +00:00
|
|
|
"inpoint", &inpoint, "priority", &pprio, "active", &pact, \
|
2012-09-23 00:23:20 +00:00
|
|
|
NULL); \
|
|
|
|
assert_equals_uint64 (pstart, start); \
|
|
|
|
assert_equals_uint64 (pdur, duration); \
|
2013-06-09 16:29:05 +00:00
|
|
|
assert_equals_uint64 (inpoint, mstart); \
|
2012-09-23 00:23:20 +00:00
|
|
|
assert_equals_int (pprio, priority); \
|
|
|
|
assert_equals_int (pact, active); \
|
|
|
|
}
|
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
/* copied from nle */
|
2012-12-01 16:56:37 +00:00
|
|
|
#define fail_error_message(msg) \
|
|
|
|
G_STMT_START { \
|
|
|
|
GError *error; \
|
|
|
|
gst_message_parse_error(msg, &error, NULL); \
|
|
|
|
fail_unless(FALSE, "Error Message from %s : %s", \
|
|
|
|
GST_OBJECT_NAME (GST_MESSAGE_SRC(msg)), error->message); \
|
|
|
|
g_error_free (error); \
|
|
|
|
} G_STMT_END;
|
|
|
|
|
2013-01-10 14:18:46 +00:00
|
|
|
#define assert_is_type(object, type) \
|
|
|
|
G_STMT_START { \
|
|
|
|
fail_unless (g_type_is_a(G_OBJECT_TYPE(object), type), \
|
|
|
|
"%s is not a %s", G_OBJECT_TYPE_NAME(object), \
|
|
|
|
g_type_name (type)); \
|
|
|
|
} G_STMT_END;
|
|
|
|
|
2013-01-15 13:52:17 +00:00
|
|
|
#define _START(obj) GES_TIMELINE_ELEMENT_START (obj)
|
|
|
|
#define _DURATION(obj) GES_TIMELINE_ELEMENT_DURATION (obj)
|
|
|
|
#define _INPOINT(obj) GES_TIMELINE_ELEMENT_INPOINT (obj)
|
|
|
|
#define _PRIORITY(obj) GES_TIMELINE_ELEMENT_PRIORITY (obj)
|
|
|
|
|
2013-06-26 21:08:57 +00:00
|
|
|
#define CHECK_OBJECT_PROPS(obj, start, inpoint, duration) {\
|
|
|
|
assert_equals_uint64 (_START (obj), start);\
|
|
|
|
assert_equals_uint64 (_INPOINT (obj), inpoint);\
|
|
|
|
assert_equals_uint64 (_DURATION (obj), duration);\
|
|
|
|
}
|
|
|
|
|
|
|
|
#define check_layer(clip, layer_prio) { \
|
|
|
|
GESLayer *tmplayer = ges_clip_get_layer ((clip)); \
|
|
|
|
assert_equals_int (ges_layer_get_priority (tmplayer), (layer_prio)); \
|
|
|
|
gst_object_unref (tmplayer); \
|
|
|
|
}
|
|
|
|
|
2012-09-23 00:23:20 +00:00
|
|
|
#endif /* _GES_TEST_UTILS */
|