QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
buffer.h
1 /*
2  Copyright (C) 2010 Collabora Multimedia.
3  @author Mauricio Piacentini <mauricio.piacentini@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_BUFFER_H
19 #define QGST_BUFFER_H
20 
21 #include "miniobject.h"
22 #include "clocktime.h"
23 
24 namespace QGst {
25 
34 class QTGSTREAMER_EXPORT Buffer : public MiniObject
35 {
36  QGST_WRAPPER(Buffer)
37 public:
38  static BufferPtr create(uint size);
39 
40  quint8 * data() const;
41  quint32 size() const;
42 
43  ClockTime timeStamp() const;
44  ClockTime duration() const;
45 
46  CapsPtr caps() const;
47  void setCaps(const CapsPtr & caps);
48 
49  quint64 offset() const;
50  quint64 offsetEnd() const;
51 
52  BufferFlags flags() const;
53  void setFlags(const BufferFlags flags);
54 
55  BufferPtr copy() const;
56  inline BufferPtr makeWritable() const;
57 };
58 
59 BufferPtr Buffer::makeWritable() const
60 {
61  return MiniObject::makeWritable().staticCast<Buffer>();
62 }
63 
64 } //namespace QGst
65 
66 QGST_REGISTER_TYPE(QGst::Buffer)
67 
68 #endif