Discussion:
[MPlayer-users] mplayer (slave mode in Qt) doesn't switch to fullscreen
Jan van Essen
2018-01-02 17:38:48 UTC
Permalink
Hi,

I'm using mplayer in slave mode in a QWidget. Everything is working fine so far. This is the (simplified) string to start the process:

playString = QString("mplayer -slave -quiet -vf screenshot -wid 1120 -zoom -xy 400 tv:// -tv driver=v4l2:device=/dev/video0");

and then I'm binding it to a process:

QProcess *playProcess;
playProcess->start(playString);

I use this method to pass commands to the mplayer process:

void sendCommand(QString cmd) {
QByteArray command(QString("%1\n").arg(cmd).toLatin1().data());
playProcess->write(command);
}

Everything is working fine up to this point. I can use sendCommand("pause 1") or sendCommand("screenshot 0") to pause or screenshot the current playback. So no problems here.

However, I can't use "vo_fullscreen 1" to switch into fullscreen mode. It just ignores the command and does nothing. It doesn't even return any output.

$uname -a
Linux devh 4.9.0-4-amd64 #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23) x86_64 GNU/Linux

$mplayer -h
MPlayer 1.3.0 (Debian)

Any ideas?
Reimar Döffinger
2018-02-24 15:36:45 UTC
Permalink
Post by Jan van Essen
Hi,
playString = QString("mplayer -slave -quiet -vf screenshot -wid 1120 -zoom -xy 400 tv:// -tv driver=v4l2:device=/dev/video0");
QProcess *playProcess;
playProcess->start(playString);
void sendCommand(QString cmd) {
QByteArray command(QString("%1\n").arg(cmd).toLatin1().data());
playProcess->write(command);
}
Everything is working fine up to this point. I can use sendCommand("pause 1") or sendCommand("screenshot 0") to pause or screenshot the current playback. So no problems here.
However, I can't use "vo_fullscreen 1" to switch into fullscreen mode. It just ignores the command and does nothing. It doesn't even return any output.
Well, how could that work?
You are telling it to draw into a window you fully control,
it can't just make it go fullscreen (if it did with some
low-level X11 stuff it would likely make Qt angry).
You will have to make your window fullscreen yourself.
That said, I think vo_fullscreen does still have an effect,
I believe it changes how it handles video- and window-aspect
mismatching.

Loading...