Branch data Line data Source code
1 : : /* GStreamer Editing Services
2 : : * Copyright (C) 2009 Edward Hervey <edward.hervey@collabora.co.uk>
3 : : * 2009 Nokia Corporation
4 : : *
5 : : * This library is free software; you can redistribute it and/or
6 : : * modify it under the terms of the GNU Library General Public
7 : : * License as published by the Free Software Foundation; either
8 : : * version 2 of the License, or (at your option) any later version.
9 : : *
10 : : * This library is distributed in the hope that it will be useful,
11 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 : : * Library General Public License for more details.
14 : : *
15 : : * You should have received a copy of the GNU Library General Public
16 : : * License along with this library; if not, write to the
17 : : * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 : : * Boston, MA 02111-1307, USA.
19 : : */
20 : :
21 : : #include <ges/ges.h>
22 : : #include <gst/controller/gstcontroller.h>
23 : : #include "ges-internal.h"
24 : :
25 : : #define GES_GNONLIN_VERSION_NEEDED_MAJOR 0
26 : : #define GES_GNONLIN_VERSION_NEEDED_MINOR 10
27 : : #define GES_GNONLIN_VERSION_NEEDED_MICRO 16
28 : :
29 : : GST_DEBUG_CATEGORY (_ges_debug);
30 : :
31 : : /**
32 : : * SECTION:ges-common
33 : : * @short_description: Initialization.
34 : : */
35 : :
36 : : static gboolean
37 : 28 : ges_check_gnonlin_availability (void)
38 : : {
39 : 28 : gboolean ret = TRUE;
40 [ - + ]: 28 : if (!gst_default_registry_check_feature_version ("gnlcomposition",
41 : : GES_GNONLIN_VERSION_NEEDED_MAJOR, GES_GNONLIN_VERSION_NEEDED_MINOR,
42 : : GES_GNONLIN_VERSION_NEEDED_MICRO)) {
43 [ # # ]: 0 : GST_ERROR
44 : : ("GNonLin plugins not found, or not at least version %u.%u.%u",
45 : : GES_GNONLIN_VERSION_NEEDED_MAJOR,
46 : : GES_GNONLIN_VERSION_NEEDED_MINOR, GES_GNONLIN_VERSION_NEEDED_MICRO);
47 : 0 : ret = FALSE;
48 : : }
49 : 28 : return ret;
50 : : }
51 : :
52 : : /**
53 : : * ges_init:
54 : : *
55 : : * Initialize the GStreamer Editing Service. Call this before any usage of
56 : : * GES.
57 : : */
58 : :
59 : : gboolean
60 : 28 : ges_init (void)
61 : : {
62 : : /* initialize debugging category */
63 [ + - ]: 28 : GST_DEBUG_CATEGORY_INIT (_ges_debug, "ges", GST_DEBUG_FG_YELLOW,
64 : : "GStreamer Editing Services");
65 : 28 : gst_controller_init (NULL, NULL);
66 : :
67 : : /* register timeline object classes with the system */
68 : :
69 : 28 : GES_TYPE_TIMELINE_TEST_SOURCE;
70 : 28 : GES_TYPE_TIMELINE_FILE_SOURCE;
71 : 28 : GES_TYPE_TIMELINE_TITLE_SOURCE;
72 : 28 : GES_TYPE_TIMELINE_STANDARD_TRANSITION;
73 : 28 : GES_TYPE_TIMELINE_OVERLAY;
74 : :
75 : : /* check the gnonlin elements are available */
76 [ - + ]: 28 : if (!ges_check_gnonlin_availability ())
77 : 0 : return FALSE;
78 : :
79 : : /* TODO: user-defined types? */
80 : :
81 [ - + ]: 28 : GST_DEBUG ("GStreamer Editing Services initialized");
82 : :
83 : 28 : return TRUE;
84 : : }
|