PTLib
Version 2.10.4
|
00001 /* 00002 * vsdl.h 00003 * 00004 * Classes to support video output via SDL 00005 * 00006 * Copyright (c) 1999-2000 Equivalence Pty. Ltd. 00007 * 00008 * The contents of this file are subject to the Mozilla Public License 00009 * Version 1.0 (the "License"); you may not use this file except in 00010 * compliance with the License. You may obtain a copy of the License at 00011 * http://www.mozilla.org/MPL/ 00012 * 00013 * Software distributed under the License is distributed on an "AS IS" 00014 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00015 * the License for the specific language governing rights and limitations 00016 * under the License. 00017 * 00018 * The Original Code is Open H323 Library. 00019 * 00020 * The Initial Developer of the Original Code is Equivalence Pty. Ltd. 00021 * 00022 * Contributor(s): Derek J Smithies (derek@indranet.co.nz) 00023 * 00024 * $Revision: 26456 $ 00025 * $Author: rjongbloed $ 00026 * $Date: 2011-09-22 00:27:10 -0500 (Thu, 22 Sep 2011) $ 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 & /*deviceName*/, 00065 PBoolean /*startImmediate*/ = true 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 = true 00119 ); 00120 00121 protected: 00122 PSyncPoint m_operationComplete; 00123 SDL_Overlay * m_overlay; 00124 unsigned m_x, m_y; 00125 00126 private: 00127 PString GetTitle() const; 00128 void UpdateContent(); 00129 void PostEvent(unsigned code); 00130 00131 friend class PSDL_Window; 00132 }; 00133 00134 00135 typedef PVideoOutputDevice_SDL PSDLVideoDevice; // Backward compatibility 00136 00137 00138 #endif // P_SDL 00139 00140 #endif // PTLIB_VSDL_H 00141 00142 00143 // End Of File ///////////////////////////////////////////////////////////////