All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vsdl.h
Go to the documentation of this file.
/*
* vsdl.h
*
* Classes to support video output via SDL
*
* Copyright (c) 1999-2000 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Open H323 Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Contributor(s): Derek J Smithies (derek@indranet.co.nz)
*
* $Revision: 27705 $
* $Author: rjongbloed $
* $Date: 2012-05-25 03:08:57 -0500 (Fri, 25 May 2012) $
*/
#ifndef PTLIB_VSDL_H
#define PTLIB_VSDL_H
#if P_SDL
#include <ptlib.h>
#include <ptlib/videoio.h>
class PVideoOutputDevice_SDL : public PVideoOutputDevice
{
PCLASSINFO(PVideoOutputDevice_SDL, PVideoOutputDevice);
public:
PVideoOutputDevice_SDL();
~PVideoOutputDevice_SDL();
virtual PStringArray GetDeviceNames() const;
virtual PBoolean Open(
const PString & /*deviceName*/,
PBoolean /*startImmediate*/ = true
);
virtual PBoolean Close();
virtual PBoolean IsOpen();
virtual PBoolean SetColourFormat(
const PString & colourFormat
);
virtual PBoolean SetFrameSize(
unsigned width,
unsigned height
);
virtual PINDEX GetMaxFrameBytes();
virtual PBoolean SetFrameData(
unsigned x,
unsigned y,
unsigned width,
unsigned height,
const BYTE * data,
PBoolean endFrame = true
);
protected:
struct SDL_Overlay * m_overlay;
PSyncPoint m_operationComplete;
unsigned m_x, m_y;
private:
PString GetTitle() const;
void UpdateContent();
void CreateOverlay(struct SDL_Surface * surface);
void FreeOverlay();
void PostEvent(unsigned codei, bool wait);
friend class PSDL_Window;
};
typedef PVideoOutputDevice_SDL PSDLVideoDevice; // Backward compatibility
#endif // P_SDL
#endif // PTLIB_VSDL_H
// End Of File ///////////////////////////////////////////////////////////////
PCLASSINFO
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
PVideoDevice::Open
virtual PBoolean Open(const PString &deviceName, PBoolean startImmediate=true)=0
Open the device given the device name.
PVideoDevice::GetMaxFrameBytes
virtual PINDEX GetMaxFrameBytes()=0
Get the maximum frame size in bytes.
PStringArray
This is an array collection class of PString objects.
Definition: pstring.h:2024
videoio.h
PBoolean
BOOL PBoolean
Definition: object.h:102
PVideoDevice::IsOpen
virtual PBoolean IsOpen()=0
Determine if the device is currently open.
PString
The character string class.
Definition: pstring.h:108
PVideoDevice::GetDeviceNames
virtual PStringArray GetDeviceNames() const =0
Get a list of all of the drivers available.
PVideoDevice::SetFrameSize
virtual PBoolean SetFrameSize(unsigned width, unsigned height)
Set the frame size to be used.
PVideoFrameInfo::SetColourFormat
virtual PBoolean SetColourFormat(const PString &colourFormat)
Set the colour format to be used.
PVideoOutputDevice::Close
virtual PBoolean Close()
Close the device.
Definition: videoio.h:771
PVideoOutputDevice
This class defines a video output device.
Definition: videoio.h:703
PVideoOutputDevice::SetFrameData
virtual PBoolean SetFrameData(unsigned x, unsigned y, unsigned width, unsigned height, const BYTE *data, PBoolean endFrame=true)=0
Set a section of the output frame buffer.
PSyncPoint
This class defines a thread synchronisation object.
Definition: syncpoint.h:67