Debian Codegraph @

gstreamer/gstreamermm/typefind.h

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2 #ifndef _GSTREAMERMM_TYPEFIND_H
3 #define _GSTREAMERMM_TYPEFIND_H
4
5
6 #include <glibmm/ustring.h>
7 #include <sigc++/sigc++.h>
8
9 /* gstreamermm - a C++ wrapper for gstreamer
10 *
11 * Copyright 2009 The gstreamermm Development Team
12 *
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 2.1 of the License, or (at your option) any later version.
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28 #include <gst/gst.h>
29 #include <glibmm/arrayhandle.h>
30
31
32 namespace Gst
33 {
34
35 /** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */
36
37 /**
38 * @var TypeFindProbability TYPE_FIND_NONE
39 * Type undetected.
40 *
41 * @var TypeFindProbability TYPE_FIND_MINIMUM
42 * Unlikely typefind.
43 *
44 * @var TypeFindProbability TYPE_FIND_POSSIBLE
45 * Possible type detected.
46 *
47 * @var TypeFindProbability TYPE_FIND_LIKELY
48 * Likely a type was detected.
49 *
50 * @var TypeFindProbability TYPE_FIND_NEARLY_CERTAIN
51 * Nearly certain that a type was detected.
52 *
53 * @var TypeFindProbability TYPE_FIND_MAXIMUM
54 * Very certain a type was detected.
55 *
56 * @enum TypeFindProbability
57 *
58 * The probability of the typefind function. Higher values have more certainty
59 * in doing a reliable typefind.
60 *
61 * @ingroup gstreamermmEnums
62 */
63 enum TypeFindProbability
64 {
65 TYPE_FIND_NONE = 0,
66 TYPE_FIND_MINIMUM = 1,
67 TYPE_FIND_POSSIBLE = 50,
68 TYPE_FIND_LIKELY = 80,
69 TYPE_FIND_NEARLY_CERTAIN = 99,
70 TYPE_FIND_MAXIMUM = 100
71 };
72
73 } // namespace Gst
74
75 #ifndef DOXYGEN_SHOULD_SKIP_THIS
76 namespace Glib
77 {
78
79 template <>
80 class Value<Gst::TypeFindProbability> : public Glib::Value_Enum<Gst::TypeFindProbability>
81 {
82 public:
83 static GType value_type() G_GNUC_CONST;
84 };
85
86 } // namespace Glib
87 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
88
89 namespace Gst
90 {
91
92
93 class Caps;
94 class Plugin;
95
96 /** A class used for stream type detection.
97 * Gst::TypeFind methods allow you to detect the media type of an unknown
98 * stream.
99 *
100 * Last reviewed on 2005-11-09 (0.9.4).
101 */
102 class TypeFind
103 {
104 //TODO: Maybe file a GStreamer bug about GstTypeFind not being a GObject
105 //making it difficult for C++ developers to write their own TypeFind classes
106 //(see the Gst::TypeFindFactory class docs for more info).
107 public:
108 #ifndef DOXYGEN_SHOULD_SKIP_THIS
109 using CppObjectType = TypeFind;
110 using BaseObjectType = GstTypeFind;
111 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
112
113 TypeFind(const TypeFind& other) noexcept;
114 TypeFind& operator=(const TypeFind& other) noexcept;
115
116 TypeFind(TypeFind&& other) noexcept;
117 TypeFind& operator=(TypeFind&& other) noexcept;
118
119 /** Get the GType for this class, for use with the underlying GObject type system.
120 */
121 static GType get_type() G_GNUC_CONST;
122
123 TypeFind();
124
125 explicit TypeFind(const GstTypeFind* gobject); // always takes a copy
126
127 ///Provides access to the underlying C instance.
128 GstTypeFind* gobj() { return &gobject_; }
129
130 ///Provides access to the underlying C instance.
131 const GstTypeFind* gobj() const { return &gobject_; }
132
133 protected:
134 GstTypeFind gobject_;
135
136 private:
137
138
139 public:
140 /** For example,
141 * void on_find();.
142 */
143 typedef sigc::slot<void> SlotFind;
144
145 public:
146
147
148 /** Returns the @a size bytes of the stream to identify beginning at offset. If
149 * offset is a positive number, the offset is relative to the beginning of the
150 * stream, if offset is a negative number the offset is relative to the end of
151 * the stream. The returned memory is valid until the typefinding function
152 * returns and must not be freed.
153 *
154 * Returns: the requested data, or <tt>nullptr</tt> if that data is not available.
155 *
156 * @param offset The offset.
157 * @param size The number of bytes to return.
158 * @return The requested data, or <tt>nullptr</tt> if that data is not available.
159 */
160 std::vector<guint8> peek(gint64 offset, guint size) const;
161
162
163 /** If a Gst::TypeFind::SlotFind calls this method it suggests the caps with the
164 * given probability. A Gst::TypeFind::SlotFind may supply different suggestions
165 * in one call.
166 * It is up to the caller of the Gst::TypeFind::SlotFind to interpret these
167 * values.
168 *
169 * @param probability The probability in percent that the suggestion is right.
170 * @param caps The fixed Gst::Caps to suggest.
171 */
172 void suggest(guint probability, const Glib::RefPtr<const Gst::Caps>& caps) const;
173
174
175 /** Get the length of the data stream.
176 *
177 * @return The length of the data stream, or 0 if it is not available.
178 */
179 guint64 get_length() const;
180
181 /** Registers a new typefind slot to be used for typefinding. After
182 * registering the slot will be available for typefinding. This method
183 * is typically called during an element's plugin initialization.
184 *
185 * @param plugin A Gst::Plugin (for a static typefind function, i.e. one not
186 * related to any Gst::Plugin, use register_slot() without the Gst::Plugin
187 * argument).
188 * @param name The name for registering.
189 * @param rank The rank (or importance) of this typefind function.
190 * @param find_slot The Gst::TypeFind::SlotFind to use.
191 * @param extensions Extensions belonging to this type (for no extensions use
192 * register_slot() with no extensions parameter).
193 * @param caps The caps to be returned when typefinding succeeds (for no
194 * caps, use register_slot() with no caps argument).
195 * @return true on success, false otherwise.
196 */
197 static bool register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions, const Glib::RefPtr<const Gst::Caps>& caps);
198
199 /** Registers a new typefind slot to be used for typefinding. After
200 * registering the slot will be available for typefinding. This method
201 * is typically called during an element's plugin initialization.
202 *
203 * @param plugin A Gst::Plugin (for a static typefind function, i.e. one not
204 * related to any Gst::Plugin, use register_slot() without the Gst::Plugin
205 * argument).
206 * @param name The name for registering.
207 * @param rank The rank (or importance) of this typefind function.
208 * @param find_slot The Gst::TypeFind::SlotFind to use.
209 * @param caps The caps to be returned when typefinding succeeds (for no
210 * caps, use register_slot() with no caps argument).
211 * @return true on success, false otherwise.
212 */
213 static bool register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::RefPtr<const Gst::Caps>& caps);
214
215 /** Registers a new typefind slot to be used for typefinding. After
216 * registering the slot will be available for typefinding. This method
217 * is typically called during an element's plugin initialization.
218 *
219 * @param plugin A Gst::Plugin (for a static typefind function, i.e. one not
220 * related to any Gst::Plugin, use register_slot() without the Gst::Plugin
221 * argument).
222 * @param name The name for registering.
223 * @param rank The rank (or importance) of this typefind function.
224 * @param find_slot The Gst::TypeFind::SlotFind to use.
225 * @param extensions Extensions belonging to this type (for no extensions use
226 * register_slot() with no extensions parameter).
227 * @return true on success, false otherwise.
228 */
229 static bool register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions);
230
231 /** Registers a new typefind slot to be used for typefinding. After
232 * registering the slot will be available for typefinding. This method
233 * is typically called during an element's plugin initialization.
234 *
235 * @param plugin A Gst::Plugin (for a static typefind function, i.e. one not
236 * related to any Gst::Plugin, use register_slot() without the Gst::Plugin
237 * argument).
238 * @param name The name for registering.
239 * @param rank The rank (or importance) of this typefind function.
240 * @param find_slot The Gst::TypeFind::SlotFind to use.
241 * @return true on success, false otherwise.
242 */
243 static bool register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot);
244
245 /** Registers a new static (not requiring a Gst::Plugin) typefind slot to be
246 * used for typefinding. After registering the slot will be available for
247 * typefinding.
248 *
249 * @param name The name for registering.
250 * @param rank The rank (or importance) of this typefind function.
251 * @param find_slot The Gst::TypeFind::SlotFind to use.
252 * @param extensions Extensions belonging to this type (for no extensions use
253 * register_slot() with no extensions parameter).
254 * @param caps The caps to be returned when typefinding succeeds (for no
255 * caps, use register_slot() with no caps argument).
256 * @return true on success, false otherwise.
257 */
258 static bool register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions, const Glib::RefPtr<const Gst::Caps>& caps);
259
260 /** Registers a new static (not requiring a Gst::Plugin) typefind slot to be
261 * used for typefinding. After registering the slot will be available for
262 * typefinding.
263 *
264 * @param name The name for registering.
265 * @param rank The rank (or importance) of this typefind function.
266 * @param find_slot The Gst::TypeFind::SlotFind to use.
267 * @param caps The caps to be returned when typefinding succeeds (for no
268 * caps, use register_slot() with no caps argument).
269 * @return true on success, false otherwise.
270 */
271 static bool register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::RefPtr<const Gst::Caps>& caps);
272
273 /** Registers a new static (not requiring a Gst::Plugin) typefind slot to be
274 * used for typefinding. After registering the slot will be available for
275 * typefinding.
276 *
277 * @param name The name for registering.
278 * @param rank The rank (or importance) of this typefind function.
279 * @param find_slot The Gst::TypeFind::SlotFind to use.
280 * @param extensions Extensions belonging to this type (for no extensions use
281 * register_slot() with no extensions parameter).
282 * @return true on success, false otherwise.
283 */
284 static bool register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions);
285
286 /** Registers a new static (not requiring a Gst::Plugin) typefind slot to be
287 * used for typefinding. After registering the slot will be available for
288 * typefinding.
289 *
290 * @param name The name for registering.
291 * @param rank The rank (or importance) of this typefind function.
292 * @param find_slot The Gst::TypeFind::SlotFind to use.
293 * @return true on success, false otherwise.
294 */
295 static bool register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot);
296
297
298 };
299
300 } // namespace Gst
301
302
303 namespace Glib
304 {
305
306 /** @relates Gst::TypeFind
307 * @param object The C instance
308 * @result A C++ instance that wraps this C instance.
309 */
310 Gst::TypeFind& wrap(GstTypeFind* object);
311
312 /** @relates Gst::TypeFind
313 * @param object The C instance
314 * @result A C++ instance that wraps this C instance.
315 */
316 const Gst::TypeFind& wrap(const GstTypeFind* object);
317
318 #ifndef DOXYGEN_SHOULD_SKIP_THIS
319 template <>
320 class Value<Gst::TypeFind> : public Glib::Value_Boxed<Gst::TypeFind>
321 {};
322 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
323
324 } // namespace Glib
325
326
327 #endif /* _GSTREAMERMM_TYPEFIND_H */
328