shithub: libopusenc

Download patch

ref: 5377b0b6f694b3c62efd1ef0f186fae754f95dae
parent: 32fad36830518cdcb895d7a7f33f818e2e479962
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Thu May 11 22:32:31 EDT 2017

Versioning

--- a/include/opusenc.h
+++ b/include/opusenc.h
@@ -48,6 +48,10 @@
 # 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
 /* Based on the relevant libopus code minus 10. */
 #define OPE_BAD_ARG -11
@@ -163,6 +167,12 @@
 
 /** Goes straight to the libopus ctl() functions. */
 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)
 }
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -45,6 +45,9 @@
 #include "picture.h"
 #include "ogg_packer.h"
 
+/* Bump this when we change the ABI. */
+#define OPE_ABI_VERSION 0
+
 #define MAX_CHANNELS 8
 
 #define LPC_PADDING 120
@@ -919,6 +922,14 @@
   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);