moviemaker.h

Go to the documentation of this file.
00001 
00032 #ifndef _MOVIEMAKER_H
00033 #define _MOVIEMAKER_H
00034 
00035 #if LL_DARWIN
00036 #import <QuickTime/QuickTime.h>
00037 #endif
00038 
00039 //
00040 // *TODO: Refactor this implementation such that we provide an abstact
00041 // interface in this file, and provide platform specific
00042 // implementation in the cpp file. This is just crazy to have nearly
00043 // the same class re-defined for different platforms, because then
00044 // usage of the class is platform dependent.
00045 //
00046 
00047 #if LL_WINDOWS
00048 
00049 #include <vfw.h>
00050 
00051 #define TEXT_HEIGHT     20
00052 #define AVIIF_KEYFRAME  0x00000010L // this frame is a key frame.
00053 #define BUFSIZE 260
00054 
00055 class MovieMaker {
00056 private:
00057     //CString FName;
00058     char fname[64];
00059     int width;
00060     int height;
00061 
00062         AVISTREAMINFO strhdr;
00063         PAVIFILE pfile;
00064         PAVISTREAM ps;
00065         PAVISTREAM psCompressed;
00066         PAVISTREAM psText;
00067         AVICOMPRESSOPTIONS opts;
00068         AVICOMPRESSOPTIONS FAR * aopts[1];
00069         DWORD dwTextFormat;
00070         COMPVARS cvars;
00071         char szText[BUFSIZE];
00072         int nFrames;
00073         bool bOK;
00074 
00075 
00076 public:
00077     MovieMaker();
00078     ~MovieMaker();
00079 
00080     inline bool IsOK() const { return bOK; };
00081     void StartCapture( char *name , int x, int y);
00082     void EndCapture();
00083     bool Snap();
00084 };
00085 
00086 #elif LL_DARWIN
00087 
00088 class MovieMaker {
00089 private:
00090     char fname[64];             /*Flawfinder: ignore*/
00091 
00092         Movie   movie;
00093         short   movieResRef;
00094         Track   track;
00095         Media   media;
00096         int             width;
00097         int             height;
00098         long    bufferSize;
00099         long    rowBytes;
00100         char    *buffer;
00101         char    *invertedBuffer;
00102 
00103         GWorldPtr       gworld;
00104         Rect            rect;
00105 
00106         ComponentInstance ci;
00107         
00108         ImageDescriptionHandle idh;
00109         SCTemporalSettings ts;
00110         SCDataRateSettings ds;
00111 
00112         UnsignedWide    lastFrameTime;
00113         
00114         OSStatus setupMovie();
00115         OSStatus grabFrame();
00116         OSStatus addFrame();
00117 
00118 public:
00119     MovieMaker();
00120     ~MovieMaker();
00121 
00122     inline bool IsOK() const { return true; };
00123     void StartCapture( char *name , int x, int y);
00124     void EndCapture();
00125     bool Snap();
00126 };
00127         
00128 #elif LL_LINUX
00129 // *FIX: we need a working implementation on linux.
00130 class MovieMaker {
00131 public:
00132     MovieMaker() {}
00133     ~MovieMaker() {}
00134 
00135     inline bool IsOK() const { return false; };
00136     void StartCapture( char *name , int x, int y) {}
00137     void EndCapture() {}
00138     bool Snap() { return false; }
00139 };
00140 
00141 #endif
00142 
00143 #endif

Generated on Thu Jul 1 06:09:57 2010 for Second Life Viewer by  doxygen 1.4.7