ges: Move GESVideo/AudioSource::create_source to GESSource
[platform/upstream/gst-editing-services.git] / ges / ges-source.h
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., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20
21 #pragma once
22
23 #include <glib-object.h>
24 #include <gst/gst.h>
25 #include <ges/ges-types.h>
26 #include <ges/ges-track-element.h>
27
28 G_BEGIN_DECLS
29
30 #define GES_TYPE_SOURCE ges_source_get_type()
31 GES_DECLARE_TYPE(Source, source, SOURCE);
32
33 /**
34  * GESSource:
35  *
36  * Base class for single-media sources
37  */
38
39 struct _GESSource {
40   /*< private >*/
41   GESTrackElement parent;
42
43   GESSourcePrivate *priv;
44
45   /* Padding for API extension */
46   gpointer _ges_reserved[GES_PADDING];
47 };
48
49 /**
50  * GESSourceClass:
51  */
52
53 struct _GESSourceClass {
54   /*< private >*/
55   GESTrackElementClass parent_class;
56
57   /**
58    * GESSourceClass::select_pad:
59    * @source: The @source for which to check if @pad should be used or not
60    * @pad: The pad to check
61    *
62    * Check whether @pad should be exposed/used.
63    *
64    * Returns: %TRUE if @pad should be used %FALSE otherwise.
65    *
66    * Since: 1.20
67    */
68   gboolean (*select_pad)(GESSource *source, GstPad *pad);
69
70   /**
71    * GESSourceClass::create_source:
72    * @source: The #GESAudioSource
73    *
74    * Creates the GstElement to put in the source topbin. Other elements will be
75    * queued, like a volume. In the case of a AudioUriSource, for example, the
76    * subclass will return a decodebin, and we will append a volume.
77    *
78    * Returns: (transfer floating): The source element to use.
79    *
80    * Since: 1.20
81    */
82   GstElement*  (*create_source)           (GESSource * source);
83
84   /* Padding for API extension */
85   gpointer _ges_reserved[GES_PADDING - 2];
86 };
87
88 G_END_DECLS