pvidfile.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef _PVIDFILE
00046 #define _PVIDFILE
00047
00048 #ifdef P_USE_PRAGMA
00049 #pragma interface
00050 #endif
00051
00052 #include <ptlib.h>
00053
00054 #if P_VIDFILE
00055
00059 class PVideoFile : public PFile
00060 {
00061 PCLASSINFO(PVideoFile, PFile);
00062 public:
00063 PVideoFile();
00064
00065 PVideoFile(
00066 PINDEX width,
00067 PINDEX height,
00068 OpenMode mode,
00069 int opts = ModeDefault
00070 );
00071
00078 PVideoFile(
00079 PINDEX width,
00080 PINDEX height,
00081 const PFilePath & name,
00082 OpenMode mode = ReadWrite,
00083 int opts = ModeDefault
00084 );
00085
00086 virtual PINDEX GetWidth() const { return yuvWidth; }
00087 virtual PINDEX GetHeight() const { return yuvHeight; }
00088
00089 virtual void SetWidth(PINDEX v);
00090 virtual void SetHeight(PINDEX v);
00091
00092 virtual BOOL WriteFrame(const void * frame) = 0;
00093 virtual BOOL ReadFrame(void * frame) = 0;
00094
00095 BOOL ExtractSizeHint(PFilePath & fn);
00096 static BOOL ExtractSizeHint(PFilePath & fn, PINDEX & width, PINDEX & height);
00097
00098 protected:
00099 PINDEX yuvWidth, yuvHeight, yuvSize;
00100 };
00101
00107 class PYUVFile : public PVideoFile
00108 {
00109 PCLASSINFO(PYUVFile, PVideoFile);
00110 public:
00111 PYUVFile();
00112
00113 PYUVFile(
00114 PINDEX width,
00115 PINDEX height,
00116 OpenMode mode,
00117 int opts = ModeDefault
00118 );
00119
00126 PYUVFile(
00127 PINDEX width,
00128 PINDEX height,
00129 const PFilePath & name,
00130 OpenMode mode = ReadWrite,
00131 int opts = ModeDefault
00132 );
00133
00134 virtual BOOL Open(
00135 OpenMode mode = ReadWrite,
00136 int opts = ModeDefault
00137 );
00138 virtual BOOL Open(
00139 const PFilePath & name,
00140 OpenMode mode = ReadWrite,
00141 int opts = ModeDefault
00142 );
00143
00144 virtual off_t GetLength() const;
00145
00146 virtual BOOL SetLength(
00147 off_t len
00148 );
00149
00150 virtual BOOL SetPosition(
00151 off_t pos,
00152 FilePositionOrigin origin = Start
00153 );
00154
00155 virtual off_t GetPosition() const;
00156
00157 virtual BOOL WriteFrame(const void * frame);
00158 virtual BOOL ReadFrame(void * frame);
00159
00160 protected:
00161 void Construct();
00162 PINDEX offset;
00163 BOOL y4mMode;
00164 };
00165
00166 #endif
00167
00168 #endif // P_VIDFILE