Comments added.

This commit is contained in:
Johns 2012-03-10 17:46:00 +01:00
parent 47d2896468
commit d0f825f831

View File

@ -43,15 +43,23 @@ extern "C"
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
/// vdr-plugin version number.
/// Makefile extracts the version number for generating the file name
/// for the distribution archive.
static const char *const VERSION = "0.5.0" static const char *const VERSION = "0.5.0"
#ifdef GIT_REV #ifdef GIT_REV
"-GIT" GIT_REV "-GIT" GIT_REV
#endif #endif
; ;
/// vdr-plugin description.
static const char *const DESCRIPTION = static const char *const DESCRIPTION =
trNOOP("A software and GPU emulated HD device"); trNOOP("A software and GPU emulated HD device");
/// vdr-plugin text of main menu entry
static const char *MAINMENUENTRY = trNOOP("SoftHdDevice"); static const char *MAINMENUENTRY = trNOOP("SoftHdDevice");
/// single instance of softhddevice plugin device.
static class cSoftHdDevice *MyDevice; static class cSoftHdDevice *MyDevice;
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@ -192,13 +200,15 @@ extern "C" void FeedKeyPress(const char *keymap, const char *key, int repeat,
class cSoftOsd:public cOsd class cSoftOsd:public cOsd
{ {
public: public:
cSoftOsd(int, int, uint); static volatile char Dirty; ///< flag force redraw everything
virtual ~ cSoftOsd(void);
virtual void Flush(void); cSoftOsd(int, int, uint); ///< constructor
virtual void SetActive(bool); virtual ~ cSoftOsd(void); ///< destructor
virtual void Flush(void); ///< commits all data to the hardware
virtual void SetActive(bool); ///< sets OSD to be the active one
}; };
static volatile char OsdDirty; ///< flag force redraw everything volatile char cSoftOsd::Dirty; ///< flag force redraw everything
/** /**
** Sets this OSD to be the active one. ** Sets this OSD to be the active one.
@ -217,12 +227,21 @@ void cSoftOsd::SetActive(bool on)
} }
cOsd::SetActive(on); cOsd::SetActive(on);
if (on) { if (on) {
OsdDirty = 1; Dirty = 1;
} else { } else {
OsdClose(); OsdClose();
} }
} }
/**
** Constructor OSD.
**
** Initializes the OSD with the given coordinates.
**
** @param left x-coordinate of osd on display
** @param top y-coordinate of osd on display
** @param level level of the osd (smallest is shown)
*/
cSoftOsd::cSoftOsd(int left, int top, uint level) cSoftOsd::cSoftOsd(int left, int top, uint level)
:cOsd(left, top, level) :cOsd(left, top, level)
{ {
@ -231,10 +250,14 @@ cSoftOsd::cSoftOsd(int left, int top, uint level)
OsdHeight(), left, top, level); OsdHeight(), left, top, level);
*/ */
//this->Level = level;
SetActive(true); SetActive(true);
} }
/**
** OSD Destructor.
**
** Shuts down the OSD.
*/
cSoftOsd::~cSoftOsd(void) cSoftOsd::~cSoftOsd(void)
{ {
//dsyslog("[softhddev]%s:\n", __FUNCTION__); //dsyslog("[softhddev]%s:\n", __FUNCTION__);
@ -300,7 +323,7 @@ void cSoftOsd::Flush(void)
int y2; int y2;
// get dirty bounding box // get dirty bounding box
if (OsdDirty) { // forced complete update if (Dirty) { // forced complete update
x1 = 0; x1 = 0;
y1 = 0; y1 = 0;
x2 = bitmap->Width() - 1; x2 = bitmap->Width() - 1;
@ -346,7 +369,7 @@ void cSoftOsd::Flush(void)
// FIXME: reuse argb // FIXME: reuse argb
free(argb); free(argb);
} }
OsdDirty = 0; cSoftOsd::Dirty = 0;
return; return;
} }
@ -988,6 +1011,9 @@ cSpuDecoder *cSoftHdDevice::GetSpuDecoder(void)
#endif #endif
/**
** Tells whether this device has a MPEG decoder.
*/
bool cSoftHdDevice::HasDecoder(void) const bool cSoftHdDevice::HasDecoder(void) const
{ {
return true; return true;
@ -1113,6 +1139,9 @@ void cSoftHdDevice::Mute(void)
/** /**
** Display the given I-frame as a still picture. ** Display the given I-frame as a still picture.
**
** @param data pes or ts data of a frame
** @param length length of data area
*/ */
void cSoftHdDevice::StillPicture(const uchar * data, int length) void cSoftHdDevice::StillPicture(const uchar * data, int length)
{ {
@ -1173,7 +1202,7 @@ void cSoftHdDevice:: SetVideoDisplayFormat(eVideoDisplayFormat
last = video_display_format; last = video_display_format;
::VideoSetDisplayFormat(video_display_format); ::VideoSetDisplayFormat(video_display_format);
OsdDirty = 1; cSoftOsd::Dirty = 1;
} }
} }