bdfe3065adb5762ef483a1e54ae77adb5f7bb468
[platform/upstream/gstreamer.git] / gst-libs / gst / pbutils / encoding-target.h
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., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, 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  * GstEncodingTarget:
76  *
77  * Collection of #GstEncodingProfile for a specific target or use-case.
78  *
79  * When being stored/loaded, targets come from a specific category, like
80  * #GST_ENCODING_CATEGORY_DEVICE.
81  */
82 #define GST_TYPE_ENCODING_TARGET                        \
83   (gst_encoding_target_get_type ())
84 #define GST_ENCODING_TARGET(obj)                        \
85   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_TARGET, GstEncodingTarget))
86 #define GST_IS_ENCODING_TARGET(obj)                     \
87   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_TARGET))
88
89 typedef struct _GstEncodingTarget GstEncodingTarget;
90 typedef GObjectClass GstEncodingTargetClass;
91
92 GType gst_encoding_target_get_type (void);
93
94 /**
95  * gst_encoding_target_unref:
96  * @target: a #GstEncodingTarget
97  *
98  * Decreases the reference count of the @target, possibly freeing it.
99  */
100 #define gst_encoding_target_unref(target) \
101   (g_object_unref ((GObject*) target))
102
103 /**
104  * gst_encoding_target_ref:
105  * @target: a #GstEncodingTarget
106  *
107  * Increases the reference count of the @target.
108  */
109 #define gst_encoding_target_ref(target) \
110   (g_object_ref ((GObject*) target))
111
112 GstEncodingTarget *     gst_encoding_target_new                 (const gchar *name,
113                                                                  const gchar *category,
114                                                                  const gchar *description,
115                                                                  const GList *profiles);
116
117 const gchar *           gst_encoding_target_get_name            (GstEncodingTarget *target);
118 const gchar *           gst_encoding_target_get_category        (GstEncodingTarget *target);
119 const gchar *           gst_encoding_target_get_description     (GstEncodingTarget *target);
120 const GList *           gst_encoding_target_get_profiles        (GstEncodingTarget *target);
121 GstEncodingProfile *    gst_encoding_target_get_profile         (GstEncodingTarget *target,
122                                                                  const gchar *name);
123
124 gboolean                gst_encoding_target_add_profile         (GstEncodingTarget *target,
125                                                                  GstEncodingProfile *profile);
126
127 gboolean                gst_encoding_target_save                (GstEncodingTarget *target,
128                                                                  GError **error);
129 gboolean                gst_encoding_target_save_to_file        (GstEncodingTarget *target,
130                                                                  const gchar *filepath,
131                                                                  GError **error);
132 GstEncodingTarget *     gst_encoding_target_load                (const gchar *name,
133                                                                  const gchar *category,
134                                                                  GError **error);
135 GstEncodingTarget *     gst_encoding_target_load_from_file      (const gchar *filepath,
136                                                                  GError **error);
137
138 GList *                 gst_encoding_list_available_categories  (void);
139 GList *                 gst_encoding_list_all_targets           (const gchar * categoryname);
140
141 G_END_DECLS
142
143 #endif  /* __GST_PROFILE_REGISTRY_H__ */