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
00036 #include <ptlib/videoio.h>
00037
00038
00041 class PVideoOutputDevice_SDL : public PVideoOutputDevice
00042 {
00043 PCLASSINFO(PVideoOutputDevice_SDL, PVideoOutputDevice);
00044
00045 public:
00048 PVideoOutputDevice_SDL();
00049
00052 ~PVideoOutputDevice_SDL();
00053
00056 virtual PStringArray GetDeviceNames() const;
00057
00060 virtual PBoolean Open(
00061 const PString & ,
00062 PBoolean = true
00063 );
00064
00067 virtual PBoolean Close();
00068
00071 virtual PBoolean IsOpen();
00072
00083 virtual PBoolean SetColourFormat(
00084 const PString & colourFormat
00085 );
00086
00095 virtual PBoolean SetFrameSize(
00096 unsigned width,
00097 unsigned height
00098 );
00099
00105 virtual PINDEX GetMaxFrameBytes();
00106
00109 virtual PBoolean SetFrameData(
00110 unsigned x,
00111 unsigned y,
00112 unsigned width,
00113 unsigned height,
00114 const BYTE * data,
00115 PBoolean endFrame = true
00116 );
00117
00118 protected:
00119 struct SDL_Overlay * m_overlay;
00120 PSyncPoint m_operationComplete;
00121 unsigned m_x, m_y;
00122
00123 private:
00124 PString GetTitle() const;
00125 void UpdateContent();
00126 void CreateOverlay(struct SDL_Surface * surface);
00127 void FreeOverlay();
00128 void PostEvent(unsigned codei, bool wait);
00129
00130 friend class PSDL_Window;
00131 };
00132
00133
00134 typedef PVideoOutputDevice_SDL PSDLVideoDevice;
00135
00136
00137 #endif // P_SDL
00138
00139 #endif // PTLIB_VSDL_H
00140
00141
00142