[vlc-devel] [PATCH 1/3] libvlc: add media role option

Rémi Denis-Courmont remi at remlab.net
Sun Jun 5 10:28:46 CEST 2016


---
 src/libvlc-module.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 74fc7e5..8871869 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -124,10 +124,21 @@ static const char *const ppsz_snap_formats[] =
     "The default behavior is to automatically select the best method " \
     "available.")
 
+#define ROLE_TEXT N_("Media role")
+#define ROLE_LONGTEXT N_("Media (player) role for operating system policy.")
+
 #define AUDIO_TEXT N_("Enable audio")
 #define AUDIO_LONGTEXT N_( \
     "You can completely disable the audio output. The audio " \
     "decoding stage will not take place, thus saving some processing power.")
+static const char *ppsz_roles[] = {
+     "video", "music", "communication", "game",
+     "notification", "animation", "production", "accessibility", "test",
+};
+static const char *ppsz_roles_text[] = {
+    "Video", "Music", "Communication", "Game",
+    "Notification",  "Animation", "Production", "Accessibility", "Test",
+};
 
 #define GAIN_TEXT N_("Audio gain")
 #define GAIN_LONGTEXT N_( \
@@ -1466,6 +1477,9 @@ vlc_module_begin ()
     add_module( "aout", "audio output", NULL, AOUT_TEXT, AOUT_LONGTEXT,
                 true )
         change_short('A')
+    add_string( "role", "video", ROLE_TEXT, ROLE_LONGTEXT, true )
+        change_string_list( ppsz_roles, ppsz_roles_text )
+
     set_subcategory( SUBCAT_AUDIO_AFILTER )
     add_module_list( "audio-filter", "audio filter", NULL,
                      AUDIO_FILTER_TEXT, AUDIO_FILTER_LONGTEXT, false )
-- 
1.9.1



More information about the vlc-devel mailing list