1554cbd1c1238b2a8048c31fa5e44b64aa2ead65
[platform/upstream/gst-editing-services.git] / ges / ges-video-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 #ifndef _GES_VIDEO_SOURCE
22 #define _GES_VIDEO_SOURCE
23
24 #include <glib-object.h>
25 #include <gst/gst.h>
26 #include <ges/ges-types.h>
27 #include <ges/ges-track-element.h>
28 #include <ges/ges-source.h>
29
30 G_BEGIN_DECLS
31
32 #define GES_TYPE_VIDEO_SOURCE ges_video_source_get_type()
33
34 #define GES_VIDEO_SOURCE(obj) \
35   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_VIDEO_SOURCE, GESVideoSource))
36
37 #define GES_VIDEO_SOURCE_CLASS(klass) \
38   (G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_VIDEO_SOURCE, GESVideoSourceClass))
39
40 #define GES_IS_VIDEO_SOURCE(obj) \
41   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_VIDEO_SOURCE))
42
43 #define GES_IS_VIDEO_SOURCE_CLASS(klass) \
44   (G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_VIDEO_SOURCE))
45
46 #define GES_VIDEO_SOURCE_GET_CLASS(obj) \
47   (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_VIDEO_SOURCE, GESVideoSourceClass))
48
49 typedef struct _GESVideoSourcePrivate GESVideoSourcePrivate;
50
51 /**
52  * GESVideoSource:
53  *
54  * Base class for video sources
55  */
56
57 struct _GESVideoSource {
58   /*< private >*/
59   GESSource parent;
60
61   GESVideoSourcePrivate *priv;
62
63   /* Padding for API extension */
64   gpointer _ges_reserved[GES_PADDING];
65 };
66
67 /**
68  * GESVideoSourceClass:
69  * @create_source: method to return the GstElement to put in the source topbin.
70  * Other elements will be queued, like a videoscale.
71  * In the case of a VideoUriSource, for example, the subclass will return a decodebin,
72  * and we will append a videoscale.
73  */
74 struct _GESVideoSourceClass {
75   /*< private >*/
76   GESSourceClass parent_class;
77
78   /*< public >*/
79   GstElement*  (*create_source)           (GESTrackElement * object);
80
81   /*< private >*/
82   /* Padding for API extension */
83   union {
84     gpointer _ges_reserved[GES_PADDING];
85     struct {
86       gboolean disable_scale_in_compositor;
87       gboolean (*needs_converters)(GESVideoSource *self);
88     } abi;
89   } ABI;
90 };
91
92 GES_API
93 GType ges_video_source_get_type (void);
94
95 G_END_DECLS
96
97 #endif /* _GES_VIDEO_SOURCE */