tizen 2.0 init
[framework/multimedia/gst-plugins-base0.10.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  * Since: 0.10.32
83  */
84 #define GST_TYPE_ENCODING_TARGET                        \
85   (gst_encoding_target_get_type ())
86 #define GST_ENCODING_TARGET(obj)                        \
87   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ENCODING_TARGET, GstEncodingTarget))
88 #define GST_IS_ENCODING_TARGET(obj)                     \
89   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ENCODING_TARGET))
90
91 typedef struct _GstEncodingTarget GstEncodingTarget;
92 typedef GstMiniObjectClass GstEncodingTargetClass;
93
94 GType gst_encoding_target_get_type (void);
95
96 /**
97  * gst_encoding_target_unref:
98  * @target: a #GstEncodingTarget
99  *
100  * Decreases the reference count of the @target, possibly freeing it.
101  *
102  * Since: 0.10.32
103  */
104 #define gst_encoding_target_unref(target) \
105   (gst_mini_object_unref ((GstMiniObject*) target))
106
107 /**
108  * gst_encoding_target_ref:
109  * @target: a #GstEncodingTarget
110  *
111  * Increases the reference count of the @target.
112  *
113  * Since: 0.10.32
114  */
115 #define gst_encoding_target_ref(target) \
116   (gst_mini_object_ref ((GstMiniObject*) target))
117
118 GstEncodingTarget *
119 gst_encoding_target_new (const gchar *name, const gchar *category,
120                          const gchar *description, const GList *profiles);
121 const gchar *gst_encoding_target_get_name (GstEncodingTarget *target);
122 const gchar *gst_encoding_target_get_category (GstEncodingTarget *target);
123 const gchar *gst_encoding_target_get_description (GstEncodingTarget *target);
124 const GList *gst_encoding_target_get_profiles (GstEncodingTarget *target);
125 GstEncodingProfile *gst_encoding_target_get_profile (GstEncodingTarget *target,
126                                                      const gchar *name);
127
128 gboolean
129 gst_encoding_target_add_profile (GstEncodingTarget *target, GstEncodingProfile *profile);
130
131 gboolean gst_encoding_target_save (GstEncodingTarget *target,
132                                    GError **error);
133 gboolean gst_encoding_target_save_to_file (GstEncodingTarget *target,
134                                            const gchar *filepath,
135                                            GError **error);
136 GstEncodingTarget *gst_encoding_target_load (const gchar *name,
137                                              const gchar *category,
138                                              GError **error);
139 GstEncodingTarget *gst_encoding_target_load_from_file (const gchar *filepath,
140                                                        GError **error);
141
142 GList *gst_encoding_list_available_categories (void);
143 GList *gst_encoding_list_all_targets (const gchar * categoryname);
144
145 G_END_DECLS
146
147 #endif  /* __GST_PROFILE_REGISTRY_H__ */