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 #ifndef PTLIB_PFFVDEV_H
00035 #define PTLIB_PFFVDEV_H
00036
00037 #ifdef P_USE_PRAGMA
00038 #pragma interface
00039 #endif
00040
00041 #include <ptlib.h>
00042
00043 #if P_VIDEO
00044 #if P_FFVDEV
00045
00046 #include <ptlib/pipechan.h>
00047 #include <ptclib/delaychan.h>
00048
00050
00051
00052
00053
00054
00055 class PVideoInputDevice_FFMPEG : public PVideoInputDevice
00056 {
00057 PCLASSINFO(PVideoInputDevice_FFMPEG, PVideoInputDevice);
00058 public:
00061 PVideoInputDevice_FFMPEG();
00062
00065 ~PVideoInputDevice_FFMPEG();
00066
00067
00070 PBoolean Open(
00071 const PString & deviceName,
00072 PBoolean startImmediate = PTrue
00073 );
00074
00077 PBoolean IsOpen() ;
00078
00081 PBoolean Close();
00082
00085 PBoolean Start();
00086
00089 PBoolean Stop();
00090
00093 PBoolean IsCapturing();
00094
00097 static PStringArray GetInputDeviceNames();
00098
00099 virtual PStringArray GetDeviceNames() const
00100 { return GetInputDeviceNames(); }
00101
00104 static bool GetDeviceCapabilities(
00105 const PString & ,
00106 Capabilities *
00107 ) { return false; }
00108
00114 virtual PINDEX GetMaxFrameBytes();
00115
00120 virtual PBoolean GetFrameData(
00121 BYTE * buffer,
00122 PINDEX * bytesReturned = NULL
00123 );
00124
00129 virtual PBoolean GetFrameDataNoDelay(
00130 BYTE * buffer,
00131 PINDEX * bytesReturned = NULL
00132 );
00133
00134
00140 virtual PBoolean SetVideoFormat(
00141 VideoFormat videoFormat
00142 );
00143
00148 virtual int GetNumChannels() ;
00149
00152 virtual PBoolean SetChannel(
00153 int channelNumber
00154 );
00155
00161 virtual PBoolean SetColourFormat(
00162 const PString & colourFormat
00163 );
00164
00170 virtual PBoolean SetFrameRate(
00171 unsigned rate
00172 );
00173
00179 virtual PBoolean GetFrameSizeLimits(
00180 unsigned & minWidth,
00181 unsigned & minHeight,
00182 unsigned & maxWidth,
00183 unsigned & maxHeight
00184 ) ;
00185
00191 virtual PBoolean SetFrameSize(
00192 unsigned width,
00193 unsigned height
00194 );
00195
00196 void ClearMapping() { return ; }
00197
00200 virtual PBoolean TestAllFormats()
00201 { return PTrue; }
00202
00203 protected:
00204 unsigned m_ffmpegFrameWidth;
00205 unsigned m_ffmpegFrameHeight;
00206 unsigned m_ffmpegFrameRate;
00207 unsigned m_ffmpegFrameSize;
00208 PPipeChannel m_command;
00209 PINDEX m_videoFrameSize;
00210 unsigned grabCount;
00211 PAdaptiveDelay pacing;
00212 };
00213
00214
00215 #endif // P_FFVDEV
00216 #endif
00217
00218 #endif // PTLIB_PVFILEDEV_H
00219
00220
00221