Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages | Examples

vetCodec_MOV.h

00001 
00039 #ifndef __VETLIB_VETCODEC_MOV_H__
00040  #define __VETLIB_VETCODEC_MOV_H__
00041 
00042  #include "../vetDefs.h"
00043  #include "../vetCodec.h"
00044 
00045  #include "../vetFrameYUV420.h"
00046  #include "../vetFrameRGB24.h"
00047  #include "../vetFrameT.h"
00048 
00049 // struct quicktime_t;
00050  extern "C" {
00051          #include "../../support/quicktime4linux/quicktime.h"
00052    }
00053 
00054 
00055 
00056 
00057 class vetCodec_MOVParameters : public vetCodecParameters
00058 {
00059         protected:
00060 
00061                 char fileName[128];
00062                 long frameIndex;
00063                 int stream;
00064 
00065                 friend class vetCodec_MOV;
00066 
00067 
00068         public:
00069 
00073                 vetCodec_MOVParameters();
00074 
00083                 vetCodec_MOVParameters(const char* filename, int stream = 0, long frameIndex = 0 );
00084 
00088                 ~vetCodec_MOVParameters() {  }
00089 
00093                 void reset();
00094 
00101                 void setStream(int stream = 0);
00102 
00109                 void setFileName(const char *filename);
00110 
00117                 void setFrameIndex(long index = 0);
00118 
00119 
00128                 VETRESULT saveToStreamXML(FILE *fp);
00129 
00138                 VETRESULT loadFromStreamXML(FILE *fp);
00139 
00140 };
00141 
00142 
00143 
00144 class vetCodec_MOV :  public vetCodec
00145  {
00146         protected:
00147 
00151                 vetCodec_MOVParameters* myParams;
00152 
00156                 quicktime_t* file;
00157 
00161                 unsigned char** buff;
00162 
00166                 long lenghtFrames;
00167 
00171                 bool streamEOF;
00172 
00176                 unsigned int width;
00177 
00181                 unsigned int height;
00182 
00186         float outFrameRate;
00187 
00188 
00189         public:
00190 
00191 
00196                 vetCodec_MOV(vetCodec_MOVParameters* initParams = NULL);
00197 
00205                 vetCodec_MOV(char* filename, int stream = 0);
00206 
00210                 ~vetCodec_MOV();
00211 
00226                 VETRESULT newVideo(char* filename, unsigned int w, unsigned int h, float frame_rate, int quality = 80);
00227 
00236                 VETRESULT save();
00237 
00238 
00245                 VETRESULT load();
00246 
00255                 VETRESULT load(char* filename, int stream = 0);
00256 
00257 
00258                 VETRESULT save(char* filename, int stream = 0) { return VETRET_NOT_IMPLEMENTED; };
00268                 VETRESULT setParameters(vetCodec_MOVParameters* initParams);
00269 
00275                 vetCodec_MOVParameters& getParameters() { return *myParams; };
00276 
00277 
00278                 VETRESULT setFilterParameters (vetFilterParameters* initParams) { return setParameters(static_cast<vetCodec_MOVParameters*>(initParams)); };
00279                 vetFilterParameters* getFilterParameters () { return static_cast<vetFilterParameters*>(myParams); };
00280 
00281 
00282 
00288                 VETRESULT reset();
00289 
00296 //              bool EoF() const { return streamEOF; };
00297                 bool EoF();
00298 
00305 // FRAME BROWSING FUNCTIONS
00306 
00316                 long getAudioFrameIndex(int stream = -1);
00325                 long getVideoFrameIndex(int stream = -1);
00326 
00327 
00338                 VETRESULT setFrameIndex(long index, int stream = -1);
00339 
00346                 VETRESULT goToStart();
00353                 VETRESULT goToEnd();
00354 
00363                 VETRESULT setVideoFrameRate(float fps);
00364 
00365 
00366 // VIDEO INFO FUNCTIONS
00367 
00368 
00374                 VETRESULT setHeight(unsigned int value)
00375                  {
00376                         height = value;
00377                         return VETRET_OK;
00378                  };
00379 
00385                 VETRESULT setWidth(unsigned int value)
00386                  {
00387                         width = value;
00388                         return VETRET_OK;
00389                  };
00390 
00396                 unsigned int getWidth() const { return width; };
00397 
00403                 unsigned int getHeight() const { return height; };
00404 
00413                 int getVideoDepth(int stream = 0);
00414 
00420                 bool hasVideo();
00421 
00427                 int getVideoStreamCount();
00428 
00437                 float getVideoFrameRate(int stream = -1);
00438 
00447                 long getVideoStreamLength(int stream = -1);
00448 
00457                 char* getVideoCompressor(int stream = -1);
00458 
00459 
00460 // AUDIO INFO FUNCTIONS
00461 
00467                 bool hasAudio();
00468 
00474                 int getAudioStreamCount();
00475 
00484                 int getAudioChannels(int stream = -1);
00485 
00494                 long getAudioSampleRate(int stream = -1);
00495 
00504                 long getAudioStreamLength(int stream = -1);
00505 
00514                 char* getAudioCompressor(int stream = -1);
00515 
00516 
00517 // MOVIE INFORMATIONS FUNCTIONS
00518 
00527                 VETRESULT setName(char *string);
00536                 VETRESULT setInfo(char *string);
00545                 VETRESULT setCopyRight(char *string);
00546 
00552                 char* getName();
00553 
00559                 char* getInfo();
00560 
00566                 char* getCopyRight();
00567 
00568 
00569 
00570 
00571 
00584                 VETRESULT extractTo(vetFrameYUV420& img);
00585 
00598                 VETRESULT extractTo(vetFrameRGB24& img);
00599 
00600 
00613                 VETRESULT extractTo(vetFrameT<unsigned char>& img);
00614 
00615 
00616 
00628                 VETRESULT importFrom(vetFrameYUV420& img);
00629 
00641                 VETRESULT importFrom(vetFrameRGB24& img);
00642 
00654                 VETRESULT importFrom(vetFrameT<unsigned char>& img);
00655 
00656 
00657 
00666 //              void operator << (vetFrameYUV420& img) { vetOutput::operator << (img); }
00667 //              void operator << (vetFrameRGB24& img) { vetOutput::operator << (img); }
00668 //              void operator << (vetFrameT<unsigned char>& img) { vetOutput::operator << (img); }
00669 
00685 //              vetInput& operator >> (vetFrameYUV420& img) { vetInput::operator >> (img); return *this; }
00686 //              vetInput& operator >> (vetFrameRGB24& img) { vetInput::operator >> (img); return *this; }
00687 //              vetInput& operator >> (vetFrameT<unsigned char>& img) { vetInput::operator >>( img); return *this; }
00688 
00689                 bool isEncodingAvailable() { return true; };
00690                 bool isDecodingAvailable() { return true; };
00691 
00692 };
00693 
00694 
00695 
00696 
00697 
00698 
00699 #endif //__VETLIB_VETCODEC_MOV_H__

Generated on Tue Jan 24 11:58:59 2006 for VETLib by  doxygen 1.4.4