• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef __GST_PROFILE_H__
22 #define __GST_PROFILE_H__
23 
24 #include <gst/gst.h>
25 
26 #include <gst/pbutils/pbutils-enumtypes.h>
27 #include <gst/pbutils/gstdiscoverer.h>
28 
29 G_BEGIN_DECLS
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 
38 #define GST_TYPE_ENCODING_PROFILE                       \
39   (gst_encoding_profile_get_type ())
40 #define GST_ENCODING_PROFILE(obj)                       \
41   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_PROFILE, GstEncodingProfile))
42 #define GST_IS_ENCODING_PROFILE(obj)                    \
43   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_PROFILE))
44 typedef struct _GstEncodingProfile GstEncodingProfile;
45 typedef struct _GstEncodingProfileClass GstEncodingProfileClass;
46 
47 GST_PBUTILS_API
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 #define GST_TYPE_ENCODING_CONTAINER_PROFILE                     \
58   (gst_encoding_container_profile_get_type ())
59 #define GST_ENCODING_CONTAINER_PROFILE(obj)                     \
60   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_CONTAINER_PROFILE, GstEncodingContainerProfile))
61 #define GST_IS_ENCODING_CONTAINER_PROFILE(obj)                  \
62   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_CONTAINER_PROFILE))
63 typedef struct _GstEncodingContainerProfile GstEncodingContainerProfile;
64 typedef struct _GstEncodingContainerProfileClass GstEncodingContainerProfileClass;
65 
66 GST_PBUTILS_API
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 #define GST_TYPE_ENCODING_VIDEO_PROFILE                 \
77   (gst_encoding_video_profile_get_type ())
78 #define GST_ENCODING_VIDEO_PROFILE(obj)                 \
79   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_VIDEO_PROFILE, GstEncodingVideoProfile))
80 #define GST_IS_ENCODING_VIDEO_PROFILE(obj)                      \
81   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_VIDEO_PROFILE))
82 typedef struct _GstEncodingVideoProfile GstEncodingVideoProfile;
83 typedef struct _GstEncodingVideoProfileClass GstEncodingVideoProfileClass;
84 
85 GST_PBUTILS_API
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 #define GST_TYPE_ENCODING_AUDIO_PROFILE                 \
96   (gst_encoding_audio_profile_get_type ())
97 #define GST_ENCODING_AUDIO_PROFILE(obj)                 \
98   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_AUDIO_PROFILE, GstEncodingAudioProfile))
99 #define GST_IS_ENCODING_AUDIO_PROFILE(obj)                      \
100   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_AUDIO_PROFILE))
101 typedef struct _GstEncodingAudioProfile GstEncodingAudioProfile;
102 typedef struct _GstEncodingAudioProfileClass GstEncodingAudioProfileClass;
103 
104 GST_PBUTILS_API
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 #define gst_encoding_profile_unref(profile) (g_object_unref ((GObject*) profile))
118 
119 /**
120  * gst_encoding_profile_ref:
121  * @profile: a #GstEncodingProfile
122  *
123  * Increases the reference count of the @profile.
124  */
125 #define gst_encoding_profile_ref(profile) (g_object_ref ((GObject*) profile))
126 
127 GST_PBUTILS_API
128 const gchar *   gst_encoding_profile_get_name           (GstEncodingProfile *profile);
129 
130 GST_PBUTILS_API
131 void            gst_encoding_profile_set_name           (GstEncodingProfile *profile,
132                                                          const gchar *name);
133 
134 GST_PBUTILS_API
135 const gchar *   gst_encoding_profile_get_description    (GstEncodingProfile *profile);
136 
137 GST_PBUTILS_API
138 void            gst_encoding_profile_set_description    (GstEncodingProfile *profile,
139                                                          const gchar *description);
140 
141 GST_PBUTILS_API
142 GstCaps *       gst_encoding_profile_get_format         (GstEncodingProfile *profile);
143 
144 GST_PBUTILS_API
145 void            gst_encoding_profile_set_format         (GstEncodingProfile *profile,
146                                                          GstCaps *format);
147 
148 GST_PBUTILS_API
149 gboolean  gst_encoding_profile_get_allow_dynamic_output (GstEncodingProfile *profile);
150 
151 GST_PBUTILS_API
152 void      gst_encoding_profile_set_allow_dynamic_output (GstEncodingProfile *profile,
153                                                          gboolean allow_dynamic_output);
154 
155 GST_PBUTILS_API
156 const gchar *   gst_encoding_profile_get_preset         (GstEncodingProfile *profile);
157 
158 GST_PBUTILS_API
159 const gchar *   gst_encoding_profile_get_preset_name    (GstEncodingProfile *profile);
160 
161 GST_PBUTILS_API
162 void            gst_encoding_profile_set_preset         (GstEncodingProfile *profile,
163                                                          const gchar *preset);
164 
165 GST_PBUTILS_API
166 guint           gst_encoding_profile_get_presence       (GstEncodingProfile *profile);
167 
168 GST_PBUTILS_API
169 void            gst_encoding_profile_set_presence       (GstEncodingProfile *profile,
170                                                          guint presence);
171 
172 GST_PBUTILS_API
173 void            gst_encoding_profile_set_preset_name    (GstEncodingProfile * profile,
174                                                          const gchar * preset_name);
175 
176 GST_PBUTILS_API
177 GstCaps *       gst_encoding_profile_get_restriction    (GstEncodingProfile *profile);
178 
179 GST_PBUTILS_API
180 void            gst_encoding_profile_set_restriction    (GstEncodingProfile *profile,
181                                                          GstCaps *restriction);
182 
183 GST_PBUTILS_API
184 gboolean        gst_encoding_profile_is_equal           (GstEncodingProfile *a,
185                                                          GstEncodingProfile *b);
186 
187 GST_PBUTILS_API
188 GstCaps *       gst_encoding_profile_get_input_caps     (GstEncodingProfile *profile);
189 
190 GST_PBUTILS_API
191 const gchar *   gst_encoding_profile_get_type_nick      (GstEncodingProfile *profile);
192 
193 GST_PBUTILS_API
194 const gchar *   gst_encoding_profile_get_file_extension (GstEncodingProfile * profile);
195 
196 GST_PBUTILS_API
197 GstEncodingProfile * gst_encoding_profile_find (const gchar *targetname,
198                                                 const gchar *profilename,
199                                                 const gchar *category);
200 
201 GST_PBUTILS_API
202 gboolean        gst_encoding_profile_is_enabled        (GstEncodingProfile *profile);
203 
204 GST_PBUTILS_API
205 void            gst_encoding_profile_set_enabled       (GstEncodingProfile *profile,
206                                                          gboolean enabled);
207 /* GstEncodingContainerProfile API */
208 
209 GST_PBUTILS_API
210 gboolean        gst_encoding_container_profile_add_profile       (GstEncodingContainerProfile *container,
211                                                                   GstEncodingProfile *profile);
212 
213 GST_PBUTILS_API
214 gboolean        gst_encoding_container_profile_contains_profile  (GstEncodingContainerProfile * container,
215                                                                   GstEncodingProfile *profile);
216 
217 GST_PBUTILS_API
218 const GList *   gst_encoding_container_profile_get_profiles      (GstEncodingContainerProfile *profile);
219 
220 
221 GST_PBUTILS_API
222 GstEncodingContainerProfile *  gst_encoding_container_profile_new (const gchar *name,
223                                                                    const gchar *description,
224                                                                    GstCaps *format,
225                                                                    const gchar *preset);
226 
227 
228 /* Invidual stream encodingprofile API */
229 
230 GST_PBUTILS_API
231 GstEncodingVideoProfile * gst_encoding_video_profile_new (GstCaps *format,
232                                                           const gchar *preset,
233                                                           GstCaps *restriction,
234                                                           guint presence);
235 
236 GST_PBUTILS_API
237 GstEncodingAudioProfile * gst_encoding_audio_profile_new (GstCaps *format,
238                                                           const gchar *preset,
239                                                           GstCaps *restriction,
240                                                           guint presence);
241 
242 GST_PBUTILS_API
243 guint    gst_encoding_video_profile_get_pass              (GstEncodingVideoProfile *prof);
244 
245 GST_PBUTILS_API
246 gboolean gst_encoding_video_profile_get_variableframerate (GstEncodingVideoProfile *prof);
247 
248 GST_PBUTILS_API
249 void     gst_encoding_video_profile_set_pass              (GstEncodingVideoProfile *prof,
250                                                            guint pass);
251 
252 GST_PBUTILS_API
253 void     gst_encoding_video_profile_set_variableframerate (GstEncodingVideoProfile *prof,
254                                                            gboolean variableframerate);
255 
256 GST_PBUTILS_API
257 GstEncodingProfile * gst_encoding_profile_from_discoverer (GstDiscovererInfo *info);
258 
259 GST_PBUTILS_API
260 GstEncodingProfile * gst_encoding_profile_copy (GstEncodingProfile *self);
261 
262 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
263 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingAudioProfile, gst_object_unref)
264 #endif
265 
266 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
267 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingContainerProfile, gst_object_unref)
268 #endif
269 
270 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
271 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingProfile, gst_object_unref)
272 #endif
273 
274 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
275 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingVideoProfile, gst_object_unref)
276 #endif
277 
278 G_END_DECLS
279 
280 #endif /* __GST_PROFILE_H__ */
281