]> git.sesse.net Git - vlc/commitdiff
lib: add libvlc_set_app_id() to complement libvlc_set_user_agent()
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 16 Jun 2013 08:11:22 +0000 (11:11 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 16 Jun 2013 08:33:35 +0000 (11:33 +0300)
include/vlc/libvlc.h
lib/core.c
lib/libvlc.sym
src/libvlc.c

index 32d04165945db97133576f681b5ad1c866fa8cf8..485f4ff7198fd86d7935613b254f074f47577dd5 100644 (file)
@@ -214,6 +214,20 @@ LIBVLC_API
 void libvlc_set_user_agent( libvlc_instance_t *p_instance,
                             const char *name, const char *http );
 
+/**
+ * Sets some meta-informations about the application.
+ * See also libvlc_set_user_agent().
+ *
+ * \param p_instance LibVLC instance
+ * \param id Java-style application identifier, e.g. "com.acme.foobar"
+ * \param version application version numbers, e.g. "1.2.3"
+ * \param icon application icon name, e.g. "foobar"
+ * \version LibVLC 2.1.0 or later.
+ */
+LIBVLC_API
+void libvlc_set_app_id( libvlc_instance_t *p_instance, const char *id,
+                        const char *version, const char *icon );
+
 /**
  * Retrieve libvlc version.
  *
index 6539f11415eed7db73f6df29f137e15fa6c4f4ea..486829ddb472b774222a9235bfbe197a40670b96 100644 (file)
@@ -147,6 +147,16 @@ void libvlc_set_user_agent (libvlc_instance_t *p_i,
     }
 }
 
+void libvlc_set_app_id(libvlc_instance_t *p_i, const char *id,
+                       const char *version, const char *icon)
+{
+    libvlc_int_t *p_libvlc = p_i->p_libvlc_int;
+
+    var_SetString(p_libvlc, "app-id", id ? id : "");
+    var_SetString(p_libvlc, "app-version", version ? version : "");
+    var_SetString(p_libvlc, "app-version", icon ? icon : "");
+}
+
 const char * libvlc_get_version(void)
 {
     return VERSION_MESSAGE;
index 8c431c7ff8a686620a1f343165c05e58a023f1d4..c19628a0a6ad331ecb9a2aee20d367a6b9609046 100644 (file)
@@ -180,6 +180,7 @@ libvlc_retain
 libvlc_set_fullscreen
 libvlc_set_log_verbosity
 libvlc_set_user_agent
+libvlc_set_app_id
 libvlc_toggle_fullscreen
 libvlc_toggle_teletext
 libvlc_track_description_release
index 06c69a77d57a72eea36275ac21e1519b66aeb97a..f1b0d65aa6b441705952e62f717ed04311bf89f5 100644 (file)
@@ -395,6 +395,12 @@ dbus_out:
     var_Create( p_libvlc, "http-user-agent", VLC_VAR_STRING );
     var_SetString( p_libvlc, "http-user-agent",
                    "VLC/"PACKAGE_VERSION" LibVLC/"PACKAGE_VERSION );
+    var_Create( p_libvlc, "app-icon-name", VLC_VAR_STRING );
+    var_SetString( p_libvlc, "app-icon-name", PACKAGE_NAME );
+    var_Create( p_libvlc, "app-id", VLC_VAR_STRING );
+    var_SetString( p_libvlc, "app-id", "org.VideoLAN.VLC" );
+    var_Create( p_libvlc, "app-version", VLC_VAR_STRING );
+    var_SetString( p_libvlc, "app-version", PACKAGE_VERSION );
 
     /* System specific configuration */
     system_Configure( p_libvlc, i_argc - vlc_optind, ppsz_argv + vlc_optind );