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
29G_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))
44typedef struct _GstEncodingProfile GstEncodingProfile;
45typedef struct _GstEncodingProfileClass GstEncodingProfileClass;
46
47GST_PBUTILS_API
48GType 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))
63typedef struct _GstEncodingContainerProfile GstEncodingContainerProfile;
64typedef struct _GstEncodingContainerProfileClass GstEncodingContainerProfileClass;
65
66GST_PBUTILS_API
67GType 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))
82typedef struct _GstEncodingVideoProfile GstEncodingVideoProfile;
83typedef struct _GstEncodingVideoProfileClass GstEncodingVideoProfileClass;
84
85GST_PBUTILS_API
86GType 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))
101typedef struct _GstEncodingAudioProfile GstEncodingAudioProfile;
102typedef struct _GstEncodingAudioProfileClass GstEncodingAudioProfileClass;
103
104GST_PBUTILS_API
105GType 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
127GST_PBUTILS_API
128const gchar * gst_encoding_profile_get_name (GstEncodingProfile *profile);
129
130GST_PBUTILS_API
131void gst_encoding_profile_set_name (GstEncodingProfile *profile,
132 const gchar *name);
133
134GST_PBUTILS_API
135const gchar * gst_encoding_profile_get_description (GstEncodingProfile *profile);
136
137GST_PBUTILS_API
138void gst_encoding_profile_set_description (GstEncodingProfile *profile,
139 const gchar *description);
140
141GST_PBUTILS_API
142GstCaps * gst_encoding_profile_get_format (GstEncodingProfile *profile);
143
144GST_PBUTILS_API
145void gst_encoding_profile_set_format (GstEncodingProfile *profile,
146 GstCaps *format);
147
148GST_PBUTILS_API
149gboolean gst_encoding_profile_get_allow_dynamic_output (GstEncodingProfile *profile);
150
151GST_PBUTILS_API
152void gst_encoding_profile_set_allow_dynamic_output (GstEncodingProfile *profile,
153 gboolean allow_dynamic_output);
154
155GST_PBUTILS_API
156gboolean gst_encoding_profile_get_single_segment (GstEncodingProfile *profile);
157
158GST_PBUTILS_API
159void gst_encoding_profile_set_single_segment (GstEncodingProfile *profile,
160 gboolean single_segment);
161
162GST_PBUTILS_API
163const gchar * gst_encoding_profile_get_preset (GstEncodingProfile *profile);
164
165GST_PBUTILS_API
166const gchar * gst_encoding_profile_get_preset_name (GstEncodingProfile *profile);
167
168GST_PBUTILS_API
169void gst_encoding_profile_set_preset (GstEncodingProfile *profile,
170 const gchar *preset);
171
172GST_PBUTILS_API
173guint gst_encoding_profile_get_presence (GstEncodingProfile *profile);
174
175GST_PBUTILS_API
176void gst_encoding_profile_set_presence (GstEncodingProfile *profile,
177 guint presence);
178
179GST_PBUTILS_API
180void gst_encoding_profile_set_preset_name (GstEncodingProfile * profile,
181 const gchar * preset_name);
182
183GST_PBUTILS_API
184GstCaps * gst_encoding_profile_get_restriction (GstEncodingProfile *profile);
185
186GST_PBUTILS_API
187void gst_encoding_profile_set_restriction (GstEncodingProfile *profile,
188 GstCaps *restriction);
189
190GST_PBUTILS_API
191gboolean gst_encoding_profile_is_equal (GstEncodingProfile *a,
192 GstEncodingProfile *b);
193
194GST_PBUTILS_API
195GstCaps * gst_encoding_profile_get_input_caps (GstEncodingProfile *profile);
196
197GST_PBUTILS_API
198const gchar * gst_encoding_profile_get_type_nick (GstEncodingProfile *profile);
199
200GST_PBUTILS_API
201const gchar * gst_encoding_profile_get_file_extension (GstEncodingProfile * profile);
202
203GST_PBUTILS_API
204GstEncodingProfile * gst_encoding_profile_find (const gchar *targetname,
205 const gchar *profilename,
206 const gchar *category);
207
208GST_PBUTILS_API
209gboolean gst_encoding_profile_is_enabled (GstEncodingProfile *profile);
210
211GST_PBUTILS_API
212void gst_encoding_profile_set_enabled (GstEncodingProfile *profile,
213 gboolean enabled);
214/* GstEncodingContainerProfile API */
215
216GST_PBUTILS_API
217gboolean gst_encoding_container_profile_add_profile (GstEncodingContainerProfile *container,
218 GstEncodingProfile *profile);
219
220GST_PBUTILS_API
221gboolean gst_encoding_container_profile_contains_profile (GstEncodingContainerProfile * container,
222 GstEncodingProfile *profile);
223
224GST_PBUTILS_API
225const GList * gst_encoding_container_profile_get_profiles (GstEncodingContainerProfile *profile);
226
227
228GST_PBUTILS_API
229GstEncodingContainerProfile * gst_encoding_container_profile_new (const gchar *name,
230 const gchar *description,
231 GstCaps *format,
232 const gchar *preset);
233
234
235/* Individual stream encodingprofile API */
236
237GST_PBUTILS_API
238GstEncodingVideoProfile * gst_encoding_video_profile_new (GstCaps *format,
239 const gchar *preset,
240 GstCaps *restriction,
241 guint presence);
242
243GST_PBUTILS_API
244GstEncodingAudioProfile * gst_encoding_audio_profile_new (GstCaps *format,
245 const gchar *preset,
246 GstCaps *restriction,
247 guint presence);
248
249GST_PBUTILS_API
250guint gst_encoding_video_profile_get_pass (GstEncodingVideoProfile *prof);
251
252GST_PBUTILS_API
253gboolean gst_encoding_video_profile_get_variableframerate (GstEncodingVideoProfile *prof);
254
255GST_PBUTILS_API
256void gst_encoding_video_profile_set_pass (GstEncodingVideoProfile *prof,
257 guint pass);
258
259GST_PBUTILS_API
260void gst_encoding_video_profile_set_variableframerate (GstEncodingVideoProfile *prof,
261 gboolean variableframerate);
262
263GST_PBUTILS_API
264GstEncodingProfile * gst_encoding_profile_from_discoverer (GstDiscovererInfo *info);
265
266GST_PBUTILS_API
267GstEncodingProfile * gst_encoding_profile_copy (GstEncodingProfile *self);
268
269GST_PBUTILS_API
270void gst_encoding_profile_set_element_properties (GstEncodingProfile *self,
271 GstStructure *element_properties);
272
273GST_PBUTILS_API
274GstStructure *gst_encoding_profile_get_element_properties (GstEncodingProfile *self);
275
276G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingAudioProfile, gst_object_unref)
277
278G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingContainerProfile, gst_object_unref)
279
280G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingProfile, gst_object_unref)
281
282G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingVideoProfile, gst_object_unref)
283
284G_END_DECLS
285
286#endif /* __GST_PROFILE_H__ */
287

source code of include/gstreamer-1.0/gst/pbutils/encoding-profile.h