QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
buffer.h
00001 /*
00002     Copyright (C) 2010  Collabora Multimedia.
00003       @author Mauricio Piacentini <mauricio.piacentini@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_BUFFER_H
00019 #define QGST_BUFFER_H
00020 
00021 #include "miniobject.h"
00022 #include "clocktime.h"
00023 
00024 namespace QGst {
00025 
00034 class QTGSTREAMER_EXPORT Buffer : public MiniObject
00035 {
00036     QGST_WRAPPER(Buffer)
00037 public:
00038     static BufferPtr create(uint size);
00039 
00040     quint8 * data() const;
00041     quint32 size() const;
00042 
00043     ClockTime timeStamp() const;
00044     ClockTime duration() const;
00045 
00046     CapsPtr caps() const;
00047     void setCaps(const CapsPtr & caps);
00048 
00049     quint64 offset() const;
00050     quint64 offsetEnd() const;
00051 
00052     BufferFlags flags() const;
00053     void setFlags(const BufferFlags flags);
00054 
00055     BufferPtr copy() const;
00056     inline BufferPtr makeWritable() const;
00057 };
00058 
00059 BufferPtr Buffer::makeWritable() const
00060 {
00061     return MiniObject::makeWritable().staticCast<Buffer>();
00062 }
00063 
00064 } //namespace QGst
00065 
00066 QGST_REGISTER_TYPE(QGst::Buffer)
00067 
00068 #endif