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: 20385 $
00025  * $Author: rjongbloed $
00026  * $Date: 2008-06-04 10:40:38 +0000 (Wed, 04 Jun 2008) $
00027  */
00028 
00029 #ifndef _PVSDL
00030 #define _PVSDL
00031 
00032 #if P_SDL
00033 
00034 #include <ptlib.h>
00035 #if defined(P_FREEBSD)
00036 #include <SDL11/SDL.h>
00037 #else
00038 #include <SDL/SDL.h>
00039 #endif
00040 
00041 #include <ptlib/videoio.h>
00042 
00043 #undef main
00044 
00045 
00048 class PVideoOutputDevice_SDL : public PVideoOutputDevice
00049 {
00050     PCLASSINFO(PVideoOutputDevice_SDL, PVideoOutputDevice);
00051   
00052   public:
00055     PVideoOutputDevice_SDL();
00056   
00059     ~PVideoOutputDevice_SDL();
00060   
00063     virtual PStringArray GetDeviceNames() const;
00064   
00067     virtual PBoolean Open(
00068       const PString & /*deviceName*/,   
00069       PBoolean /*startImmediate*/ = PTrue    
00070     );
00071   
00074     virtual PBoolean Close();
00075   
00078     virtual PBoolean IsOpen();
00079   
00090     virtual PBoolean SetColourFormat(
00091       const PString & colourFormat 
00092     );
00093 
00102     virtual PBoolean SetFrameSize(
00103       unsigned width,   
00104       unsigned height   
00105     );
00106 
00112     virtual PINDEX GetMaxFrameBytes();
00113 
00116     virtual PBoolean SetFrameData(
00117       unsigned x,
00118       unsigned y,
00119       unsigned width,
00120       unsigned height,
00121       const BYTE * data,
00122       PBoolean endFrame = PTrue
00123     );
00124 
00125   protected:
00126     PDECLARE_NOTIFIER(PThread, PVideoOutputDevice_SDL, SDLThreadMain);
00127     bool InitialiseSDL();
00128     bool ProcessSDLEvents();
00129 
00130     PThread     * sdlThread;
00131     PSyncPoint    sdlStarted;
00132     PSyncPointAck sdlStop;
00133     PSyncPointAck adjustSize;
00134     bool          updateOverlay;
00135     PMutex        mutex;
00136 
00137     SDL_Surface * screen;
00138     SDL_Overlay * overlay;
00139   };
00140 
00141 
00142 typedef PVideoOutputDevice_SDL PSDLVideoDevice; // Backward compatibility
00143 
00144 
00145 PWLIB_STATIC_LOAD_PLUGIN(SDL, PVideoOutputDevice);
00146 
00147 #endif    // P_SDL
00148 
00149 #endif
00150 

Generated on Mon Sep 15 01:21:35 2008 for PTLib by  doxygen 1.5.1