00001 #pragma once 00002 00003 // QStreamer 00004 // A GStreamer replacement for Qt. 00005 // 00006 // Authors : 00007 // Darren R. Starr <submux at gmail dot com> 00008 // 00009 // Copyright : 2010 The QStreamer Project 00010 // License : BSD (until we're informed that we're in violation of some other license) 00011 // Donations : Appreciated and possible through SourceForge donation page. 00012 // 00013 // All code included in this project can be used freely in whatever way the user feels fit. 00014 // If you want to take it, close it and be a weasel that doesn't even contribute back patches, 00015 // so be it. Patches are however appreciated. Wrappers for other open source components are 00016 // also appreciated. 00017 // 00018 // If you wish to be nice to us so we can see how our code is being used. Drop us a mail and let us 00019 // know you're using it in your project. 00020 // 00021 // Support : By default the support is "you get what you pay for". Paid nothing, there's no implied 00022 // requirement to support you. On the other hand, some project developers are likely to 00023 // make fixes, changes, features on request or contract. 00024 // 00025 // Enjoy 00026 00027 #include "qpin.h" 00028 00029 namespace QStreamer 00030 { 00031 class QSourcePin : public QPin 00032 { 00033 public: 00034 QSourcePin(const QString &name, class QElement *parent); 00035 00036 ~QSourcePin(); 00037 00038 bool connectTo(class QSinkPin *sinkPin); 00039 00040 void pushBuffer(class QMediaBuffer *mediaBuffer); 00041 00042 class QSinkPin *connectedTo(); 00043 00044 const class QSinkPin *connectedTo() const; 00045 00046 quint64 buffersPushed() const; 00047 00048 quint64 buffersDropped() const; 00049 00050 quint64 buffersAllocated() const; 00051 00052 void resetCounters(); 00053 00054 class QMediaBuffer *allocateBuffer(quint64 size, quint32 type='unkn'); 00055 00056 private: 00057 class QSinkPin *m_connectedTo; 00058 00059 quint64 m_buffersPushed; 00060 00061 quint64 m_buffersDropped; 00062 00063 quint64 m_buffersAllocated; 00064 }; 00065 } 00066