Skip to content
Snippets Groups Projects
Commit bd4b273d authored by Steve Lhomme's avatar Steve Lhomme
Browse files

lib: add a function to the ABI version of the libraries

For users of libvlc with manual DLL loading (especially languages not
compatible with C that have to recode the access to the libvlc DLL) it is
important to know the ABI version of the DLL, in case of API/ABI changes the
wrapper need to be updated and know when the provided DLL package matches or
not. This is especially critical for VLC 4.0 which has not changed version in
4 years and yet the libvlc API keeps changing.

This is similar to the versions of libavcodec/libavformat/etc. When the API is
changed the version values should be updated as well, and hopefully documented
as well.

One should avoid loading the DLL of a mismatching libvlc major ABI version.
Since it's likely to not be usable in the end, it's better not to load it at
all.

This should also be backported to VLC 3.0.
parent c8cd58f9
No related branches found
No related tags found
1 merge request!2870lib: add a function to read the ABI version of the libvlc
Pipeline #290641 passed with stage
in 22 minutes and 33 seconds
......@@ -184,6 +184,23 @@ LIBVLC_API void libvlc_release( libvlc_instance_t *p_instance );
*/
LIBVLC_API void libvlc_retain( libvlc_instance_t *p_instance );
/**
* Get the ABI version of the libvlc library.
*
* This is different than the VLC version, which is the version of the whole
* VLC package. The value is the same as LIBVLC_ABI_VERSION_INT used when
* compiling.
*
* \return a value with the following mask in hexadecimal
* 0xFF000000: major VLC version, similar to VLC major version,
* 0x00FF0000: major ABI version, incremented incompatible changes are added,
* 0x0000FF00: minor ABI version, incremented when new functions are added
* 0x000000FF: micro ABI version, incremented with new release/builds
*
* \note This the same value as the .so version but cross platform.
*/
LIBVLC_API int libvlc_abi_version(void);
/**
* Try to start a user interface for the libvlc instance.
*
......
......@@ -34,6 +34,10 @@
#include <limits.h>
#include <assert.h>
int libvlc_abi_version(void)
{
return LIBVLC_ABI_VERSION_INT;
}
libvlc_instance_t * libvlc_new( int argc, const char *const *argv )
{
......
......@@ -290,3 +290,4 @@ libvlc_picture_get_time
libvlc_picture_list_at
libvlc_picture_list_count
libvlc_picture_list_destroy
libvlc_abi_version
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment