Debian Codegraph @

gstreamer/src/typefind.hg

raw
1 /* gstreamermm - a C++ wrapper for gstreamer
2 *
3 * Copyright 2009 The gstreamermm Development Team
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 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 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #include <gst/gst.h>
21 #include <glibmm/arrayhandle.h>
22
23 _DEFS(gstreamermm,gst)
24
25 namespace Gst
26 {
27
28 _WRAP_ENUM(TypeFindProbability, GstTypeFindProbability)
29
30 class Caps;
31 class Plugin;
32
33 /** A class used for stream type detection.
34 * Gst::TypeFind methods allow you to detect the media type of an unknown
35 * stream.
36 *
37 * Last reviewed on 2005-11-09 (0.9.4).
38 */
39 class TypeFind
40 {
41 //TODO: Maybe file a GStreamer bug about GstTypeFind not being a GObject
42 //making it difficult for C++ developers to write their own TypeFind classes
43 //(see the Gst::TypeFindFactory class docs for more info).
44 _CLASS_BOXEDTYPE_STATIC(TypeFind, GstTypeFind)
45
46 public:
47 /** For example,
48 * void on_find();.
49 */
50 typedef sigc::slot<void> SlotFind;
51
52 public:
53 #m4 _CONVERSION(`const guint8*', `std::vector<guint8>', `Glib::ArrayHandler<guint8>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
54 _WRAP_METHOD(std::vector<guint8> peek(gint64 offset, guint size) const, gst_type_find_peek)
55
56 _WRAP_METHOD(void suggest(guint probability, const Glib::RefPtr<const Gst::Caps>& caps) const, gst_type_find_suggest)
57 _IGNORE(gst_type_find_suggest_simple)
58
59 _WRAP_METHOD(guint64 get_length() const, gst_type_find_get_length)
60
61 /** Registers a new typefind slot to be used for typefinding. After
62 * registering the slot will be available for typefinding. This method
63 * is typically called during an element's plugin initialization.
64 *
65 * @param plugin A Gst::Plugin (for a static typefind function, i.e. one not
66 * related to any Gst::Plugin, use register_slot() without the Gst::Plugin
67 * argument).
68 * @param name The name for registering.
69 * @param rank The rank (or importance) of this typefind function.
70 * @param find_slot The Gst::TypeFind::SlotFind to use.
71 * @param extensions Extensions belonging to this type (for no extensions use
72 * register_slot() with no extensions parameter).
73 * @param caps The caps to be returned when typefinding succeeds (for no
74 * caps, use register_slot() with no caps argument).
75 * @return true on success, false otherwise.
76 */
77 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);
78
79 /** Registers a new typefind slot to be used for typefinding. After
80 * registering the slot will be available for typefinding. This method
81 * is typically called during an element's plugin initialization.
82 *
83 * @param plugin A Gst::Plugin (for a static typefind function, i.e. one not
84 * related to any Gst::Plugin, use register_slot() without the Gst::Plugin
85 * argument).
86 * @param name The name for registering.
87 * @param rank The rank (or importance) of this typefind function.
88 * @param find_slot The Gst::TypeFind::SlotFind to use.
89 * @param caps The caps to be returned when typefinding succeeds (for no
90 * caps, use register_slot() with no caps argument).
91 * @return true on success, false otherwise.
92 */
93 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);
94
95 /** Registers a new typefind slot to be used for typefinding. After
96 * registering the slot will be available for typefinding. This method
97 * is typically called during an element's plugin initialization.
98 *
99 * @param plugin A Gst::Plugin (for a static typefind function, i.e. one not
100 * related to any Gst::Plugin, use register_slot() without the Gst::Plugin
101 * argument).
102 * @param name The name for registering.
103 * @param rank The rank (or importance) of this typefind function.
104 * @param find_slot The Gst::TypeFind::SlotFind to use.
105 * @param extensions Extensions belonging to this type (for no extensions use
106 * register_slot() with no extensions parameter).
107 * @return true on success, false otherwise.
108 */
109 static bool register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions);
110
111 /** Registers a new typefind slot to be used for typefinding. After
112 * registering the slot will be available for typefinding. This method
113 * is typically called during an element's plugin initialization.
114 *
115 * @param plugin A Gst::Plugin (for a static typefind function, i.e. one not
116 * related to any Gst::Plugin, use register_slot() without the Gst::Plugin
117 * argument).
118 * @param name The name for registering.
119 * @param rank The rank (or importance) of this typefind function.
120 * @param find_slot The Gst::TypeFind::SlotFind to use.
121 * @return true on success, false otherwise.
122 */
123 static bool register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot);
124
125 /** Registers a new static (not requiring a Gst::Plugin) typefind slot to be
126 * used for typefinding. After registering the slot will be available for
127 * typefinding.
128 *
129 * @param name The name for registering.
130 * @param rank The rank (or importance) of this typefind function.
131 * @param find_slot The Gst::TypeFind::SlotFind to use.
132 * @param extensions Extensions belonging to this type (for no extensions use
133 * register_slot() with no extensions parameter).
134 * @param caps The caps to be returned when typefinding succeeds (for no
135 * caps, use register_slot() with no caps argument).
136 * @return true on success, false otherwise.
137 */
138 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);
139
140 /** Registers a new static (not requiring a Gst::Plugin) typefind slot to be
141 * used for typefinding. After registering the slot will be available for
142 * typefinding.
143 *
144 * @param name The name for registering.
145 * @param rank The rank (or importance) of this typefind function.
146 * @param find_slot The Gst::TypeFind::SlotFind to use.
147 * @param caps The caps to be returned when typefinding succeeds (for no
148 * caps, use register_slot() with no caps argument).
149 * @return true on success, false otherwise.
150 */
151 static bool register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::RefPtr<const Gst::Caps>& caps);
152
153 /** Registers a new static (not requiring a Gst::Plugin) typefind slot to be
154 * used for typefinding. After registering the slot will be available for
155 * typefinding.
156 *
157 * @param name The name for registering.
158 * @param rank The rank (or importance) of this typefind function.
159 * @param find_slot The Gst::TypeFind::SlotFind to use.
160 * @param extensions Extensions belonging to this type (for no extensions use
161 * register_slot() with no extensions parameter).
162 * @return true on success, false otherwise.
163 */
164 static bool register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions);
165
166 /** Registers a new static (not requiring a Gst::Plugin) typefind slot to be
167 * used for typefinding. After registering the slot will be available for
168 * typefinding.
169 *
170 * @param name The name for registering.
171 * @param rank The rank (or importance) of this typefind function.
172 * @param find_slot The Gst::TypeFind::SlotFind to use.
173 * @return true on success, false otherwise.
174 */
175 static bool register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot);
176 };
177
178 } // namespace Gst