QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
bufferlist.h
1 /*
2  Copyright (C) 2011 Collabora Ltd. <info@collabora.co.uk>
3  @author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
4 
5  This library is free software; you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published
7  by the Free Software Foundation; either version 2.1 of the License, or
8  (at your option) any later version.
9 
10  This program 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
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef QGST_BUFFERLIST_H
19 #define QGST_BUFFERLIST_H
20 
21 #include "buffer.h"
22 
23 namespace QGst {
24 
32 class QTGSTREAMER_EXPORT BufferList : public MiniObject
33 {
34  QGST_WRAPPER(BufferList)
35 public:
36  static BufferListPtr create();
37 
38  uint groupsCount() const;
39  BufferPtr bufferAt(uint group, uint index) const;
40 
41  inline BufferListPtr copy() const;
42  inline BufferListPtr makeWritable() const;
43 };
44 
45 inline BufferListPtr BufferList::copy() const
46 {
47  return MiniObject::copy().staticCast<BufferList>();
48 }
49 
50 inline BufferListPtr BufferList::makeWritable() const
51 {
52  return MiniObject::makeWritable().staticCast<BufferList>();
53 }
54 
55 
71 class QTGSTREAMER_EXPORT BufferListIterator
72 {
73 public:
74  BufferListIterator(const BufferListPtr & list);
76 
78  uint buffersInCurrentGroup() const;
79 
82  BufferPtr next();
83 
86  void insert(const BufferPtr & buffer);
87 
91  void remove();
92 
96  BufferPtr take();
97 
102  void replace(const BufferPtr & other);
103 
107  void addGroup();
108 
111  bool nextGroup();
112 
114  BufferPtr mergeGroup() const;
115 
116 private:
117  GstBufferListIterator *m_it;
118  Q_DISABLE_COPY(BufferListIterator)
119 };
120 
121 } //namespace QGst
122 
123 QGST_REGISTER_TYPE(QGst::BufferList)
124 
125 #endif // QGST_BUFFERLIST_H