diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-03 14:14:26 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-03 14:14:26 -0500 |
commit | 1960d6e08a949ceed50e6a18240d40a7ecee879c (patch) | |
tree | 580b06d4df15ff5f8a9c3f20468bf2160ac666e5 /media/libcubeb/src/android/cubeb-output-latency.h | |
parent | 732fe36241032a1793e09209ccc06cb720225b9e (diff) | |
download | UXP-1960d6e08a949ceed50e6a18240d40a7ecee879c.tar UXP-1960d6e08a949ceed50e6a18240d40a7ecee879c.tar.gz UXP-1960d6e08a949ceed50e6a18240d40a7ecee879c.tar.lz UXP-1960d6e08a949ceed50e6a18240d40a7ecee879c.tar.xz UXP-1960d6e08a949ceed50e6a18240d40a7ecee879c.zip |
Revert "Issue #1267 - Part 1: Update libcubeb to a1200c34."
This reverts commit d162ecbaffe845c9707da5d2f6cab11f343ef00e.
Diffstat (limited to 'media/libcubeb/src/android/cubeb-output-latency.h')
-rw-r--r-- | media/libcubeb/src/android/cubeb-output-latency.h | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/media/libcubeb/src/android/cubeb-output-latency.h b/media/libcubeb/src/android/cubeb-output-latency.h deleted file mode 100644 index a824fc1c2..000000000 --- a/media/libcubeb/src/android/cubeb-output-latency.h +++ /dev/null @@ -1,76 +0,0 @@ -#ifndef _CUBEB_OUTPUT_LATENCY_H_ -#define _CUBEB_OUTPUT_LATENCY_H_ - -#include <stdbool.h> -#include "cubeb_media_library.h" -#include "../cubeb-jni.h" - -struct output_latency_function { - media_lib * from_lib; - cubeb_jni * from_jni; - int version; -}; - -typedef struct output_latency_function output_latency_function; - -const int ANDROID_JELLY_BEAN_MR1_4_2 = 17; - -output_latency_function * -cubeb_output_latency_load_method(int version) -{ - output_latency_function * ol = NULL; - ol = calloc(1, sizeof(output_latency_function)); - - ol->version = version; - - if (ol->version > ANDROID_JELLY_BEAN_MR1_4_2){ - ol->from_jni = cubeb_jni_init(); - return ol; - } - - ol->from_lib = cubeb_load_media_library(); - return ol; -} - -bool -cubeb_output_latency_method_is_loaded(output_latency_function * ol) -{ - assert(ol && (ol->from_jni || ol->from_lib)); - if (ol->version > ANDROID_JELLY_BEAN_MR1_4_2){ - return !!ol->from_jni; - } - - return !!ol->from_lib; -} - -void -cubeb_output_latency_unload_method(output_latency_function * ol) -{ - if (!ol) { - return; - } - - if (ol->version > ANDROID_JELLY_BEAN_MR1_4_2 && ol->from_jni) { - cubeb_jni_destroy(ol->from_jni); - } - - if (ol->version <= ANDROID_JELLY_BEAN_MR1_4_2 && ol->from_lib) { - cubeb_close_media_library(ol->from_lib); - } - - free(ol); -} - -uint32_t -cubeb_get_output_latency(output_latency_function * ol) -{ - assert(cubeb_output_latency_method_is_loaded(ol)); - - if (ol->version > ANDROID_JELLY_BEAN_MR1_4_2){ - return cubeb_get_output_latency_from_jni(ol->from_jni); - } - - return cubeb_get_output_latency_from_media_library(ol->from_lib); -} - -#endif // _CUBEB_OUTPUT_LATENCY_H_ |