QtGStreamer  1.2.0
 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 #include "memory.h"
24 
25 namespace QGst {
26 
35 class QTGSTREAMER_EXPORT Buffer : public MiniObject
36 {
37  QGST_WRAPPER(Buffer)
38 public:
39  static BufferPtr create(uint size);
40 
41  quint32 size() const;
42 
43  ClockTime decodingTimeStamp() const;
44  ClockTime presentationTimeStamp() const;
45  ClockTime duration() const;
46 
47  quint64 offset() const;
48  quint64 offsetEnd() const;
49 
50  BufferFlags flags() const;
51  void setFlags(const BufferFlags flags);
52 
53  void setSize(uint size);
54 
55  uint extract(uint offset, void *dest, uint size);
56 
57  uint memoryCount() const;
58  MemoryPtr getMemory(uint index) const;
59 
60  BufferPtr copy() const;
61  inline BufferPtr makeWritable() const;
62 
63  bool map(MapInfo &info, MapFlags flags);
64  void unmap(MapInfo &info);
65 };
66 
67 BufferPtr Buffer::makeWritable() const
68 {
69  return MiniObject::makeWritable().staticCast<Buffer>();
70 }
71 
72 } //namespace QGst
73 
74 QGST_REGISTER_TYPE(QGst::Buffer)
75 
76 #endif
Wrapper class for GstMiniObject.
Definition: miniobject.h:29
Smart pointer class for working with wrapper classes that support reference counting.
Definition: global.h:56
A datatype to hold a time, measured in nanoseconds.
Definition: clocktime.h:37
RefPointer< X > staticCast() const
Definition: refpointer.h:366
Wrapper class for GstBuffer.
Definition: buffer.h:35