Unverified Commit 5377b0b6 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Versioning

parent 32fad368
...@@ -48,6 +48,10 @@ extern "C" { ...@@ -48,6 +48,10 @@ extern "C" {
# endif # endif
#endif #endif
/* Bump this when we change the API. */
/** API version for this header. Can be used to check for features at compile time. */
#define OPE_API_VERSION 0
#define OPE_OK 0 #define OPE_OK 0
/* Based on the relevant libopus code minus 10. */ /* Based on the relevant libopus code minus 10. */
#define OPE_BAD_ARG -11 #define OPE_BAD_ARG -11
...@@ -164,6 +168,12 @@ OPE_EXPORT int ope_encoder_flush_header(OggOpusEnc *enc); ...@@ -164,6 +168,12 @@ OPE_EXPORT int ope_encoder_flush_header(OggOpusEnc *enc);
/** Goes straight to the libopus ctl() functions. */ /** Goes straight to the libopus ctl() functions. */
OPE_EXPORT int ope_encoder_ctl(OggOpusEnc *enc, int request, ...); OPE_EXPORT int ope_encoder_ctl(OggOpusEnc *enc, int request, ...);
/** Returns a string representing the version of libopusenc being used at run time. */
OPE_EXPORT const char *ope_get_version_string(void);
/** ABI version for this header. Can be used to check for features at run time. */
OPE_EXPORT int ope_get_abi_version(void);
# if defined(__cplusplus) # if defined(__cplusplus)
} }
# endif # endif
......
...@@ -45,6 +45,9 @@ ...@@ -45,6 +45,9 @@
#include "picture.h" #include "picture.h"
#include "ogg_packer.h" #include "ogg_packer.h"
/* Bump this when we change the ABI. */
#define OPE_ABI_VERSION 0
#define MAX_CHANNELS 8 #define MAX_CHANNELS 8
#define LPC_PADDING 120 #define LPC_PADDING 120
...@@ -919,6 +922,14 @@ int ope_encoder_ctl(OggOpusEnc *enc, int request, ...) { ...@@ -919,6 +922,14 @@ int ope_encoder_ctl(OggOpusEnc *enc, int request, ...) {
return ret; return ret;
} }
const char *ope_get_version_string(void)
{
return "libopusenc " PACKAGE_VERSION;
}
int ope_get_abi_version(void) {
return OPE_ABI_VERSION;
}
static void vorbis_lpc_from_data(float *data, float *lpci, int n, int stride); static void vorbis_lpc_from_data(float *data, float *lpci, int n, int stride);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment