60e148d9cc53be2700360487cde39fea0a5fdecc
[platform/upstream/gst-plugins-base.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., 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 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
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 GType gst_encoding_profile_get_type (void);
47
48
49
50 /**
51  * GstEncodingContainerProfile:
52  *
53  * Encoding profiles for containers. Keeps track of a list of #GstEncodingProfile
54  */
55 #define GST_TYPE_ENCODING_CONTAINER_PROFILE                     \
56   (gst_encoding_container_profile_get_type ())
57 #define GST_ENCODING_CONTAINER_PROFILE(obj)                     \
58   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_CONTAINER_PROFILE, GstEncodingContainerProfile))
59 #define GST_IS_ENCODING_CONTAINER_PROFILE(obj)                  \
60   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_CONTAINER_PROFILE))
61 typedef struct _GstEncodingContainerProfile GstEncodingContainerProfile;
62 typedef struct _GstEncodingContainerProfileClass GstEncodingContainerProfileClass;
63 GType gst_encoding_container_profile_get_type (void);
64
65
66
67 /**
68  * GstEncodingVideoProfile:
69  *
70  * Variant of #GstEncodingProfile for video streams, allows specifying the @pass.
71  */
72 #define GST_TYPE_ENCODING_VIDEO_PROFILE                 \
73   (gst_encoding_video_profile_get_type ())
74 #define GST_ENCODING_VIDEO_PROFILE(obj)                 \
75   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_VIDEO_PROFILE, GstEncodingVideoProfile))
76 #define GST_IS_ENCODING_VIDEO_PROFILE(obj)                      \
77   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_VIDEO_PROFILE))
78 typedef struct _GstEncodingVideoProfile GstEncodingVideoProfile;
79 typedef struct _GstEncodingVideoProfileClass GstEncodingVideoProfileClass;
80 GType gst_encoding_video_profile_get_type (void);
81
82
83
84 /**
85  * GstEncodingAudioProfile:
86  *
87  * Variant of #GstEncodingProfile for audio streams.
88  */
89 #define GST_TYPE_ENCODING_AUDIO_PROFILE                 \
90   (gst_encoding_audio_profile_get_type ())
91 #define GST_ENCODING_AUDIO_PROFILE(obj)                 \
92   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_AUDIO_PROFILE, GstEncodingAudioProfile))
93 #define GST_IS_ENCODING_AUDIO_PROFILE(obj)                      \
94   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_AUDIO_PROFILE))
95 typedef struct _GstEncodingAudioProfile GstEncodingAudioProfile;
96 typedef struct _GstEncodingAudioProfileClass GstEncodingAudioProfileClass;
97 GType gst_encoding_audio_profile_get_type (void);
98
99
100
101 /* GstEncodingProfile API */
102
103 /**
104  * gst_encoding_profile_unref:
105  * @profile: a #GstEncodingProfile
106  *
107  * Decreases the reference count of the @profile, possibly freeing the @profile.
108  */
109 #define gst_encoding_profile_unref(profile) (g_object_unref ((GObject*) profile))
110
111 /**
112  * gst_encoding_profile_ref:
113  * @profile: a #GstEncodingProfile
114  *
115  * Increases the reference count of the @profile.
116  */
117 #define gst_encoding_profile_ref(profile) (g_object_ref ((GObject*) profile))
118
119 const gchar *   gst_encoding_profile_get_name           (GstEncodingProfile *profile);
120 void            gst_encoding_profile_set_name           (GstEncodingProfile *profile,
121                                                          const gchar *name);
122 const gchar *   gst_encoding_profile_get_description    (GstEncodingProfile *profile);
123 void            gst_encoding_profile_set_description    (GstEncodingProfile *profile,
124                                                          const gchar *description);
125 GstCaps *       gst_encoding_profile_get_format         (GstEncodingProfile *profile);
126 void            gst_encoding_profile_set_format         (GstEncodingProfile *profile,
127                                                          GstCaps *format);
128 const gchar *   gst_encoding_profile_get_preset         (GstEncodingProfile *profile);
129 const gchar *   gst_encoding_profile_get_preset_name    (GstEncodingProfile *profile);
130 void            gst_encoding_profile_set_preset         (GstEncodingProfile *profile,
131                                                          const gchar *preset);
132 guint           gst_encoding_profile_get_presence       (GstEncodingProfile *profile);
133 void            gst_encoding_profile_set_presence       (GstEncodingProfile *profile,
134                                                          guint presence);
135 void            gst_encoding_profile_set_preset_name    (GstEncodingProfile * profile,
136                                                          const gchar * preset_name);
137 GstCaps *       gst_encoding_profile_get_restriction    (GstEncodingProfile *profile);
138 void            gst_encoding_profile_set_restriction    (GstEncodingProfile *profile,
139                                                          GstCaps *restriction);
140
141 gboolean        gst_encoding_profile_is_equal           (GstEncodingProfile *a,
142                                                          GstEncodingProfile *b);
143 GstCaps *       gst_encoding_profile_get_input_caps     (GstEncodingProfile *profile);
144 const gchar *   gst_encoding_profile_get_type_nick      (GstEncodingProfile *profile);
145
146 const gchar *   gst_encoding_profile_get_file_extension (GstEncodingProfile * profile);
147
148 GstEncodingProfile * gst_encoding_profile_find (const gchar *targetname,
149                                                 const gchar *profilename,
150                                                 const gchar *category);
151
152 /* GstEncodingContainerProfile API */
153 gboolean        gst_encoding_container_profile_add_profile       (GstEncodingContainerProfile *container,
154                                                                   GstEncodingProfile *profile);
155 gboolean        gst_encoding_container_profile_contains_profile  (GstEncodingContainerProfile * container,
156                                                                   GstEncodingProfile *profile);
157 const GList *   gst_encoding_container_profile_get_profiles      (GstEncodingContainerProfile *profile);
158
159
160 GstEncodingContainerProfile *  gst_encoding_container_profile_new (const gchar *name,
161                                                                    const gchar *description,
162                                                                    GstCaps *format,
163                                                                    const gchar *preset);
164
165
166 /* Invidual stream encodingprofile API */
167 GstEncodingVideoProfile * gst_encoding_video_profile_new (GstCaps *format,
168                                                           const gchar *preset,
169                                                           GstCaps *restriction,
170                                                           guint presence);
171 GstEncodingAudioProfile * gst_encoding_audio_profile_new (GstCaps *format,
172                                                           const gchar *preset,
173                                                           GstCaps *restriction,
174                                                           guint presence);
175
176 guint    gst_encoding_video_profile_get_pass              (GstEncodingVideoProfile *prof);
177 gboolean gst_encoding_video_profile_get_variableframerate (GstEncodingVideoProfile *prof);
178
179 void     gst_encoding_video_profile_set_pass              (GstEncodingVideoProfile *prof,
180                                                            guint pass);
181 void     gst_encoding_video_profile_set_variableframerate (GstEncodingVideoProfile *prof,
182                                                            gboolean variableframerate);
183
184 GstEncodingProfile * gst_encoding_profile_from_discoverer (GstDiscovererInfo *info);
185
186 G_END_DECLS
187
188 #endif /* __GST_PROFILE_H__ */