00001 00032 #ifndef __VETLIB_VETMULTIPLEXER_H__ 00033 #define __VETLIB_VETMULTIPLEXER_H__ 00034 00035 #include "../vetDefs.h" 00036 #include "../vetFilter.h" 00037 00038 #include "../vetThread.h" 00039 00040 #include "../vetFrameYUV420.h" 00041 #include "../vetFrameRGB24.h" 00042 #include "../vetFrameT.h" 00043 00044 00045 #define VET_MP_INPUTS_MAX 12 00046 #define VET_MP_OUTPUTS_MAX 12 00047 00048 #define VET_MP_LOOP_MAX 1000000 00049 00050 00051 class vetMultiplexerParameters : public vetFilterParameters 00052 { 00053 protected: 00054 00055 int runMode; 00056 00057 friend class vetMultiplexer; 00058 00059 00060 public: 00061 00062 00063 vetMultiplexerParameters(); 00064 ~vetMultiplexerParameters() {} 00065 00066 void reset(); 00067 00068 VETRESULT saveToStreamXML(FILE *fp); 00069 VETRESULT loadFromStreamXML(FILE *fp); 00070 00071 }; 00072 00073 class vetMultiplexer : public vetFilter 00074 { 00075 00076 protected: 00077 00081 vetMultiplexerParameters* myParams; 00082 00083 00084 vetInput** inputs; 00085 int inputCount; 00086 00087 vetOutput** outputs; 00088 int outputCount; 00089 00090 int inputCurrent; 00091 int outputCurrent; 00092 00093 00094 public: 00095 00096 00101 vetMultiplexer( vetMultiplexerParameters* initParams = NULL ); 00102 00106 ~vetMultiplexer(); 00107 00108 float getFrameRate() const { return 0; }; 00109 00110 00120 VETRESULT setParameters(vetMultiplexerParameters* initParams); 00121 00127 vetMultiplexerParameters& getParameters() { return *myParams; }; 00128 00138 VETRESULT setFilterParameters (vetFilterParameters* initParams) 00139 { 00140 if (initParams == NULL) 00141 return setParameters(NULL); 00142 else 00143 return setParameters(static_cast<vetMultiplexerParameters*>(initParams)); 00144 }; 00145 00146 00147 00153 vetFilterParameters* getFilterParameters () 00154 { 00155 if (myParams == NULL) 00156 return NULL; 00157 else 00158 return static_cast<vetFilterParameters*>(myParams); 00159 }; 00160 00166 VETRESULT reset(); 00167 00175 VETRESULT run(long cycles = 0); 00176 00182 VETRESULT stop(); 00183 00184 00185 00193 VETRESULT forward() { return run(1); }; 00194 00195 00204 VETRESULT addInput(vetInput* newInput); 00205 00215 VETRESULT removeInput(vetInput* oldInput); 00225 VETRESULT removeInput(int id); 00226 00235 VETRESULT addOutput(vetOutput* newOutput); 00236 00246 VETRESULT removeOutput(vetOutput* oldOutput); 00256 VETRESULT removeOutput(int id); 00257 00265 VETRESULT setCurrentInput(int id); 00274 VETRESULT setCurrentInput(vetInput& currIn); 00275 00283 VETRESULT setCurrentOutput(int id); 00292 VETRESULT setCurrentOutput(vetOutput& currOut); 00293 00299 int getCurrentInputId() { return inputCurrent; }; 00305 vetInput* getCurrentInput() { return inputs[inputCurrent]; }; 00306 00312 int getCurrentOutputId() { return outputCurrent; }; 00318 vetOutput* getCurrentOutput() { return outputs[outputCurrent]; }; 00319 00325 int getInputCount() { return inputCount; }; 00331 int getOutputCount() { return outputCount; }; 00332 00333 00344 VETRESULT importFrom(vetFrameYUV420& img); 00345 00356 VETRESULT importFrom(vetFrameRGB24& img); 00357 00368 VETRESULT importFrom(vetFrameT<unsigned char>& img); 00369 00370 00382 VETRESULT extractTo(vetFrameYUV420& img); 00383 00395 VETRESULT extractTo(vetFrameRGB24& img); 00396 00408 VETRESULT extractTo(vetFrameT<unsigned char>& img); 00409 00410 00411 }; 00412 00413 00414 00415 #endif //__VETLIB_VETMULTIPLEXER_H__ 00416 00417
1.4.4