[vlc-devel] [PATCH 3/3] linux: Add for kms vout plugin possibility to choose output display

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Fri Sep 14 15:37:00 CEST 2018


On 13.08.2018 11:34, Rémi Denis-Courmont wrote:
 > Le vendredi 10 août 2018, 11:26:30 EEST Juha-Pekka Heikkila a écrit :
 >> Up to this point kms vout plugin chose first enumerated display to
 >> be used for output. Now added parameter --kms-connector which will
 >> accept number.
 >
 >
 >> List of available connectors are printed out by
 >> kms vout plugin in debug prints when run in verbose mode.
 >
 > Eww. Please use change_integer_cb() for that sort of things.
 >

I'm not certain how to use change_integer_cb(). I tried following module 
descriptor:

---
vlc_module_begin ()
     set_shortname("kms")
     set_category(CAT_VIDEO)
     set_subcategory(SUBCAT_VIDEO_VOUT)
     add_loadfile(KMS_VAR, "/dev/dri/card0", DEVICE_TEXT, DEVICE_LONGTEXT)

     add_string(VLC_CHROMA_PARAM, NULL, VLC_CHROMA_TEXT, 
VLC_CHROMA_LONGTEXT,
                 true)
     add_string(DRM_CHROMA_PARAM, NULL, DRM_CHROMA_TEXT, 
DRM_CHROMA_LONGTEXT,
                 true)
     add_integer(DRM_CONNECTOR_PARAM, -1, DRM_CONNECTOR_TEXT,
                 DRM_CONNECTOR_LONGTEXT, true)
         change_integer_cb (ChooseConnector)
     set_description("Linux kernel mode setting video output")
     set_capability("vout display", 30)
     set_callbacks(Open, Close)
vlc_module_end ()
---

and try to run it with:
./vlc rc -I "dummy" --verbose=2 --no-audio -V kms,none --kms-connector 
--play-and-exit /home/jheikkil/video.mp4

but my "ChooseConnector(..)" never gets called. I see 
change_integer_cb() is used with xcb_xv so I went checking on it and 
with my Linux Mint default installation it didn't seem so promising either

...
jheikkil at jheikkil-mobl:~$ cvlc -V xcb_xv --xvideo-adaptor ~/video.mp4
VLC media player 2.2.2 Weatherwax (revision 2.2.2-0-g6259d80)
[0000000000d0c658] dummy interface: using the dummy interface module...
...

with 'xvideo-adaptor' parameter that's the output and VLC seems frozen 
at this point. If I give number parameter for 'xvideo-adaptor' my video 
will play.

Any hints how to correctly take change_integer_cb() into use?

/Juha-Pekka


More information about the vlc-devel mailing list