Tizen 2.0 Release
[framework/multimedia/gst-plugins-bad0.10.git] / gst-libs / gst / video / videocontext.h
1 /* GStreamer
2  *
3  * Copyright (C) 2011 Intel
4  * Copyright (C) 2011 Collabora Ltd.
5  *   Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
6  *
7  * video-context.h: Video Context interface and helpers
8  *
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Library General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Library General Public License for more details.
19  *
20  * You should have received a copy of the GNU Library General Public
21  * License along with this library; if not, write to the
22  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23  * Boston, MA 02111-1307, USA.
24  */
25
26 #ifndef __GST_VIDEO_CONTEXT_H__
27 #define __GST_VIDEO_CONTEXT_H__
28
29 #ifndef GST_USE_UNSTABLE_API
30 #warning "The GstVideoContext interface is unstable API and may change in future."
31 #warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
32 #endif
33
34 #include <gst/gst.h>
35
36 G_BEGIN_DECLS
37
38 #define GST_TYPE_VIDEO_CONTEXT              (gst_video_context_iface_get_type ())
39 #define GST_VIDEO_CONTEXT(obj)              (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_CONTEXT, GstVideoContext))
40 #define GST_IS_VIDEO_CONTEXT(obj)           (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_CONTEXT))
41 #define GST_VIDEO_CONTEXT_GET_IFACE(inst)   (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_VIDEO_CONTEXT, GstVideoContextInterface))
42
43 /**
44  * GstVideoContext:
45  *
46  * Opaque #GstVideoContext data structure.
47  */
48 typedef struct _GstVideoContext GstVideoContext;
49 typedef struct _GstVideoContextInterface GstVideoContextInterface;
50
51 /**
52  * GstVideoContextInterface:
53  * @parent: parent interface type.
54  * @set_context: vmethod to set video context.
55  *
56  * #GstVideoContextInterface interface.
57  */
58 struct _GstVideoContextInterface
59 {
60   GTypeInterface parent;
61
62   /* virtual functions */
63   void (*set_context) (GstVideoContext * context,
64                        const gchar * type,
65                        const GValue * value);
66
67 };
68
69 GType    gst_video_context_iface_get_type (void);
70
71 /* virtual class method and associated helpers */
72 void     gst_video_context_set_context           (GstVideoContext * context,
73                                                   const gchar * type,
74                                                   const GValue * value);
75 void     gst_video_context_set_context_string    (GstVideoContext * context,
76                                                   const gchar * type,
77                                                   const gchar * value);
78 void     gst_video_context_set_context_pointer   (GstVideoContext * context,
79                                                   const gchar * type,
80                                                   gpointer value);
81 void     gst_video_context_set_context_object    (GstVideoContext * context,
82                                                   const gchar * type,
83                                                   GObject * value);
84
85
86 /* message helpers */
87 void      gst_video_context_prepare                (GstVideoContext *context,
88                                                     const gchar ** types);
89
90 gboolean  gst_video_context_message_parse_prepare  (GstMessage * message,
91                                                     const gchar *** types,
92                                                     GstVideoContext ** ctx);
93
94 /* query helpers */
95 GstQuery     * gst_video_context_query_new                    (const gchar ** types);
96 gboolean       gst_video_context_run_query                    (GstElement *element,
97                                                                GstQuery *query);
98 const gchar ** gst_video_context_query_get_supported_types    (GstQuery * query);
99 void           gst_video_context_query_parse_value            (GstQuery * query,
100                                                                const gchar ** type,
101                                                                const GValue ** value);
102 void           gst_video_context_query_set_value              (GstQuery * query,
103                                                                const gchar * type,
104                                                                GValue * value);
105 void           gst_video_context_query_set_string             (GstQuery * query,
106                                                                const gchar * type,
107                                                                const gchar * value);
108 void           gst_video_context_query_set_pointer            (GstQuery * query,
109                                                                const gchar * type,
110                                                                gpointer value);
111 void           gst_video_context_query_set_object             (GstQuery * query,
112                                                                const gchar * type,
113                                                                GObject * value);
114
115 G_END_DECLS
116
117 #endif /* __GST_VIDEO_CONTEXT_H__ */