FFmpegFB.h revision bff1915a855c5b71d76f6391549eadda348e33b0
/** @file
*
* VBox Remote Desktop Protocol.
* FFmpeg framebuffer interface.
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* innotek GmbH confidential
* All rights reserved
*/
#ifndef _H_FFMPEGFB
#define _H_FFMPEGFB
#include <iprt/critsect.h>
#ifdef DEBUG
# define VBOX_DEBUG_FF DEBUG
# include <avcodec.h>
# include <avformat.h>
# define DEBUG VBOX_DEBUG_FF
#else /* DEBUG not defined */
# include <avcodec.h>
# include <avformat.h>
#endif /* DEBUG not defined */
{
#ifndef VBOX_WITH_XPCOM
{
return ::InterlockedIncrement (&refcnt);
}
{
if (cnt == 0)
return cnt;
}
{
if (riid == IID_IUnknown)
{
AddRef();
return S_OK;
}
if (riid == IID_IFramebuffer)
{
AddRef();
return S_OK;
}
return E_NOINTERFACE;
}
#endif
// public methods only for internal purposes
/** Guest framebuffer width */
/** Guest framebuffer height */
/** Bit rate used for encoding */
/** Guest framebuffer pixel format */
/** Guest framebuffer color depth */
/** Name of the file we will write to */
/** Guest framebuffer line length */
/** MPEG frame framebuffer width */
/** MPEG frame framebuffer height */
/** The size of one YUV frame */
/** If we can't use the video RAM directly, we allocate our own
* buffer */
/** The address of the buffer - can be either mRGBBuffer or the
* guests VRAM (HC address) if we can handle that directly */
/** An intermediary RGB buffer with the same dimensions */
/** Frame buffer translated into YUV420 for the mpeg codec */
/** Temporary buffer into which the codec writes frames to be
* written into the file */
/** File where we store the mpeg stream */
/** time at which the last "real" frame was created */
/** Pointer to ffmpeg's format information context */
/** ffmpeg context containing information about the stream */
/** Information for ffmpeg describing the current frame */
/** An AVPicture structure containing information about the
* guest framebuffer */
/** ffmpeg pixel format of guest framebuffer */
int mFFMPEGPixelFormat;
/** An AVPicture structure containing information about the
* MPEG frame framebuffer */
/** Since we are building without exception support, we use this
to signal allocation failure in the constructor */
bool mOutOfMemory;
/** A hack: ffmpeg mpeg2 only writes a frame if something has
changed. So we flip the low luminance bit of the first
pixel every frame. */
bool mToggle;
#ifndef VBOX_WITH_XPCOM
long refcnt;
#endif
};
#endif /* !_H_FFMPEGFB */