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 #include <SDL/SDL.h>
00036
00037 #include <ptlib/videoio.h>
00038
00039 #undef main
00040
00041
00044 class PVideoOutputDevice_SDL : public PVideoOutputDevice
00045 {
00046 PCLASSINFO(PVideoOutputDevice_SDL, PVideoOutputDevice);
00047
00048 public:
00051 PVideoOutputDevice_SDL();
00052
00055 ~PVideoOutputDevice_SDL();
00056
00059 virtual PStringArray GetDeviceNames() const;
00060
00063 virtual PBoolean Open(
00064 const PString & ,
00065 PBoolean = PTrue
00066 );
00067
00070 virtual PBoolean Close();
00071
00074 virtual PBoolean IsOpen();
00075
00086 virtual PBoolean SetColourFormat(
00087 const PString & colourFormat
00088 );
00089
00098 virtual PBoolean SetFrameSize(
00099 unsigned width,
00100 unsigned height
00101 );
00102
00108 virtual PINDEX GetMaxFrameBytes();
00109
00112 virtual PBoolean SetFrameData(
00113 unsigned x,
00114 unsigned y,
00115 unsigned width,
00116 unsigned height,
00117 const BYTE * data,
00118 PBoolean endFrame = PTrue
00119 );
00120
00121 protected:
00122 PDECLARE_NOTIFIER(PThread, PVideoOutputDevice_SDL, SDLThreadMain);
00123 bool InitialiseSDL();
00124 bool ProcessSDLEvents();
00125
00126 PThread * sdlThread;
00127 PSyncPoint sdlStarted;
00128 PSyncPointAck sdlStop;
00129 PSyncPointAck adjustSize;
00130 bool updateOverlay;
00131 PMutex mutex;
00132
00133 SDL_Surface * screen;
00134 SDL_Overlay * overlay;
00135 };
00136
00137
00138 typedef PVideoOutputDevice_SDL PSDLVideoDevice;
00139
00140
00141 PWLIB_STATIC_LOAD_PLUGIN(SDL, PVideoOutputDevice);
00142
00143 #endif // P_SDL
00144
00145 #endif // PTLIB_VSDL_H
00146
00147
00148