Add optional argument to ATTA svdrp commmand.

This commit is contained in:
Johns 2012-03-15 15:42:51 +01:00
parent d24f19bc2d
commit 552a994db3
3 changed files with 14 additions and 3 deletions

View File

@ -1,6 +1,7 @@
User johns User johns
Date: Date:
Add optional argument (display) to ATTA svdrp commmand.
Wakeup display to show OSD for remote learning mode. Wakeup display to show OSD for remote learning mode.
Support switching the primary device with svdrp. Support switching the primary device with svdrp.
Disable and reenable screen saver and DPMS. Disable and reenable screen saver and DPMS.

View File

@ -1136,7 +1136,7 @@ static VideoHwDecoder *MyHwDecoder; ///< video hw decoder
static VideoDecoder *MyVideoDecoder; ///< video decoder static VideoDecoder *MyVideoDecoder; ///< video decoder
static enum CodecID VideoCodecID; ///< current codec id 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 static volatile char Usr1Signal; ///< true got usr1 signal
#define VIDEO_BUFFER_SIZE (512 * 1024) ///< video PES buffer default size #define VIDEO_BUFFER_SIZE (512 * 1024) ///< video PES buffer default size

View File

@ -36,6 +36,8 @@
extern "C" extern "C"
{ {
#include "video.h" #include "video.h"
extern const char *X11DisplayName; ///< x11 display name
extern void AudioPoller(void); extern void AudioPoller(void);
extern void CodecSetAudioPassthrough(int); extern void CodecSetAudioPassthrough(int);
extern void CodecSetAudioDownmix(int); extern void CodecSetAudioDownmix(int);
@ -1726,8 +1728,9 @@ static const char *SVDRPHelpText[] = {
"DETA\n" " Detach plugin.\n\n" "DETA\n" " Detach plugin.\n\n"
" The plugin will be detached from the audio, video and DVB\n" " The plugin will be detached from the audio, video and DVB\n"
" devices. Other programs or plugins can use them now.\n", " devices. Other programs or plugins can use them now.\n",
"ATTA\n" " Attach plugin.\n\n" "ATTA <-d display>\n" " Attach plugin.\n\n"
" Attach the plugin to audio, video and DVB devices.\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>\n" " Make <n> the primary device.\n\n" "PRIM <n>\n" " Make <n> the primary device.\n\n"
" <n> is the number of device. Without number softhddevice becomes\n" " <n> is the number of device. Without number softhddevice becomes\n"
" the primary device. If becoming primary, the plugin is attached\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) { if (SuspendMode != SUSPEND_DETACHED) {
return "can't attach SoftHdDevice not 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()) { if (ShutdownHandler.GetUserInactiveTime()) {
ShutdownHandler.SetUserInactiveTimeout(); ShutdownHandler.SetUserInactiveTimeout();
} }