зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1848518) for causing Android build bustages. CLOSED TREE
Backed out changeset f648d27187b6 (bug 1848518) Backed out changeset de6c4da0020b (bug 1848518)
This commit is contained in:
Родитель
6e53b399d7
Коммит
bdd5b85b56
|
@ -9,8 +9,8 @@ origin:
|
|||
description: "Cross platform audio library"
|
||||
url: https://github.com/mozilla/cubeb
|
||||
license: ISC
|
||||
release: 3f86a06fcee0ee738db8d0747bf291df8d12ef07 (2023-08-25T18:09:58Z).
|
||||
revision: 3f86a06fcee0ee738db8d0747bf291df8d12ef07
|
||||
release: ac8474a5929e9de3bce84f16f8c589240eb9f7c4 (2023-08-03T12:13:06Z).
|
||||
revision: ac8474a5929e9de3bce84f16f8c589240eb9f7c4
|
||||
|
||||
vendoring:
|
||||
url: https://github.com/mozilla/cubeb
|
||||
|
|
|
@ -19,7 +19,7 @@ output_latency_function *
|
|||
cubeb_output_latency_load_method(int version)
|
||||
{
|
||||
output_latency_function * ol = NULL;
|
||||
ol = (output_latency_function *)calloc(1, sizeof(output_latency_function));
|
||||
ol = calloc(1, sizeof(output_latency_function));
|
||||
|
||||
ol->version = version;
|
||||
|
||||
|
@ -61,8 +61,6 @@ cubeb_output_latency_unload_method(output_latency_function * ol)
|
|||
free(ol);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
uint32_t
|
||||
cubeb_get_output_latency(output_latency_function * ol)
|
||||
{
|
||||
|
@ -74,6 +72,5 @@ cubeb_get_output_latency(output_latency_function * ol)
|
|||
|
||||
return cubeb_get_output_latency_from_media_library(ol->from_lib);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _CUBEB_OUTPUT_LATENCY_H_
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
#include <cassert>
|
||||
#include <cstdint>
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef _CUBEB_MEDIA_LIBRARY_H_
|
||||
#define _CUBEB_MEDIA_LIBRARY_H_
|
||||
|
||||
typedef int32_t (*get_output_latency_ptr)(uint32_t * latency, int stream_type);
|
||||
|
||||
struct media_lib {
|
||||
void * libmedia;
|
||||
get_output_latency_ptr get_output_latency;
|
||||
int32_t (*get_output_latency)(uint32_t * latency, int stream_type);
|
||||
};
|
||||
|
||||
typedef struct media_lib media_lib;
|
||||
|
@ -17,30 +11,30 @@ typedef struct media_lib media_lib;
|
|||
media_lib *
|
||||
cubeb_load_media_library()
|
||||
{
|
||||
media_lib ml = {};
|
||||
media_lib ml = {0};
|
||||
ml.libmedia = dlopen("libmedia.so", RTLD_LAZY);
|
||||
if (!ml.libmedia) {
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Get the latency, in ms, from AudioFlinger. First, try the most recent
|
||||
// signature. status_t AudioSystem::getOutputLatency(uint32_t* latency,
|
||||
// audio_stream_type_t streamType)
|
||||
ml.get_output_latency = (get_output_latency_ptr)dlsym(
|
||||
ml.get_output_latency = dlsym(
|
||||
ml.libmedia,
|
||||
"_ZN7android11AudioSystem16getOutputLatencyEPj19audio_stream_type_t");
|
||||
if (!ml.get_output_latency) {
|
||||
// In case of failure, try the signature from legacy version.
|
||||
// status_t AudioSystem::getOutputLatency(uint32_t* latency, int streamType)
|
||||
ml.get_output_latency = (get_output_latency_ptr)dlsym(
|
||||
ml.libmedia, "_ZN7android11AudioSystem16getOutputLatencyEPji");
|
||||
ml.get_output_latency =
|
||||
dlsym(ml.libmedia, "_ZN7android11AudioSystem16getOutputLatencyEPji");
|
||||
if (!ml.get_output_latency) {
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
media_lib * rv = nullptr;
|
||||
rv = (media_lib *)calloc(1, sizeof(media_lib));
|
||||
media_lib * rv = NULL;
|
||||
rv = calloc(1, sizeof(media_lib));
|
||||
assert(rv);
|
||||
*rv = ml;
|
||||
return rv;
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
|
||||
typedef struct cubeb_jni cubeb_jni;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
cubeb_jni *
|
||||
cubeb_jni_init();
|
||||
int
|
||||
|
@ -14,8 +10,4 @@ cubeb_get_output_latency_from_jni(cubeb_jni * cubeb_jni_ptr);
|
|||
void
|
||||
cubeb_jni_destroy(cubeb_jni * cubeb_jni_ptr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // _CUBEB_JNI_H_
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче