Add support to start the plugin in suspended mode.

This commit is contained in:
HelAu 2012-01-30 17:03:15 +01:00 committed by Johns
parent dab31e2367
commit ec4a899bb8
2 changed files with 28 additions and 12 deletions

View File

@ -1,5 +1,10 @@
User HelAu
Date: Mon Jan 30 16:54:47 CET 2012
Add support to start the plugin in suspended mode.
User johns
Date:
Date: Mon Jan 30 15:58:21 CET 2012
Finished rewrite of video code, to support output modules.
Add aspect change support to software decoder path.

View File

@ -61,6 +61,8 @@ static char ConfigVdpauDecoder = 1; ///< use vdpau decoder, if possible
#endif
static char ConfigFullscreen; ///< fullscreen modus
static char ConfigStartSuspended; ///< flag to start in suspend mode
static char ConfigStartX11Server; ///< flag start the x11 server
static pthread_mutex_t SuspendLockMutex; ///< suspend lock mutex
@ -894,6 +896,10 @@ uint8_t *GrabImage(int *size, int jpeg, int quality, int width, int height)
*/
void SetPlayMode(void)
{
if (ConfigStartSuspended) { // ignore first call, if start suspended
ConfigStartSuspended = 0;
return;
}
Resume();
if (MyVideoDecoder) {
if (VideoCodecID != CODEC_ID_NONE) {
@ -1079,8 +1085,6 @@ void OsdDrawARGB(int x, int y, int height, int width, const uint8_t * argb)
//////////////////////////////////////////////////////////////////////////////
static char ConfigStartX11Server; ///< flag start the x11 server
/**
** Return command line help string.
*/
@ -1091,7 +1095,7 @@ const char *CommandLineHelp(void)
" -d display\tdisplay of x11 server (fe. :0.0)\n"
" -f\t\tstart with fullscreen window (only with window manager)\n"
" -g geometry\tx11 window geometry wxh+x+y\n"
" -x\t\tstart x11 server\n";
" -x\t\tstart x11 server\n" " -s\t\tstart in suspended mode\n";
}
/**
@ -1106,7 +1110,7 @@ int ProcessArgs(int argc, char *const argv[])
// Parse arguments.
//
for (;;) {
switch (getopt(argc, argv, "-a:p:d:fg:x")) {
switch (getopt(argc, argv, "-a:p:d:fg:xs")) {
case 'a': // audio device
AudioSetDevice(optarg);
continue;
@ -1130,6 +1134,9 @@ int ProcessArgs(int argc, char *const argv[])
case 'x': // x11 server
ConfigStartX11Server = 1;
continue;
case 's': // start in suspend mode
ConfigStartSuspended = 1;
continue;
case EOF:
break;
case '-':
@ -1311,6 +1318,7 @@ void Start(void)
}
CodecInit();
if (!ConfigStartSuspended) {
// FIXME: AudioInit for HDMI after X11 startup
AudioInit();
MyAudioDecoder = CodecAudioNewDecoder();
@ -1319,7 +1327,10 @@ void Start(void)
if (!ConfigStartX11Server) {
StartVideo();
}
} else {
SkipVideo = 1;
SkipAudio = 1;
}
pthread_mutex_init(&SuspendLockMutex, NULL);
}