vsdl.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 #ifndef PTLIB_VSDL_H
00030 #define PTLIB_VSDL_H
00031
00032 #if P_SDL
00033
00034 #include <ptlib.h>
00035 #if defined(P_FREEBSD)
00036 #include <SDL11/SDL.h>
00037 #else
00038 #include <SDL/SDL.h>
00039 #endif
00040
00041 #include <ptlib/videoio.h>
00042
00043 #undef main
00044
00045
00048 class PVideoOutputDevice_SDL : public PVideoOutputDevice
00049 {
00050 PCLASSINFO(PVideoOutputDevice_SDL, PVideoOutputDevice);
00051
00052 public:
00055 PVideoOutputDevice_SDL();
00056
00059 ~PVideoOutputDevice_SDL();
00060
00063 virtual PStringArray GetDeviceNames() const;
00064
00067 virtual PBoolean Open(
00068 const PString & ,
00069 PBoolean = PTrue
00070 );
00071
00074 virtual PBoolean Close();
00075
00078 virtual PBoolean IsOpen();
00079
00090 virtual PBoolean SetColourFormat(
00091 const PString & colourFormat
00092 );
00093
00102 virtual PBoolean SetFrameSize(
00103 unsigned width,
00104 unsigned height
00105 );
00106
00112 virtual PINDEX GetMaxFrameBytes();
00113
00116 virtual PBoolean SetFrameData(
00117 unsigned x,
00118 unsigned y,
00119 unsigned width,
00120 unsigned height,
00121 const BYTE * data,
00122 PBoolean endFrame = PTrue
00123 );
00124
00125 protected:
00126 PDECLARE_NOTIFIER(PThread, PVideoOutputDevice_SDL, SDLThreadMain);
00127 bool InitialiseSDL();
00128 bool ProcessSDLEvents();
00129
00130 PThread * sdlThread;
00131 PSyncPoint sdlStarted;
00132 PSyncPointAck sdlStop;
00133 PSyncPointAck adjustSize;
00134 bool updateOverlay;
00135 PMutex mutex;
00136
00137 SDL_Surface * screen;
00138 SDL_Overlay * overlay;
00139 };
00140
00141
00142 typedef PVideoOutputDevice_SDL PSDLVideoDevice;
00143
00144
00145 PWLIB_STATIC_LOAD_PLUGIN(SDL, PVideoOutputDevice);
00146
00147 #endif // P_SDL
00148
00149 #endif // PTLIB_VSDL_H
00150
00151
00152