Framebuffer.cpp revision 3cdef5504e9fb186b78113c97636a33a479ffeeb
/** @file
*
* VBox Remote Desktop Framebuffer
*/
/*
* Copyright (C) 2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "Framebuffer.h"
#define LOG_GROUP LOG_GROUP_GUI
/*
* VRDP server frame buffer
*/
#ifdef VBOX_WITH_XPCOM
#include <nsMemory.h>
#endif
{
#if defined (RT_OS_WINDOWS)
refcnt = 0;
#endif /* RT_OS_WINDOWS */
}
{
if (mBuffer)
{
}
}
{
if (!width)
return E_INVALIDARG;
return S_OK;
}
{
if (!height)
return E_INVALIDARG;
return S_OK;
}
{
return S_OK;
}
{
return S_OK;
}
{
if (!address)
return E_INVALIDARG;
return S_OK;
}
{
if (!bitsPerPixel)
return E_INVALIDARG;
return S_OK;
}
{
if (!bytesPerLine)
return E_INVALIDARG;
return S_OK;
}
{
if (!pixelFormat)
return E_POINTER;
return S_OK;
}
{
if (!usesGuestVRAM)
return E_POINTER;
return S_OK;
}
{
if (!heightReduction)
return E_POINTER;
/* no reduction at all */
*heightReduction = 0;
return S_OK;
}
{
if (!aOverlay)
return E_POINTER;
/* overlays are not yet supported */
*aOverlay = 0;
return S_OK;
}
{
if (!winId)
return E_POINTER;
*winId = 0;
return S_OK;
}
{
return S_OK;
}
{
/* Agree to requested format for LFB modes and use guest VRAM directly, thus avoiding
* unnecessary memcpy in VGA device.
*/
Log(("pixelFormat = %08X, vram = %p, bpp = %d, bpl = 0x%08X, %dx%d\n",
/* Free internal buffer. */
if (mBuffer)
{
}
mWidth = w;
mHeight = h;
{
switch (bitsPerPixel)
{
case 32:
case 24:
case 16:
break;
default:
break;
}
}
if (mUsesGuestVRAM)
{
}
else
{
mBitsPerPixel = 32;
if (mBytesPerLine > 0 && h > 0) /* Check for nul dimensions. */
{
}
}
if (!mScreen)
{
/* Just reset everything. */
mWidth = 0;
mHeight = 0;
mBitsPerPixel = 0;
mBytesPerLine = 0;
}
/* Inform the caller that the operation was successful. */
if (finished)
return S_OK;
}
{
LogRelFlow(("NotifyChange: %d %d,%d %dx%d\n",
{
ULONG ulBitsPerPixel = 0;
ULONG ulBytesPerLine = 0;
ULONG ulPixelFormat = 0;
&ulWidth,
&ulHeight,
{
}
}
{
/* Just reset everything. */
mWidth = 0;
mHeight = 0;
mBitsPerPixel = 0;
mBytesPerLine = 0;
}
return hr;
}
/**
* Returns whether we like the given video mode.
*
* @returns COM status code
* @param width video mode width in pixels
* @param height video mode height in pixels
* @param bpp video mode bit depth in bits per pixel
* @param supported pointer to result variable
*/
STDMETHODIMP VRDPFramebuffer::VideoModeSupported(ULONG width, ULONG height, ULONG bpp, BOOL *supported)
{
if (!supported)
return E_POINTER;
return S_OK;
}
{
if (!rects)
return E_POINTER;
/// @todo
return S_OK;
}
{
if (!rects)
return E_POINTER;
/// @todo
return S_OK;
}
{
return E_NOTIMPL;
}
{
return E_NOTIMPL;
}