diff --git a/ChangeLog b/ChangeLog index f4de4ba..fab7dbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ User johns Date: + Add optional argument (display) to ATTA svdrp commmand. Wakeup display to show OSD for remote learning mode. Support switching the primary device with svdrp. Disable and reenable screen saver and DPMS. diff --git a/softhddev.c b/softhddev.c index a6dca5f..c0ca0d6 100644 --- a/softhddev.c +++ b/softhddev.c @@ -1136,7 +1136,7 @@ static VideoHwDecoder *MyHwDecoder; ///< video hw decoder static VideoDecoder *MyVideoDecoder; ///< video decoder static enum CodecID VideoCodecID; ///< current codec id -static const char *X11DisplayName; ///< x11 display name +const char *X11DisplayName; ///< x11 display name static volatile char Usr1Signal; ///< true got usr1 signal #define VIDEO_BUFFER_SIZE (512 * 1024) ///< video PES buffer default size diff --git a/softhddevice.cpp b/softhddevice.cpp index aaa94a4..232d43b 100644 --- a/softhddevice.cpp +++ b/softhddevice.cpp @@ -36,6 +36,8 @@ extern "C" { #include "video.h" + extern const char *X11DisplayName; ///< x11 display name + extern void AudioPoller(void); extern void CodecSetAudioPassthrough(int); extern void CodecSetAudioDownmix(int); @@ -1726,8 +1728,9 @@ static const char *SVDRPHelpText[] = { "DETA\n" " Detach plugin.\n\n" " The plugin will be detached from the audio, video and DVB\n" " devices. Other programs or plugins can use them now.\n", - "ATTA\n" " Attach plugin.\n\n" - " Attach the plugin to audio, video and DVB devices.\n", + "ATTA <-d display>\n" " Attach plugin.\n\n" + " Attach the plugin to audio, video and DVB devices.\n" + " Use -d display (f.e. -d :0.0) to use another X11 display.\n", "PRIM \n" " Make the primary device.\n\n" " is the number of device. Without number softhddevice becomes\n" " the primary device. If becoming primary, the plugin is attached\n" @@ -1809,6 +1812,13 @@ cString cPluginSoftHdDevice::SVDRPCommand(const char *command, if (SuspendMode != SUSPEND_DETACHED) { return "can't attach SoftHdDevice not detached"; } + if ( !strncmp(option, "-d ", 3) ) { + // FIXME: loose memory here + X11DisplayName = strdup(option + 3); + } else if ( !strncmp(option, "-d", 2) ) { + // FIXME: loose memory here + X11DisplayName = strdup(option + 2); + } if (ShutdownHandler.GetUserInactiveTime()) { ShutdownHandler.SetUserInactiveTimeout(); }