encoding-profile.h 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. #ifndef __GST_PROFILE_H__
  21. #define __GST_PROFILE_H__
  22. #include <gst/gst.h>
  23. #include <gst/pbutils/pbutils-enumtypes.h>
  24. #include <gst/pbutils/gstdiscoverer.h>
  25. G_BEGIN_DECLS
  26. /**
  27. * GstEncodingProfile:
  28. *
  29. * The opaque base class object for all encoding profiles. This contains generic
  30. * information like name, description, format and preset.
  31. */
  32. #define GST_TYPE_ENCODING_PROFILE \
  33. (gst_encoding_profile_get_type ())
  34. #define GST_ENCODING_PROFILE(obj) \
  35. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_PROFILE, GstEncodingProfile))
  36. #define GST_IS_ENCODING_PROFILE(obj) \
  37. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_PROFILE))
  38. typedef struct _GstEncodingProfile GstEncodingProfile;
  39. typedef struct _GstEncodingProfileClass GstEncodingProfileClass;
  40. GType gst_encoding_profile_get_type (void);
  41. /**
  42. * GstEncodingContainerProfile:
  43. *
  44. * Encoding profiles for containers. Keeps track of a list of #GstEncodingProfile
  45. */
  46. #define GST_TYPE_ENCODING_CONTAINER_PROFILE \
  47. (gst_encoding_container_profile_get_type ())
  48. #define GST_ENCODING_CONTAINER_PROFILE(obj) \
  49. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_CONTAINER_PROFILE, GstEncodingContainerProfile))
  50. #define GST_IS_ENCODING_CONTAINER_PROFILE(obj) \
  51. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_CONTAINER_PROFILE))
  52. typedef struct _GstEncodingContainerProfile GstEncodingContainerProfile;
  53. typedef struct _GstEncodingContainerProfileClass GstEncodingContainerProfileClass;
  54. GType gst_encoding_container_profile_get_type (void);
  55. /**
  56. * GstEncodingVideoProfile:
  57. *
  58. * Variant of #GstEncodingProfile for video streams, allows specifying the @pass.
  59. */
  60. #define GST_TYPE_ENCODING_VIDEO_PROFILE \
  61. (gst_encoding_video_profile_get_type ())
  62. #define GST_ENCODING_VIDEO_PROFILE(obj) \
  63. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_VIDEO_PROFILE, GstEncodingVideoProfile))
  64. #define GST_IS_ENCODING_VIDEO_PROFILE(obj) \
  65. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_VIDEO_PROFILE))
  66. typedef struct _GstEncodingVideoProfile GstEncodingVideoProfile;
  67. typedef struct _GstEncodingVideoProfileClass GstEncodingVideoProfileClass;
  68. GType gst_encoding_video_profile_get_type (void);
  69. /**
  70. * GstEncodingAudioProfile:
  71. *
  72. * Variant of #GstEncodingProfile for audio streams.
  73. */
  74. #define GST_TYPE_ENCODING_AUDIO_PROFILE \
  75. (gst_encoding_audio_profile_get_type ())
  76. #define GST_ENCODING_AUDIO_PROFILE(obj) \
  77. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_AUDIO_PROFILE, GstEncodingAudioProfile))
  78. #define GST_IS_ENCODING_AUDIO_PROFILE(obj) \
  79. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_AUDIO_PROFILE))
  80. typedef struct _GstEncodingAudioProfile GstEncodingAudioProfile;
  81. typedef struct _GstEncodingAudioProfileClass GstEncodingAudioProfileClass;
  82. GType gst_encoding_audio_profile_get_type (void);
  83. /* GstEncodingProfile API */
  84. /**
  85. * gst_encoding_profile_unref:
  86. * @profile: a #GstEncodingProfile
  87. *
  88. * Decreases the reference count of the @profile, possibly freeing the @profile.
  89. */
  90. #define gst_encoding_profile_unref(profile) (g_object_unref ((GObject*) profile))
  91. /**
  92. * gst_encoding_profile_ref:
  93. * @profile: a #GstEncodingProfile
  94. *
  95. * Increases the reference count of the @profile.
  96. */
  97. #define gst_encoding_profile_ref(profile) (g_object_ref ((GObject*) profile))
  98. const gchar * gst_encoding_profile_get_name (GstEncodingProfile *profile);
  99. void gst_encoding_profile_set_name (GstEncodingProfile *profile,
  100. const gchar *name);
  101. const gchar * gst_encoding_profile_get_description (GstEncodingProfile *profile);
  102. void gst_encoding_profile_set_description (GstEncodingProfile *profile,
  103. const gchar *description);
  104. GstCaps * gst_encoding_profile_get_format (GstEncodingProfile *profile);
  105. void gst_encoding_profile_set_format (GstEncodingProfile *profile,
  106. GstCaps *format);
  107. gboolean gst_encoding_profile_get_allow_dynamic_output (GstEncodingProfile *profile);
  108. void gst_encoding_profile_set_allow_dynamic_output (GstEncodingProfile *profile,
  109. gboolean allow_dynamic_output);
  110. const gchar * gst_encoding_profile_get_preset (GstEncodingProfile *profile);
  111. const gchar * gst_encoding_profile_get_preset_name (GstEncodingProfile *profile);
  112. void gst_encoding_profile_set_preset (GstEncodingProfile *profile,
  113. const gchar *preset);
  114. guint gst_encoding_profile_get_presence (GstEncodingProfile *profile);
  115. void gst_encoding_profile_set_presence (GstEncodingProfile *profile,
  116. guint presence);
  117. void gst_encoding_profile_set_preset_name (GstEncodingProfile * profile,
  118. const gchar * preset_name);
  119. GstCaps * gst_encoding_profile_get_restriction (GstEncodingProfile *profile);
  120. void gst_encoding_profile_set_restriction (GstEncodingProfile *profile,
  121. GstCaps *restriction);
  122. gboolean gst_encoding_profile_is_equal (GstEncodingProfile *a,
  123. GstEncodingProfile *b);
  124. GstCaps * gst_encoding_profile_get_input_caps (GstEncodingProfile *profile);
  125. const gchar * gst_encoding_profile_get_type_nick (GstEncodingProfile *profile);
  126. const gchar * gst_encoding_profile_get_file_extension (GstEncodingProfile * profile);
  127. GstEncodingProfile * gst_encoding_profile_find (const gchar *targetname,
  128. const gchar *profilename,
  129. const gchar *category);
  130. gboolean gst_encoding_profile_is_enabled (GstEncodingProfile *profile);
  131. void gst_encoding_profile_set_enabled (GstEncodingProfile *profile,
  132. gboolean enabled);
  133. /* GstEncodingContainerProfile API */
  134. gboolean gst_encoding_container_profile_add_profile (GstEncodingContainerProfile *container,
  135. GstEncodingProfile *profile);
  136. gboolean gst_encoding_container_profile_contains_profile (GstEncodingContainerProfile * container,
  137. GstEncodingProfile *profile);
  138. const GList * gst_encoding_container_profile_get_profiles (GstEncodingContainerProfile *profile);
  139. GstEncodingContainerProfile * gst_encoding_container_profile_new (const gchar *name,
  140. const gchar *description,
  141. GstCaps *format,
  142. const gchar *preset);
  143. /* Invidual stream encodingprofile API */
  144. GstEncodingVideoProfile * gst_encoding_video_profile_new (GstCaps *format,
  145. const gchar *preset,
  146. GstCaps *restriction,
  147. guint presence);
  148. GstEncodingAudioProfile * gst_encoding_audio_profile_new (GstCaps *format,
  149. const gchar *preset,
  150. GstCaps *restriction,
  151. guint presence);
  152. guint gst_encoding_video_profile_get_pass (GstEncodingVideoProfile *prof);
  153. gboolean gst_encoding_video_profile_get_variableframerate (GstEncodingVideoProfile *prof);
  154. void gst_encoding_video_profile_set_pass (GstEncodingVideoProfile *prof,
  155. guint pass);
  156. void gst_encoding_video_profile_set_variableframerate (GstEncodingVideoProfile *prof,
  157. gboolean variableframerate);
  158. GstEncodingProfile * gst_encoding_profile_from_discoverer (GstDiscovererInfo *info);
  159. #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
  160. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingAudioProfile, gst_object_unref)
  161. #endif
  162. #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
  163. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingContainerProfile, gst_object_unref)
  164. #endif
  165. #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
  166. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingProfile, gst_object_unref)
  167. #endif
  168. #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
  169. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingVideoProfile, gst_object_unref)
  170. #endif
  171. G_END_DECLS
  172. #endif /* __GST_PROFILE_H__ */