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