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: 23336 $
00025  * $Author: rjongbloed $
00026  * $Date: 2009-09-04 20:02:14 -0500 (Fri, 04 Sep 2009) $
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*/ = 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; // Backward compatibility
00139 
00140 
00141 PWLIB_STATIC_LOAD_PLUGIN(SDL, PVideoOutputDevice);
00142 
00143 #endif    // P_SDL
00144 
00145 #endif // PTLIB_VSDL_H
00146 
00147 
00148 // End Of File ///////////////////////////////////////////////////////////////

Generated on Thu May 27 01:36:48 2010 for PTLib by  doxygen 1.4.7