QtGStreamer 0.10.1
|
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 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_UTILS_APPLICATIONSOURCE_H 00019 #define QGST_UTILS_APPLICATIONSOURCE_H 00020 00021 #include "global.h" 00022 #include "../element.h" 00023 #include "../buffer.h" 00024 00025 namespace QGst { 00026 namespace Utils { 00027 00089 class QTGSTREAMERUTILS_EXPORT ApplicationSource 00090 { 00091 public: 00092 ApplicationSource(); 00093 virtual ~ApplicationSource(); 00094 00096 ElementPtr element() const; 00097 00099 void setElement(const ElementPtr & appsrc); 00100 00101 00103 CapsPtr caps() const; 00104 00109 void setCaps(const CapsPtr & caps); 00110 00111 00113 quint64 minLatency() const; 00114 00116 quint64 maxLatency() const; 00117 00120 void setLatency(quint64 min, quint64 max); 00121 00122 00125 qint64 size() const; 00126 00129 void setSize(qint64 size); 00130 00131 00133 AppStreamType streamType() const; 00134 00137 void setStreamType(AppStreamType type); 00138 00139 00141 quint64 maxBytes() const; 00142 00146 void setMaxBytes(quint64 max); 00147 00148 00151 bool blockEnabled() const; 00152 00155 void enableBlock(bool enable); 00156 00157 00159 bool isLive() const; 00160 00162 void setLive(bool islive); 00163 00164 00167 uint minPercent() const; 00168 00171 void setMinPercent(uint min); 00172 00173 00174 Format format() const; 00175 void setFormat(Format f); 00176 00177 00185 FlowReturn pushBuffer(const BufferPtr & buffer); 00186 00193 FlowReturn endOfStream(); 00194 00195 protected: 00199 virtual void needData(uint length); 00200 00204 virtual void enoughData(); 00205 00209 virtual bool seekData(quint64 offset); 00210 00211 private: 00212 /* vtable padding */ 00213 virtual void reservedVirtual1() {} 00214 virtual void reservedVirtual2() {} 00215 virtual void reservedVirtual3() {} 00216 virtual void reservedVirtual4() {} 00217 00218 private: 00219 struct Priv; 00220 friend struct Priv; 00221 Priv *const d; 00222 Q_DISABLE_COPY(ApplicationSource) 00223 }; 00224 00225 } //namespace Utils 00226 } //namespace QGst 00227 00228 #endif // QGST_UTILS_APPLICATIONSOURCE_H