[vlc-devel] commit: Added vlc_get_libvlc_object to libvlccore (Basos G )
git version control
git at videolan.org
Mon Dec 15 20:38:57 CET 2008
vlc | branch: master | Basos G <noxelia at gmail.com> | Fri Dec 12 17:12:17 2008 +0200| [21f561ba4af65b0a34ccbc98ed13317c96a96934] | committer: Rémi Denis-Courmont
Added vlc_get_libvlc_object to libvlccore
It is intented to expose the libvlc_int_t (the main vlc object)
to enable extented vlc hacking.. E.g. when you need to make something
with configuration or modules that it is not provided by the PUBLIC API,
you expose the libvlc_int_t as an vlc_object_t and act upon it with
the internal (libvlccore) API...
Signed-off-by: Rémi Denis-Courmont <rdenis at simphalempin.com>
Put back to libvlc rather than libvlccore (a stupid idea of mine).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=21f561ba4af65b0a34ccbc98ed13317c96a96934
---
include/vlc/libvlc.h | 13 +++++++++++++
src/control/core.c | 7 +++++++
src/libvlc.sym | 1 +
3 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
index df79fb2..182bfca 100644
--- a/include/vlc/libvlc.h
+++ b/include/vlc/libvlc.h
@@ -211,6 +211,19 @@ VLC_PUBLIC_API const char * libvlc_get_compiler(void);
*/
VLC_PUBLIC_API const char * libvlc_get_changeset(void);
+struct vlc_object_t;
+
+/**
+ * Return the libvlc internal object, the main object that all other depend on.
+ * Any of of this function should be considered an ugly hack and avoided at all
+ * cost. E.g. you need to expose some functionality that is not provided by the
+ * libvlc API directly with libvlccore.
+ * Remember to release the object with vlc_object_release( obj* )
+ *
+ * \param p_instance the libvlc instance
+ */
+VLC_PUBLIC_API struct vlc_object_t *libvlc_get_vlc_instance(libvlc_instance_t *);
+
/** @}*/
/*****************************************************************************
diff --git a/src/control/core.c b/src/control/core.c
index c31e264..297131f 100644
--- a/src/control/core.c
+++ b/src/control/core.c
@@ -211,3 +211,10 @@ const char * libvlc_get_changeset(void)
{
return VLC_Changeset();
}
+
+/* export internal libvlc_instance for ugly hacks with libvlccore */
+vlc_object_t *libvlc_get_vlc_instance( libvlc_instance_t* p_instance )
+{
+ vlc_object_hold( p_instance->p_libvlc_int ) ;
+ return (vlc_object_t*) p_instance->p_libvlc_int ;
+}
diff --git a/src/libvlc.sym b/src/libvlc.sym
index 4c7efb1..3a02295 100644
--- a/src/libvlc.sym
+++ b/src/libvlc.sym
@@ -38,6 +38,7 @@ libvlc_get_input_thread
libvlc_get_log_verbosity
libvlc_get_version
libvlc_get_vlc_id
+libvlc_get_vlc_instance
libvlc_log_clear
libvlc_log_close
libvlc_log_count
More information about the vlc-devel
mailing list