allow video output driver options in the "Video Driver:" preferences field

103 views
Skip to first unread message

Hans

unread,
Jun 5, 2013, 6:58:02 PM6/5/13
to gnome-...@googlegroups.com
All-

gmtk_media_player.c hardcodes the options for video output drivers in the launch_mplayer() function.

I find that I would like different options than the ones currently in that function. Indeed, it is probably impossible to hardcode vo options which will work for everybody. So it would be nice if there is an easy way to specify those options.

My proposal: In the preferences, we already allow the user to specify the "-vo" driver under Player -> Video Output. Why not also allow to append the vo options, just like for mplayer's own command line? I could put in there "vdpau:hqscaling=1:deint=4" and be happy. Others could do similar tweaks.

If you think this is reasonable then I'm going to send a patch soon.

Technical:

As far as I can see, only the code in launch_mplayer() would be affected. A line like

if (g_ascii_strncasecmp(player->vo, "vdpau", strlen("vdpau")) == 0) {

would be replaced with (pseudo code-ish)

if( strings_equal(player->vo, "vdpau") || string_starts_with(player->vo, "vdpau:") ) {

and then we could just insert player->vo at the first spot in the -vo argument.

I have one problem left: deinterlace options also sometimes go into -vo (like the above deint=4). Having two different "Video Output" switches - one for deinterlace, one for progressive - would be a bit ugly.

Cheers

Hans

Kevin DeKorte

unread,
Jun 6, 2013, 9:17:36 AM6/6/13
to gnome-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hans,

I believe you can do that now. Just type in the vdpau options you want
and they get passed to gmtk.

g_ascii_strncasecmp(player->vo, "vdpau", strlen("vdpau")) == 0

Is basically string_starts_with...

Kevin


- --
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlGwi/AACgkQ6w2kMH0L1dFjpACfaCaoKiacNW8iFQPAtC5q2acb
GqYAniUuxzHRP8qtGOBfWhGHfudhc7ti
=vWNw
-----END PGP SIGNATURE-----

Hans Ecke

unread,
Jun 6, 2013, 11:18:17 AM6/6/13
to gnome-...@googlegroups.com
> I believe you can do that now. Just type in the vdpau options you want
> and they get passed to gmtk.

Okay, I will test.

> g_ascii_strncasecmp(player->vo, "vdpau", strlen("vdpau")) == 0
>
> Is basically string_starts_with...

Ah, clever. You only compare the first strlen("vdpau") characters. I
missed that. This could break for small vo names like "gl" - you are
matching some logic on player->vo starting with "gl", but what if people
put "gl2" in there? (I recall some video player system which had both a
"gl" and a "gl2" driver)

Anyway, it seems this mostly works as I requested. Sorry for the noise.

Hans Ecke

unread,
Jun 11, 2013, 4:06:02 PM6/11/13
to gnome-...@googlegroups.com
I have looked at the code and tested and it only partially works
currently:

If a vo is set in settings under "Video Output"

* if we use "vdpau" and we deinterlace, then options are removed

* if the driver is "gl" or "gl2" and "Enable Video Hardware Support" is
checked then any options are removed

The attached patch fixes this. Please review.

Testing: I have done comprehensive testing. Here are conditions (strings
given under "Video Output") and what is passed to mplayer's -vo option:

if( ! player->deinterlace ) {
"vdpau" -> "vdpau"
"vdpau:hqscaling=1:deint=4" -> "vdpau:hqscaling=1"
"vdpau:hqscaling=1" -> "vdpau:hqscaling=1"
}

if( player->deinterlace ) {
"vdpau" -> "vdpau:deint=2"
"vdpau:hqscaling=1:deint=4" -> "vdpau:hqscaling=1:deint=4"
"vdpau:hqscaling=1" -> "vdpau:hqscaling=1:deint=2"

if( player->enable_hardware_codecs ) {
"gl" -> "gl_nosw"
"gl2" -> "gl_nosw"
"gl:lscale=5:cscale=5" -> "gl_nosw:lscale=5:cscale=5"
"gl2:lscale=5:cscale=5" -> "gl_nosw:lscale=5:cscale=5"
}

All of these tests pass.

Cheers

Hans
--
Hans Ecke Department of Physics
he...@mines.edu Colorado School of Mines
(USA) 303-273-3850 Golden, Colorado

Diplomacy is the art of saying 'Nice doggie' until you can find a rock.
-- Will Rogers.
pass_vo_options_through.diff
Reply all
Reply to author
Forward
0 new messages