[vlc-commits] lib: add libvlc_set_app_id() to complement libvlc_set_user_agent()

Rémi Denis-Courmont git at videolan.org
Sun Jun 16 10:35:00 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jun 16 11:11:22 2013 +0300| [921aaff4784b7e0e54ac0fe496bf864c1806c57e] | committer: Rémi Denis-Courmont

lib: add libvlc_set_app_id() to complement libvlc_set_user_agent()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=921aaff4784b7e0e54ac0fe496bf864c1806c57e
---

 include/vlc/libvlc.h |   14 ++++++++++++++
 lib/core.c           |   10 ++++++++++
 lib/libvlc.sym       |    1 +
 src/libvlc.c         |    6 ++++++
 4 files changed, 31 insertions(+)

diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
index 32d0416..485f4ff 100644
--- a/include/vlc/libvlc.h
+++ b/include/vlc/libvlc.h
@@ -215,6 +215,20 @@ 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.
  *
  * Example: "1.1.0-git The Luggage"
diff --git a/lib/core.c b/lib/core.c
index 6539f11..486829d 100644
--- a/lib/core.c
+++ b/lib/core.c
@@ -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;
diff --git a/lib/libvlc.sym b/lib/libvlc.sym
index 8c431c7..c19628a 100644
--- a/lib/libvlc.sym
+++ b/lib/libvlc.sym
@@ -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
diff --git a/src/libvlc.c b/src/libvlc.c
index 06c69a7..f1b0d65 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -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 );



More information about the vlc-commits mailing list