Merge "extractors: allow OEM to control output type for WAV/FLAC" into rvc-dev

gugelfrei
Marco Nelissen 4 years ago committed by Android (Google) Code Review
commit ea67cca92e

@ -9,6 +9,7 @@ cc_library {
], ],
shared_libs: [ shared_libs: [
"libbase",
"libbinder_ndk", "libbinder_ndk",
], ],

@ -24,6 +24,7 @@
// libFLAC parser // libFLAC parser
#include "FLAC/stream_decoder.h" #include "FLAC/stream_decoder.h"
#include <android-base/properties.h>
#include <android/binder_ibinder.h> // for AIBinder_getCallingUid #include <android/binder_ibinder.h> // for AIBinder_getCallingUid
#include <audio_utils/primitives.h> #include <audio_utils/primitives.h>
#include <media/MediaExtractorPluginApi.h> #include <media/MediaExtractorPluginApi.h>
@ -47,7 +48,8 @@ namespace android {
// (Note: duplicated with WAVExtractor.cpp) // (Note: duplicated with WAVExtractor.cpp)
static inline bool shouldExtractorOutputFloat(int bitsPerSample) static inline bool shouldExtractorOutputFloat(int bitsPerSample)
{ {
return bitsPerSample > 16 && AIBinder_getCallingUid() == AID_MEDIA; return bitsPerSample > 16 && AIBinder_getCallingUid() == AID_MEDIA
&& android::base::GetBoolProperty("media.extractor.float", true);
} }
class FLACParser; class FLACParser;

@ -10,6 +10,7 @@ cc_library {
], ],
shared_libs: [ shared_libs: [
"libbase",
"libbinder_ndk", "libbinder_ndk",
], ],

@ -20,6 +20,7 @@
#include "WAVExtractor.h" #include "WAVExtractor.h"
#include <android-base/properties.h>
#include <android/binder_ibinder.h> // for AIBinder_getCallingUid #include <android/binder_ibinder.h> // for AIBinder_getCallingUid
#include <audio_utils/primitives.h> #include <audio_utils/primitives.h>
#include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/foundation/ADebug.h>
@ -43,7 +44,8 @@ namespace android {
// (Note: duplicated with FLACExtractor.cpp) // (Note: duplicated with FLACExtractor.cpp)
static inline bool shouldExtractorOutputFloat(int bitsPerSample) static inline bool shouldExtractorOutputFloat(int bitsPerSample)
{ {
return bitsPerSample > 16 && AIBinder_getCallingUid() == AID_MEDIA; return bitsPerSample > 16 && AIBinder_getCallingUid() == AID_MEDIA
&& android::base::GetBoolProperty("media.extractor.float", true);
} }
enum { enum {

Loading…
Cancel
Save