Skip to content

Commit

Permalink
Add a new "DBUG" SVDRP command.
Browse files Browse the repository at this point in the history
  • Loading branch information
rofafor committed Mar 11, 2018
1 parent d29d35e commit b4f2f63
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 33 deletions.
6 changes: 4 additions & 2 deletions generate_system_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ check_component () {
}

echo "#### VAAPIDEVICE SYSTEM INFORMATION REPORT"
check_component "inxi" "-CGASMNzx -! 31"
check_component "inxi" "-CGASMzx -! 31"
check_component "vainfo" ""
check_component "ffmpeg" "-version"
check_component "ffmpeg" "-version" | sed '/^configuration:/d'
check_component "gcc" "-dumpversion"
check_component "svdrpsend" "plug vaapidevice dbug" | sed 's/^\(22[0-1]\) [a-zA-Z0-9]* \(.*\)$/\1 <filter> \2/'
echo "##### INCLUDE THIS REPORT INTO YOUR GITHUB ISSUE"
82 changes: 51 additions & 31 deletions vaapidevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,43 +179,54 @@ class cDebugStatistics:public cThread
int area_h;
int area_bpp;

void Draw(void)
cString VideoStats(void)
{
LOCK_THREAD;
if (osd)
cString stats = "";
char *info = GetVideoStats();
if (info)
{
const cFont *font = cFont::GetFont(fontSml);
int y = 0, h = font->Height();
char *info = GetVideoStats();
if (info)
{
osd->DrawText(0, y, info, clrWhite, clrGray50, font, 2160, h);
free(info);
} else
{
osd->DrawRectangle(0, y, 2160, y + h, clrGray50);
}
y += h;
stats = info;
free(info);
}
return stats;
}

info = GetVideoInfo();
cString VideoInfo(void)
{
cString stats = "";
char *info = GetVideoInfo();

if (info) {
osd->DrawText(0, y, info, clrWhite, clrGray50, font, 2160, h);
free(info);
} else {
osd->DrawRectangle(0, y, 2160, y + h, clrGray50);
}
y += h;
if (info) {
stats = info;
free(info);
}
return stats;
}

info = GetAudioInfo();
cString AudioInfo(void)
{
cString stats = "";
char *info = GetAudioInfo();

if (info) {
osd->DrawText(0, y, info, clrWhite, clrGray50, font, 2160, h);
free(info);
} else {
osd->DrawRectangle(0, y, 2160, y + h, clrGray50);
}
if (info) {
stats = info;
free(info);
}
return stats;
}

void Draw(void)
{
LOCK_THREAD;
if (osd) {
const cFont *font = cFont::GetFont(fontSml);
int y = 0, h = font->Height();

osd->DrawText(0, y, *VideoStats(), clrWhite, clrGray50, font, area_w, h);
y += h;
osd->DrawText(0, y, *VideoInfo(), clrWhite, clrGray50, font, area_w, h);
y += h;
osd->DrawText(0, y, *AudioInfo(), clrWhite, clrGray50, font, area_w, h);
y += h;

osd->Flush();
Expand Down Expand Up @@ -270,6 +281,11 @@ class cDebugStatistics:public cThread
Start();
return true;
}

cString Dump(void)
{
return cString::sprintf("%s\n%s\n%s\n", *VideoStats(), *VideoInfo(), *AudioInfo());
}
};

static class cDebugStatistics *MyDebug;
Expand Down Expand Up @@ -2480,7 +2496,8 @@ static const char *SVDRPHelpText[] = {
" SUSPEND_NORMAL == 1 (911)\n" " SUSPEND_DETACHED == 2 (912)\n",
"RAIS\n" "\040 Raise vaapidevice window\n\n" " If Xserver is not started by vaapidevice, the window which\n"
" contains the vaapidevice frontend will be raised to the front.\n",
"TRAC [ <mode> ]\n" " gets and/or sets used tracing mode.\n",
"TRAC [ <mode> ]\n" " Get and/or set used tracing mode.\n",
"DBUG\n" "\040 Show debug information.\n",
NULL
};

Expand Down Expand Up @@ -2661,6 +2678,9 @@ cString cPluginVaapiDevice::SVDRPCommand(const char *command, const char *option
TraceMode = strtol(option, NULL, 0) & 0xFFFF;
return cString::sprintf("tracing mode: 0x%04X\n", TraceMode);
}
if (!strcasecmp(command, "DBUG")) {
return MyDebug->Dump();
}

return NULL;
}
Expand Down

0 comments on commit b4f2f63

Please sign in to comment.