00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef QT_FORMATMANAGER_H
00025 #define QT_FORMATMANAGER_H
00026
00027 #include <stdint.h>
00028 #include <QuickTime/QuickTime.h>
00029
00030 #include "FormatManager.h"
00031
00032 namespace avcap
00033 {
00034 class QT_DeviceDescriptor;
00035
00037
00040 class QT_FormatManager: public FormatManager
00041 {
00042 private:
00043 QT_DeviceDescriptor* mQTDeviceDescriptor;
00044 GWorldPtr mGWorld;
00045 Rect mCurrentBounds;
00046 bool mNeedsDecompression;
00047
00048 public:
00049 QT_FormatManager(QT_DeviceDescriptor *dd);
00050
00051 virtual ~QT_FormatManager();
00052
00053 int setFormat(Format *fmt);
00054
00055 int setFormat(uint32_t fourcc);
00056
00057 Format* getFormat();
00058
00059 int setResolution(int w, int h);
00060
00061 int getWidth();
00062
00063 int getHeight();
00064
00065 size_t getImageSize();
00066
00067 int setFramerate(int fps);
00068
00069 int getFramerate();
00070
00071 void query();
00072
00073 private:
00074
00075 int probeResolutions(Format* fmt);
00076
00077 int checkResolution(int w, int h);
00078
00079 int updateGWorld(const Rect* bounds);
00080
00081 static uint32_t OSType2Fourcc(OSType pixel_format);
00082
00083 static OSType Fourcc2OSType(uint32_t fourcc);
00084
00085 inline bool needsDecompression() const
00086 { return mNeedsDecompression; }
00087
00088 friend class QT_VidCapManager;
00089 };
00090 }
00091
00092 #endif // QT_FORMATMANAGER_H