vsdl.h

Go to the documentation of this file.
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: 27705 $
00025  * $Author: rjongbloed $
00026  * $Date: 2012-05-25 03:08:57 -0500 (Fri, 25 May 2012) $
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 & /*deviceName*/,   
00062       PBoolean /*startImmediate*/ = 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; // Backward compatibility
00135 
00136 
00137 #endif    // P_SDL
00138 
00139 #endif // PTLIB_VSDL_H
00140 
00141 
00142 // End Of File ///////////////////////////////////////////////////////////////

Generated on Fri Feb 15 20:58:32 2013 for PTLib by  doxygen 1.4.7