rtsp: Port to GIO
[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  * 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 GObjectClass 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   (g_object_unref ((GObject*) 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   (g_object_ref ((GObject*) target))
117
118 GstEncodingTarget *     gst_encoding_target_new                 (const gchar *name,
119                                                                  const gchar *category,
120                                                                  const gchar *description,
121                                                                  const GList *profiles);
122
123 const gchar *           gst_encoding_target_get_name            (GstEncodingTarget *target);
124 const gchar *           gst_encoding_target_get_category        (GstEncodingTarget *target);
125 const gchar *           gst_encoding_target_get_description     (GstEncodingTarget *target);
126 const GList *           gst_encoding_target_get_profiles        (GstEncodingTarget *target);
127 GstEncodingProfile *    gst_encoding_target_get_profile         (GstEncodingTarget *target,
128                                                                  const gchar *name);
129
130 gboolean                gst_encoding_target_add_profile         (GstEncodingTarget *target,
131                                                                  GstEncodingProfile *profile);
132
133 gboolean                gst_encoding_target_save                (GstEncodingTarget *target,
134                                                                  GError **error);
135 gboolean                gst_encoding_target_save_to_file        (GstEncodingTarget *target,
136                                                                  const gchar *filepath,
137                                                                  GError **error);
138 GstEncodingTarget *     gst_encoding_target_load                (const gchar *name,
139                                                                  const gchar *category,
140                                                                  GError **error);
141 GstEncodingTarget *     gst_encoding_target_load_from_file      (const gchar *filepath,
142                                                                  GError **error);
143
144 GList *                 gst_encoding_list_available_categories  (void);
145 GList *                 gst_encoding_list_all_targets           (const gchar * categoryname);
146
147 G_END_DECLS
148
149 #endif  /* __GST_PROFILE_REGISTRY_H__ */