encoding-target.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /* GStreamer encoding profile registry
  2. * Copyright (C) 2010 Edward Hervey <[email protected]>
  3. * (C) 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_REGISTRY_H__
  21. #define __GST_PROFILE_REGISTRY_H__
  22. #include <gst/pbutils/encoding-profile.h>
  23. G_BEGIN_DECLS
  24. /* FIXME/UNKNOWNS
  25. *
  26. * Should encoding categories be well-known strings/quarks ?
  27. *
  28. */
  29. /**
  30. * GST_ENCODING_CATEGORY_DEVICE:
  31. *
  32. * #GstEncodingTarget category for device-specific targets.
  33. * The name of the target will usually be the constructor and model of the device,
  34. * and that target will contain #GstEncodingProfiles suitable for that device.
  35. */
  36. #define GST_ENCODING_CATEGORY_DEVICE "device"
  37. /**
  38. * GST_ENCODING_CATEGORY_ONLINE_SERVICE:
  39. *
  40. * #GstEncodingTarget category for online-services.
  41. * The name of the target will usually be the name of the online service
  42. * and that target will contain #GstEncodingProfiles suitable for that online
  43. * service.
  44. */
  45. #define GST_ENCODING_CATEGORY_ONLINE_SERVICE "online-service"
  46. /**
  47. * GST_ENCODING_CATEGORY_STORAGE_EDITING:
  48. *
  49. * #GstEncodingTarget category for storage, archiving and editing targets.
  50. * Those targets can be lossless and/or provide very fast random access content.
  51. * The name of the target will usually be the container type or editing target,
  52. * and that target will contain #GstEncodingProfiles suitable for editing or
  53. * storage.
  54. */
  55. #define GST_ENCODING_CATEGORY_STORAGE_EDITING "storage-editing"
  56. /**
  57. * GST_ENCODING_CATEGORY_CAPTURE:
  58. *
  59. * #GstEncodingTarget category for recording and capture.
  60. * Targets within this category are optimized for low latency encoding.
  61. */
  62. #define GST_ENCODING_CATEGORY_CAPTURE "capture"
  63. /**
  64. * GstEncodingTarget:
  65. *
  66. * Collection of #GstEncodingProfile for a specific target or use-case.
  67. *
  68. * When being stored/loaded, targets come from a specific category, like
  69. * #GST_ENCODING_CATEGORY_DEVICE.
  70. */
  71. #define GST_TYPE_ENCODING_TARGET \
  72. (gst_encoding_target_get_type ())
  73. #define GST_ENCODING_TARGET(obj) \
  74. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_TARGET, GstEncodingTarget))
  75. #define GST_IS_ENCODING_TARGET(obj) \
  76. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_TARGET))
  77. typedef struct _GstEncodingTarget GstEncodingTarget;
  78. typedef GObjectClass GstEncodingTargetClass;
  79. GType gst_encoding_target_get_type (void);
  80. /**
  81. * gst_encoding_target_unref:
  82. * @target: a #GstEncodingTarget
  83. *
  84. * Decreases the reference count of the @target, possibly freeing it.
  85. */
  86. #define gst_encoding_target_unref(target) \
  87. (g_object_unref ((GObject*) target))
  88. /**
  89. * gst_encoding_target_ref:
  90. * @target: a #GstEncodingTarget
  91. *
  92. * Increases the reference count of the @target.
  93. */
  94. #define gst_encoding_target_ref(target) \
  95. (g_object_ref ((GObject*) target))
  96. GstEncodingTarget * gst_encoding_target_new (const gchar *name,
  97. const gchar *category,
  98. const gchar *description,
  99. const GList *profiles);
  100. const gchar * gst_encoding_target_get_name (GstEncodingTarget *target);
  101. const gchar * gst_encoding_target_get_category (GstEncodingTarget *target);
  102. const gchar * gst_encoding_target_get_description (GstEncodingTarget *target);
  103. const GList * gst_encoding_target_get_profiles (GstEncodingTarget *target);
  104. GstEncodingProfile * gst_encoding_target_get_profile (GstEncodingTarget *target,
  105. const gchar *name);
  106. gboolean gst_encoding_target_add_profile (GstEncodingTarget *target,
  107. GstEncodingProfile *profile);
  108. gboolean gst_encoding_target_save (GstEncodingTarget *target,
  109. GError **error);
  110. gboolean gst_encoding_target_save_to_file (GstEncodingTarget *target,
  111. const gchar *filepath,
  112. GError **error);
  113. GstEncodingTarget * gst_encoding_target_load (const gchar *name,
  114. const gchar *category,
  115. GError **error);
  116. GstEncodingTarget * gst_encoding_target_load_from_file (const gchar *filepath,
  117. GError **error);
  118. GList * gst_encoding_list_available_categories (void);
  119. GList * gst_encoding_list_all_targets (const gchar * categoryname);
  120. G_END_DECLS
  121. #endif /* __GST_PROFILE_REGISTRY_H__ */