00001 /* copyright (C) 2003 Jens Zechlin */ 00002 #ifndef PullResizeSH_SH 00003 #define PullResizeSH_SH 00004 00005 #include <sys/types.h> 00006 #include <limits.h> 00007 #include "config.h" 00008 00009 #include "sh/SH.h" 00010 #include "sh/SHGraphManager.h" 00011 #include "sh/SHEndpoint.h" 00012 #include "sh/SHEndpointSpec.h" 00013 00014 #include "MNRope.h" 00015 00016 00017 namespace SH 00018 { 00019 00020 class PullResizeSH; 00021 00022 00027 /**********************************************************************/ 00028 /* PullResizeSHEndpoint */ 00029 /**********************************************************************/ 00030 00031 class PullResizeSourceEndpoint 00032 : public SourceEndpoint 00033 { 00034 public: 00035 PullResizeSourceEndpoint( PullResizeSH* mySH ); 00036 virtual SH_RC pull( DataPtr& item, 00037 SourceUnit su = UnitDefault, 00038 size_t amount=0 ); 00039 00040 virtual ~PullResizeSourceEndpoint( ); 00041 00042 }; 00043 00044 class PullResizeSinkEndpoint 00045 : public SinkEndpoint 00046 { 00047 public: 00048 PullResizeSinkEndpoint( PullResizeSH* mySH ); 00049 virtual ~PullResizeSinkEndpoint( ); 00050 00051 }; 00052 00053 /**********************************************************************/ 00054 /* MpeglibSinkSH */ 00055 /**********************************************************************/ 00056 00057 class PullResizeSH 00058 : public Base { 00059 private: 00060 MNRope *prevRope; 00061 00062 public: 00063 PullResizeSH( SHGraphManager* mgr, 00064 u_int32_t runtimeId, 00065 MNSelector& sel ); 00066 00067 virtual ~PullResizeSH(); 00068 00069 private: 00074 PullResizeSH( const PullResizeSH& ); 00075 00080 PullResizeSH& operator=( const PullResizeSH& ); 00081 00082 //int readStartCode(InputStream* input, unsigned int* startCode); 00083 00084 SHGraphManager* myGraphManager; 00085 int pull( MNRope*& rope, size_t amount ); 00086 00087 public: 00089 virtual SH_RC initSH(); 00091 virtual SH_RC uninitSH(); 00092 00094 virtual SH_RC startStreaming(); 00096 virtual SH_RC stopStreaming(); 00097 00098 virtual void pushReport( Report* report, Direction d ); 00099 00100 00101 /******************************************************************/ 00102 /* functions required for SH::Spec */ 00103 /******************************************************************/ 00104 protected: 00105 friend class PullResizeSinkEndpoint; 00106 friend class PullResizeSourceEndpoint; 00107 00108 SinkEndpoint* in_ep_a[1]; 00109 SourceEndpoint* out_ep_a[1]; 00110 PullResizeSinkEndpoint inEP; 00111 PullResizeSourceEndpoint outEP; 00112 00113 00114 public: 00115 virtual SinkEndpoint** getSinkSpecs(); 00116 virtual SourceEndpoint** getSourceSpecs(); 00117 00118 /******************************************************************/ 00119 /* functions required for SHStatus */ 00120 /******************************************************************/ 00130 virtual bool isConnected() const; 00131 00132 }; 00133 00135 00136 }; // namespace SH 00137 00138 #endif /* PullResizeSH */