QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
applicationsink.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_UTILS_APPLICATIONSINK_H
19 #define QGST_UTILS_APPLICATIONSINK_H
20 
21 #include "global.h"
22 #include "../element.h"
23 #include "../sample.h"
24 
25 namespace QGst {
26 namespace Utils {
27 
66 class QTGSTREAMERUTILS_EXPORT ApplicationSink
67 {
68 public:
70  virtual ~ApplicationSink();
71 
73  ElementPtr element() const;
74 
76  void setElement(const ElementPtr & appsink);
77 
78 
80  CapsPtr caps() const;
81 
83  void setCaps(const CapsPtr & caps);
84 
85 
88  bool isEos() const;
89 
90 
93  uint maxBuffers() const;
94 
98  void setMaxBuffers(uint maxbuffers);
99 
100 
103  bool dropEnabled() const;
104 
106  void enableDrop(bool enable);
107 
124  SamplePtr pullPreroll();
125 
137  SamplePtr pullSample();
138 
151  BufferListPtr pullBufferList();
152 
153 protected:
156  virtual void eos();
157 
161  virtual FlowReturn newPreroll();
162 
166  virtual FlowReturn newSample();
167 
168 private:
169  /* vtable padding */
170  virtual void reservedVirtual1() {}
171  virtual void reservedVirtual2() {}
172  virtual void reservedVirtual3() {}
173 
174 private:
175  struct Priv;
176  friend struct Priv;
177  Priv *const d;
178  Q_DISABLE_COPY(ApplicationSink)
179 };
180 
181 } //namespace Utils
182 } //namespace QGst
183 
184 #endif // QGST_APPLICATIONSINK_H
Helper class for using a GstAppSink.