Debian Codegraph @

gstreamer/gstreamermm/bufferlist.h

raw symbols SCIP
1 // Generated by gmmproc 2.50.1 -- DO NOT MODIFY!
2 #ifndef _GSTREAMERMM_BUFFERLIST_H
3 #define _GSTREAMERMM_BUFFERLIST_H
4
5
6 #include <glibmm/ustring.h>
7 #include <sigc++/sigc++.h>
8
9 /* gstreamermm - a C++ wrapper for gstreamer
10 *
11 * Copyright 2008-2015 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 <gstreamermm/miniobject.h>
29
30
31 namespace Gst
32 {
33
34 class Buffer;
35
36 /** A grouped scatter data buffer type for data-passing.
37 * Buffer lists are units of grouped scatter/gather data transfer in GStreamer.
38 *
39 * Buffer lists are created with create() and filled with data using a
40 * Gst::BufferListIterator. The iterator has no current buffer; its cursor
41 * position lies between buffers, immediately before the buffer that would be
42 * returned by Gst::BufferListIterator::next(). After iterating to the end of a group the iterator must
43 * be advanced to the next group by a call to
44 * Gst::BufferListIterator::next_group() before any further calls to
45 * Gst::BufferListIterator::next() can return buffers again. The cursor
46 * position of a newly created iterator lies before the first group; a call to
47 * Gst::BufferListIterator::next_group() is necessary before calls to
48 * Gst::BufferListIterator::next() can return buffers.
49 *
50 * For more details, see the C API docs.
51 */
52 class BufferList : public MiniObject
53 {
54 public:
55 #ifndef DOXYGEN_SHOULD_SKIP_THIS
56 using CppObjectType = BufferList;
57 using BaseObjectType = GstBufferList;
58 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
59
60 static Glib::RefPtr<BufferList> create();
61
62 /** Increment the reference count for this object.
63 * You should never need to do this manually - use the object via a RefPtr instead.
64 */
65 void reference() const;
66
67 /** Decrement the reference count for this object.
68 * You should never need to do this manually - use the object via a RefPtr instead.
69 */
70 void unreference() const;
71
72 ///Provides access to the underlying C instance.
73 GstBufferList* gobj();
74
75 ///Provides access to the underlying C instance.
76 const GstBufferList* gobj() const;
77
78 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
79 GstBufferList* gobj_copy() const;
80
81 BufferList() = delete;
82
83 // noncopyable
84 BufferList(const BufferList&) = delete;
85 BufferList& operator=(const BufferList&) = delete;
86
87 protected:
88 // Do not derive this. Gst::BufferList can neither be constructed nor deleted.
89
90 void operator delete(void*, std::size_t);
91
92 private:
93
94
95 public:
96 /** For example,
97 * Gst::BufferListItem on_foreach(const Glib::RefPtr<Gst::Buffer>& buffer,
98 * guint group, guint idx);.
99 * A slot that will be called from foreach(). The buffer field will be a
100 * reference to the buffer at idx in group.
101 *
102 * When this function returns Gst::BUFFER_LIST_CONTINUE, the next buffer will
103 * be returned. When Gst::BUFFER_LIST_SKIP_GROUP is returned, all remaining
104 * buffers in the current group will be skipped and the first buffer of the
105 * next group is returned (if any). When Gst::BUFFER_LIST_END is returned,
106 * foreach() will return.
107 *
108 * When the buffer is set to 0, the item will be removed from the bufferlist.
109 * When the buffer has been made writable, the new buffer reference can be
110 * assigned to the buffer.
111 */
112 typedef sigc::slot< bool, Glib::RefPtr<Gst::Buffer>&, guint> SlotForeach;
113
114 public:
115
116
117 /** Remove @a length buffers starting from @a idx in @a list. The following buffers
118 * are moved to close the gap.
119 *
120 * @param idx The index.
121 * @param length The amount to remove.
122 */
123 void remove(guint idx, guint length);
124
125
126 /** Get the buffer at @a idx.
127 *
128 * @param idx The index.
129 * @return The buffer at @a idx in @a group
130 * or <tt>nullptr</tt> when there is no buffer. The buffer remains valid as
131 * long as @a list is valid and buffer is not removed from the list.
132 */
133 Glib::RefPtr<Gst::Buffer> remove(guint idx);
134
135
136 /** Returns the number of buffers in @a list.
137 *
138 * @return The number of buffers in the buffer list.
139 */
140 guint length() const;
141
142
143 /** Create a shallow copy of the given buffer list. This will make a newly
144 * allocated copy of the source list with copies of buffer pointers. The
145 * refcount of buffers pointed to will be increased by one.
146 *
147 * @return A new copy of @a list.
148 */
149 void copy() const;
150
151
152 /** Create a copy of the given buffer list. This will make a newly allocated
153 * copy of the buffer that the source buffer list contains.
154 *
155 * @return A new copy of @a list.
156 */
157 void copy_deep() const;
158
159
160 /** Insert @a buffer at @a idx in @a list. Other buffers are moved to make room for
161 * this new buffer.
162 *
163 * A -1 value for @a idx will append the buffer at the end.
164 *
165 * @param idx The index.
166 * @param buffer A Gst::Buffer.
167 */
168 void insert(gint idx, Glib::RefPtr<Gst::Buffer>&& buffer);
169
170 /// A insert() convenience overload. Allows to re-use @a buffer parameter after function call.
171 void insert(gint idx, const Glib::RefPtr<Gst::Buffer>& buffer);
172
173 /** Call @a slot for each buffer in @a list.
174 *
175 * @a slot can modify the passed buffer pointer or its contents. The return
176 * value of @a slot define if this function returns or if the remaining
177 * buffers in a group should be skipped.
178 *
179 * @param slot A SlotForeach to call on each buffer.
180 *
181 * Since 0.10.24
182 */
183 void foreach(const SlotForeach& slot);
184
185
186 /** Get the buffer at @a idx.
187 *
188 * @param idx The index.
189 * @return The buffer at @a idx in @a group
190 * or <tt>nullptr</tt> when there is no buffer. The buffer remains valid as
191 * long as @a list is valid and buffer is not removed from the list.
192 */
193 Glib::RefPtr<Gst::Buffer> get(guint idx);
194
195 /** Get the buffer at @a idx.
196 *
197 * @param idx The index.
198 * @return The buffer at @a idx in @a group
199 * or <tt>nullptr</tt> when there is no buffer. The buffer remains valid as
200 * long as @a list is valid and buffer is not removed from the list.
201 */
202 Glib::RefPtr<const Gst::Buffer> get(guint idx) const;
203
204
205 };
206
207 } // namespace Gst
208
209
210 namespace Glib
211 {
212
213 /** A Glib::wrap() method for this object.
214 *
215 * @param object The C instance.
216 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
217 * @result A C++ instance that wraps this C instance.
218 *
219 * @relates Gst::BufferList
220 */
221 Glib::RefPtr<Gst::BufferList> wrap(GstBufferList* object, bool take_copy = false);
222
223 } // namespace Glib
224
225
226 #endif /* _GSTREAMERMM_BUFFERLIST_H */
227