QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
bufferlist.h
00001 /*
00002     Copyright (C) 2011 Collabora Ltd. <info@collabora.co.uk>
00003       @author George Kiagiadakis <george.kiagiadakis@collabora.co.uk>
00004 
00005     This library is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU Lesser General Public License as published
00007     by the Free Software Foundation; either version 2.1 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 #ifndef QGST_BUFFERLIST_H
00019 #define QGST_BUFFERLIST_H
00020 
00021 #include "buffer.h"
00022 
00023 namespace QGst {
00024 
00032 class QTGSTREAMER_EXPORT BufferList : public MiniObject
00033 {
00034     QGST_WRAPPER(BufferList)
00035 public:
00036     static BufferListPtr create();
00037 
00038     uint groupsCount() const;
00039     BufferPtr bufferAt(uint group, uint index) const;
00040 
00041     inline BufferListPtr copy() const;
00042     inline BufferListPtr makeWritable() const;
00043 };
00044 
00045 inline BufferListPtr BufferList::copy() const
00046 {
00047     return MiniObject::copy().staticCast<BufferList>();
00048 }
00049 
00050 inline BufferListPtr BufferList::makeWritable() const
00051 {
00052     return MiniObject::makeWritable().staticCast<BufferList>();
00053 }
00054 
00055 
00071 class QTGSTREAMER_EXPORT BufferListIterator
00072 {
00073 public:
00074     BufferListIterator(const BufferListPtr & list);
00075     ~BufferListIterator();
00076 
00078     uint buffersInCurrentGroup() const;
00079 
00082     BufferPtr next();
00083 
00086     void insert(const BufferPtr & buffer);
00087 
00091     void remove();
00092 
00096     BufferPtr take();
00097 
00102     void replace(const BufferPtr & other);
00103 
00107     void addGroup();
00108 
00111     bool nextGroup();
00112 
00114     BufferPtr mergeGroup() const;
00115 
00116 private:
00117     GstBufferListIterator *m_it;
00118     Q_DISABLE_COPY(BufferListIterator)
00119 };
00120 
00121 } //namespace QGst
00122 
00123 QGST_REGISTER_TYPE(QGst::BufferList)
00124 
00125 #endif // QGST_BUFFERLIST_H