Skip to content

Commit

Permalink
Added methods SuspendVideoOutput() and ResumeVideoOutput() to CRBP cl…
Browse files Browse the repository at this point in the history
…ass, which can be used to power down the Raspberry PI's video interface, and restore it at a later point.
  • Loading branch information
macrule authored and popcornmix committed Mar 26, 2016
1 parent 35513ba commit 3bd25ec
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions xbmc/linux/RBP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,20 @@ void CRBP::Deinitialize()
vcsm_exit();
}

void CRBP::SuspendVideoOutput()
{
CLog::Log(LOGDEBUG, "Raspberry PI suspending video output\n");
char response[80];
m_DllBcmHost->vc_gencmd(response, sizeof response, "display_power 0");
}

void CRBP::ResumeVideoOutput()
{
char response[80];
m_DllBcmHost->vc_gencmd(response, sizeof response, "display_power 1");
CLog::Log(LOGDEBUG, "Raspberry PI resuming video output\n");
}

static int mbox_property(int file_desc, void *buf)
{
int ret_val = ioctl(file_desc, IOCTL_MBOX_PROPERTY, buf);
Expand Down
3 changes: 3 additions & 0 deletions xbmc/linux/RBP.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ class CRBP
void WaitVsync();
int GetMBox() { return m_mb; }

void SuspendVideoOutput();
void ResumeVideoOutput();

private:
DllBcmHost *m_DllBcmHost;
bool m_initialized;
Expand Down

0 comments on commit 3bd25ec

Please sign in to comment.