encoding-profile.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /* GStreamer encoding profiles library
  2. * Copyright (C) 2009-2010 Edward Hervey <[email protected]>
  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. G_BEGIN_DECLS
  24. #include <gst/pbutils/pbutils-enumtypes.h>
  25. #include <gst/pbutils/gstdiscoverer.h>
  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. const gchar * gst_encoding_profile_get_preset (GstEncodingProfile *profile);
  108. const gchar * gst_encoding_profile_get_preset_name (GstEncodingProfile *profile);
  109. void gst_encoding_profile_set_preset (GstEncodingProfile *profile,
  110. const gchar *preset);
  111. guint gst_encoding_profile_get_presence (GstEncodingProfile *profile);
  112. void gst_encoding_profile_set_presence (GstEncodingProfile *profile,
  113. guint presence);
  114. void gst_encoding_profile_set_preset_name (GstEncodingProfile * profile,
  115. const gchar * preset_name);
  116. GstCaps * gst_encoding_profile_get_restriction (GstEncodingProfile *profile);
  117. void gst_encoding_profile_set_restriction (GstEncodingProfile *profile,
  118. GstCaps *restriction);
  119. gboolean gst_encoding_profile_is_equal (GstEncodingProfile *a,
  120. GstEncodingProfile *b);
  121. GstCaps * gst_encoding_profile_get_input_caps (GstEncodingProfile *profile);
  122. const gchar * gst_encoding_profile_get_type_nick (GstEncodingProfile *profile);
  123. const gchar * gst_encoding_profile_get_file_extension (GstEncodingProfile * profile);
  124. GstEncodingProfile * gst_encoding_profile_find (const gchar *targetname,
  125. const gchar *profilename,
  126. const gchar *category);
  127. /* GstEncodingContainerProfile API */
  128. gboolean gst_encoding_container_profile_add_profile (GstEncodingContainerProfile *container,
  129. GstEncodingProfile *profile);
  130. gboolean gst_encoding_container_profile_contains_profile (GstEncodingContainerProfile * container,
  131. GstEncodingProfile *profile);
  132. const GList * gst_encoding_container_profile_get_profiles (GstEncodingContainerProfile *profile);
  133. GstEncodingContainerProfile * gst_encoding_container_profile_new (const gchar *name,
  134. const gchar *description,
  135. GstCaps *format,
  136. const gchar *preset);
  137. /* Invidual stream encodingprofile API */
  138. GstEncodingVideoProfile * gst_encoding_video_profile_new (GstCaps *format,
  139. const gchar *preset,
  140. GstCaps *restriction,
  141. guint presence);
  142. GstEncodingAudioProfile * gst_encoding_audio_profile_new (GstCaps *format,
  143. const gchar *preset,
  144. GstCaps *restriction,
  145. guint presence);
  146. guint gst_encoding_video_profile_get_pass (GstEncodingVideoProfile *prof);
  147. gboolean gst_encoding_video_profile_get_variableframerate (GstEncodingVideoProfile *prof);
  148. void gst_encoding_video_profile_set_pass (GstEncodingVideoProfile *prof,
  149. guint pass);
  150. void gst_encoding_video_profile_set_variableframerate (GstEncodingVideoProfile *prof,
  151. gboolean variableframerate);
  152. GstEncodingProfile * gst_encoding_profile_from_discoverer (GstDiscovererInfo *info);
  153. G_END_DECLS
  154. #endif /* __GST_PROFILE_H__ */