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
156const gchar * gst_encoding_profile_get_preset (GstEncodingProfile *profile);
157
158GST_PBUTILS_API
159const gchar * gst_encoding_profile_get_preset_name (GstEncodingProfile *profile);
160
161GST_PBUTILS_API
162void gst_encoding_profile_set_preset (GstEncodingProfile *profile,
163 const gchar *preset);
164
165GST_PBUTILS_API
166guint gst_encoding_profile_get_presence (GstEncodingProfile *profile);
167
168GST_PBUTILS_API
169void gst_encoding_profile_set_presence (GstEncodingProfile *profile,
170 guint presence);
171
172GST_PBUTILS_API
173void gst_encoding_profile_set_preset_name (GstEncodingProfile * profile,
174 const gchar * preset_name);
175
176GST_PBUTILS_API
177GstCaps * gst_encoding_profile_get_restriction (GstEncodingProfile *profile);
178
179GST_PBUTILS_API
180void gst_encoding_profile_set_restriction (GstEncodingProfile *profile,
181 GstCaps *restriction);
182
183GST_PBUTILS_API
184gboolean gst_encoding_profile_is_equal (GstEncodingProfile *a,
185 GstEncodingProfile *b);
186
187GST_PBUTILS_API
188GstCaps * gst_encoding_profile_get_input_caps (GstEncodingProfile *profile);
189
190GST_PBUTILS_API
191const gchar * gst_encoding_profile_get_type_nick (GstEncodingProfile *profile);
192
193GST_PBUTILS_API
194const gchar * gst_encoding_profile_get_file_extension (GstEncodingProfile * profile);
195
196GST_PBUTILS_API
197GstEncodingProfile * gst_encoding_profile_find (const gchar *targetname,
198 const gchar *profilename,
199 const gchar *category);
200
201GST_PBUTILS_API
202gboolean gst_encoding_profile_is_enabled (GstEncodingProfile *profile);
203
204GST_PBUTILS_API
205void gst_encoding_profile_set_enabled (GstEncodingProfile *profile,
206 gboolean enabled);
207/* GstEncodingContainerProfile API */
208
209GST_PBUTILS_API
210gboolean gst_encoding_container_profile_add_profile (GstEncodingContainerProfile *container,
211 GstEncodingProfile *profile);
212
213GST_PBUTILS_API
214gboolean gst_encoding_container_profile_contains_profile (GstEncodingContainerProfile * container,
215 GstEncodingProfile *profile);
216
217GST_PBUTILS_API
218const GList * gst_encoding_container_profile_get_profiles (GstEncodingContainerProfile *profile);
219
220
221GST_PBUTILS_API
222GstEncodingContainerProfile * 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
230GST_PBUTILS_API
231GstEncodingVideoProfile * gst_encoding_video_profile_new (GstCaps *format,
232 const gchar *preset,
233 GstCaps *restriction,
234 guint presence);
235
236GST_PBUTILS_API
237GstEncodingAudioProfile * gst_encoding_audio_profile_new (GstCaps *format,
238 const gchar *preset,
239 GstCaps *restriction,
240 guint presence);
241
242GST_PBUTILS_API
243guint gst_encoding_video_profile_get_pass (GstEncodingVideoProfile *prof);
244
245GST_PBUTILS_API
246gboolean gst_encoding_video_profile_get_variableframerate (GstEncodingVideoProfile *prof);
247
248GST_PBUTILS_API
249void gst_encoding_video_profile_set_pass (GstEncodingVideoProfile *prof,
250 guint pass);
251
252GST_PBUTILS_API
253void gst_encoding_video_profile_set_variableframerate (GstEncodingVideoProfile *prof,
254 gboolean variableframerate);
255
256GST_PBUTILS_API
257GstEncodingProfile * gst_encoding_profile_from_discoverer (GstDiscovererInfo *info);
258
259GST_PBUTILS_API
260GstEncodingProfile * gst_encoding_profile_copy (GstEncodingProfile *self);
261
262#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
263G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingAudioProfile, gst_object_unref)
264#endif
265
266#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
267G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingContainerProfile, gst_object_unref)
268#endif
269
270#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
271G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingProfile, gst_object_unref)
272#endif
273
274#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
275G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingVideoProfile, gst_object_unref)
276#endif
277
278G_END_DECLS
279
280#endif /* __GST_PROFILE_H__ */
281