tizen 2.3 release
[framework/multimedia/gst-plugins-base0.10.git] / gst-libs / gst / pbutils / encoding-profile.h
1 /* GStreamer encoding profiles library
2  * Copyright (C) 2009-2010 Edward Hervey <edward.hervey@collabora.co.uk>
3  *           (C) 2009-2010 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 #ifndef __GST_PROFILE_H__
22 #define __GST_PROFILE_H__
23
24 #include <gst/gst.h>
25
26 G_BEGIN_DECLS
27
28 #include <gst/pbutils/pbutils-enumtypes.h>
29 #include <gst/pbutils/gstdiscoverer.h>
30
31 /**
32  * GstEncodingProfile:
33  *
34  * The opaque base class object for all encoding profiles. This contains generic
35  * information like name, description, format and preset.
36  *
37  * Since: 0.10.32
38  */
39
40 #define GST_TYPE_ENCODING_PROFILE                       \
41   (gst_encoding_profile_get_type ())
42 #define GST_ENCODING_PROFILE(obj)                       \
43   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_PROFILE, GstEncodingProfile))
44 #define GST_IS_ENCODING_PROFILE(obj)                    \
45   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_PROFILE))
46 typedef struct _GstEncodingProfile GstEncodingProfile;
47 typedef GstMiniObjectClass GstEncodingProfileClass;
48 GType gst_encoding_profile_get_type (void);
49
50
51
52 /**
53  * GstEncodingContainerProfile:
54  *
55  * Encoding profiles for containers. Keeps track of a list of #GstEncodingProfile
56  *
57  * Since: 0.10.32
58  */
59 #define GST_TYPE_ENCODING_CONTAINER_PROFILE                     \
60   (gst_encoding_container_profile_get_type ())
61 #define GST_ENCODING_CONTAINER_PROFILE(obj)                     \
62   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_CONTAINER_PROFILE, GstEncodingContainerProfile))
63 #define GST_IS_ENCODING_CONTAINER_PROFILE(obj)                  \
64   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_CONTAINER_PROFILE))
65 typedef struct _GstEncodingContainerProfile GstEncodingContainerProfile;
66 typedef GstEncodingProfileClass GstEncodingContainerProfileClass;
67 GType gst_encoding_container_profile_get_type (void);
68
69
70
71 /**
72  * GstEncodingVideoProfile:
73  *
74  * Variant of #GstEncodingProfile for video streams, allows specifying the @pass.
75  *
76  * Since: 0.10.32
77  */
78 #define GST_TYPE_ENCODING_VIDEO_PROFILE                 \
79   (gst_encoding_video_profile_get_type ())
80 #define GST_ENCODING_VIDEO_PROFILE(obj)                 \
81   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_VIDEO_PROFILE, GstEncodingVideoProfile))
82 #define GST_IS_ENCODING_VIDEO_PROFILE(obj)                      \
83   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_VIDEO_PROFILE))
84 typedef struct _GstEncodingVideoProfile GstEncodingVideoProfile;
85 typedef GstEncodingProfileClass GstEncodingVideoProfileClass;
86 GType gst_encoding_video_profile_get_type (void);
87
88
89
90 /**
91  * GstEncodingAudioProfile:
92  *
93  * Variant of #GstEncodingProfile for audio streams.
94  *
95  * Since: 0.10.32
96  */
97 #define GST_TYPE_ENCODING_AUDIO_PROFILE                 \
98   (gst_encoding_audio_profile_get_type ())
99 #define GST_ENCODING_AUDIO_PROFILE(obj)                 \
100   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_AUDIO_PROFILE, GstEncodingAudioProfile))
101 #define GST_IS_ENCODING_AUDIO_PROFILE(obj)                      \
102   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_AUDIO_PROFILE))
103 typedef struct _GstEncodingAudioProfile GstEncodingAudioProfile;
104 typedef GstEncodingProfileClass GstEncodingAudioProfileClass;
105 GType gst_encoding_audio_profile_get_type (void);
106
107
108
109 /* GstEncodingProfile API */
110
111 /**
112  * gst_encoding_profile_unref:
113  * @profile: a #GstEncodingProfile
114  *
115  * Decreases the reference count of the @profile, possibly freeing the @profile.
116  *
117  * Since: 0.10.32
118  */
119 #define gst_encoding_profile_unref(profile) (gst_mini_object_unref ((GstMiniObject*) profile))
120
121 /**
122  * gst_encoding_profile_ref:
123  * @profile: a #GstEncodingProfile
124  *
125  * Increases the reference count of the @profile.
126  *
127  * Since: 0.10.32
128  */
129 #define gst_encoding_profile_ref(profile) (gst_mini_object_ref ((GstMiniObject*) profile))
130
131 const gchar *   gst_encoding_profile_get_name(GstEncodingProfile *profile);
132 const gchar *   gst_encoding_profile_get_description(GstEncodingProfile *profile);
133 const GstCaps * gst_encoding_profile_get_format(GstEncodingProfile *profile);
134 const gchar *   gst_encoding_profile_get_preset(GstEncodingProfile *profile);
135 guint   gst_encoding_profile_get_presence(GstEncodingProfile *profile);
136 const GstCaps * gst_encoding_profile_get_restriction(GstEncodingProfile *profile);
137
138 void    gst_encoding_profile_set_name(GstEncodingProfile *profile, const gchar *name);
139 void    gst_encoding_profile_set_description(GstEncodingProfile *profile, const gchar *description);
140 void    gst_encoding_profile_set_format(GstEncodingProfile *profile, GstCaps *format);
141 void    gst_encoding_profile_set_preset(GstEncodingProfile *profile, const gchar *preset);
142 void    gst_encoding_profile_set_restriction(GstEncodingProfile *profile, GstCaps *restriction);
143 void    gst_encoding_profile_set_presence(GstEncodingProfile *profile, guint presence);
144
145 gboolean gst_encoding_profile_is_equal (GstEncodingProfile *a,
146                                         GstEncodingProfile *b);
147 GstCaps * gst_encoding_profile_get_input_caps (GstEncodingProfile *profile);
148
149 const gchar *gst_encoding_profile_get_type_nick (GstEncodingProfile *profile);
150
151 GstEncodingProfile * gst_encoding_profile_find (const gchar *targetname,
152                                                 const gchar *profilename,
153                                                 const gchar *category);
154
155 /* GstEncodingContainerProfile API */
156 gboolean  gst_encoding_container_profile_add_profile       (GstEncodingContainerProfile *container,
157                                                             GstEncodingProfile *profile);
158 gboolean  gst_encoding_container_profile_contains_profile  (GstEncodingContainerProfile * container,
159                                                             GstEncodingProfile *profile);
160 const GList *gst_encoding_container_profile_get_profiles   (GstEncodingContainerProfile *profile);
161
162
163 GstEncodingContainerProfile *  gst_encoding_container_profile_new (const gchar *name,
164                                                                    const gchar *description,
165                                                                    GstCaps *format,
166                                                                    const gchar *preset);
167
168
169 /* Invidual stream encodingprofile API */
170 GstEncodingVideoProfile * gst_encoding_video_profile_new (GstCaps *format,
171                                                           const gchar *preset,
172                                                           GstCaps *restriction,
173                                                           guint presence);
174 GstEncodingAudioProfile * gst_encoding_audio_profile_new (GstCaps *format,
175                                                           const gchar *preset,
176                                                           GstCaps *restriction,
177                                                           guint presence);
178
179 guint    gst_encoding_video_profile_get_pass              (GstEncodingVideoProfile *prof);
180 gboolean gst_encoding_video_profile_get_variableframerate (GstEncodingVideoProfile *prof);
181
182 void     gst_encoding_video_profile_set_pass              (GstEncodingVideoProfile *prof,
183                                                            guint pass);
184 void     gst_encoding_video_profile_set_variableframerate (GstEncodingVideoProfile *prof,
185                                                            gboolean variableframerate);
186
187 GstEncodingProfile * gst_encoding_profile_from_discoverer (GstDiscovererInfo *info);
188
189 G_END_DECLS
190
191 #endif /* __GST_PROFILE_H__ */