1 /* GStreamer encoding profile registry 2 * Copyright (C) 2010 Edward Hervey <edward.hervey@collabora.co.uk> 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 21 #ifndef __GST_PROFILE_REGISTRY_H__ 22 #define __GST_PROFILE_REGISTRY_H__ 23 24 #include <gst/pbutils/encoding-profile.h> 25 26 G_BEGIN_DECLS 27 28 29 /* FIXME/UNKNOWNS 30 * 31 * Should encoding categories be well-known strings/quarks ? 32 * 33 */ 34 35 /** 36 * GST_ENCODING_CATEGORY_DEVICE: 37 * 38 * #GstEncodingTarget category for device-specific targets. 39 * The name of the target will usually be the constructor and model of the device, 40 * and that target will contain #GstEncodingProfiles suitable for that device. 41 */ 42 #define GST_ENCODING_CATEGORY_DEVICE "device" 43 44 /** 45 * GST_ENCODING_CATEGORY_ONLINE_SERVICE: 46 * 47 * #GstEncodingTarget category for online-services. 48 * The name of the target will usually be the name of the online service 49 * and that target will contain #GstEncodingProfiles suitable for that online 50 * service. 51 */ 52 53 #define GST_ENCODING_CATEGORY_ONLINE_SERVICE "online-service" 54 55 /** 56 * GST_ENCODING_CATEGORY_STORAGE_EDITING: 57 * 58 * #GstEncodingTarget category for storage, archiving and editing targets. 59 * Those targets can be lossless and/or provide very fast random access content. 60 * The name of the target will usually be the container type or editing target, 61 * and that target will contain #GstEncodingProfiles suitable for editing or 62 * storage. 63 */ 64 #define GST_ENCODING_CATEGORY_STORAGE_EDITING "storage-editing" 65 66 /** 67 * GST_ENCODING_CATEGORY_CAPTURE: 68 * 69 * #GstEncodingTarget category for recording and capture. 70 * Targets within this category are optimized for low latency encoding. 71 */ 72 #define GST_ENCODING_CATEGORY_CAPTURE "capture" 73 74 /** 75 * GST_ENCODING_CATEGORY_FILE_EXTENSION: 76 * 77 * #GstEncodingTarget category for file extensions. 78 * The name of the target will be the name of the file extensions possible 79 * for a particular target. Those targets are defining like 'default' formats 80 * usually used for a particular file extension. 81 */ 82 83 #define GST_ENCODING_CATEGORY_FILE_EXTENSION "file-extension" 84 85 /** 86 * GstEncodingTarget: 87 * 88 * Collection of #GstEncodingProfile for a specific target or use-case. 89 * 90 * When being stored/loaded, targets come from a specific category, like 91 * #GST_ENCODING_CATEGORY_DEVICE. 92 */ 93 #define GST_TYPE_ENCODING_TARGET \ 94 (gst_encoding_target_get_type ()) 95 #define GST_ENCODING_TARGET(obj) \ 96 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_TARGET, GstEncodingTarget)) 97 #define GST_IS_ENCODING_TARGET(obj) \ 98 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_TARGET)) 99 100 typedef struct _GstEncodingTarget GstEncodingTarget; 101 typedef GObjectClass GstEncodingTargetClass; 102 103 GST_PBUTILS_API 104 GType gst_encoding_target_get_type (void); 105 106 /** 107 * gst_encoding_target_unref: 108 * @target: a #GstEncodingTarget 109 * 110 * Decreases the reference count of the @target, possibly freeing it. 111 */ 112 #define gst_encoding_target_unref(target) \ 113 (g_object_unref ((GObject*) target)) 114 115 /** 116 * gst_encoding_target_ref: 117 * @target: a #GstEncodingTarget 118 * 119 * Increases the reference count of the @target. 120 */ 121 #define gst_encoding_target_ref(target) \ 122 (g_object_ref ((GObject*) target)) 123 124 GST_PBUTILS_API 125 GstEncodingTarget * gst_encoding_target_new (const gchar *name, 126 const gchar *category, 127 const gchar *description, 128 const GList *profiles); 129 130 GST_PBUTILS_API 131 const gchar * gst_encoding_target_get_name (GstEncodingTarget *target); 132 133 GST_PBUTILS_API 134 const gchar * gst_encoding_target_get_category (GstEncodingTarget *target); 135 136 GST_PBUTILS_API 137 const gchar * gst_encoding_target_get_description (GstEncodingTarget *target); 138 139 GST_PBUTILS_API 140 const gchar * gst_encoding_target_get_path (GstEncodingTarget *target); 141 142 GST_PBUTILS_API 143 const GList * gst_encoding_target_get_profiles (GstEncodingTarget *target); 144 145 GST_PBUTILS_API 146 GstEncodingProfile * gst_encoding_target_get_profile (GstEncodingTarget *target, 147 const gchar *name); 148 149 GST_PBUTILS_API 150 gboolean gst_encoding_target_add_profile (GstEncodingTarget *target, 151 GstEncodingProfile *profile); 152 153 GST_PBUTILS_API 154 gboolean gst_encoding_target_save (GstEncodingTarget *target, 155 GError **error); 156 157 GST_PBUTILS_API 158 gboolean gst_encoding_target_save_to_file (GstEncodingTarget *target, 159 const gchar *filepath, 160 GError **error); 161 162 GST_PBUTILS_API 163 GstEncodingTarget * gst_encoding_target_load (const gchar *name, 164 const gchar *category, 165 GError **error); 166 167 GST_PBUTILS_API 168 GstEncodingTarget * gst_encoding_target_load_from_file (const gchar *filepath, 169 GError **error); 170 171 GST_PBUTILS_API 172 GList * gst_encoding_list_available_categories (void); 173 174 GST_PBUTILS_API 175 GList * gst_encoding_list_all_targets (const gchar * categoryname); 176 177 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstEncodingTarget, gst_object_unref) 178 179 G_END_DECLS 180 181 #endif /* __GST_PROFILE_REGISTRY_H__ */ 182