Loading media/libaaudio/libaaudio.map.txt +6 −6 Original line number Diff line number Diff line Loading @@ -17,9 +17,9 @@ LIBAAUDIO { AAudioStreamBuilder_setSharingMode; AAudioStreamBuilder_setDirection; AAudioStreamBuilder_setBufferCapacityInFrames; AAudioStreamBuilder_setUsage; AAudioStreamBuilder_setContentType; AAudioStreamBuilder_setInputPreset; AAudioStreamBuilder_setUsage; # introduced=28 AAudioStreamBuilder_setContentType; # introduced=28 AAudioStreamBuilder_setInputPreset; # introduced=28 AAudioStreamBuilder_openStream; AAudioStreamBuilder_delete; AAudioStream_close; Loading @@ -45,9 +45,9 @@ LIBAAUDIO { AAudioStream_getFormat; AAudioStream_getSharingMode; AAudioStream_getDirection; AAudioStream_getUsage; AAudioStream_getContentType; AAudioStream_getInputPreset; AAudioStream_getUsage; # introduced=28 AAudioStream_getContentType; # introduced=28 AAudioStream_getInputPreset; # introduced=28 AAudioStream_getFramesWritten; AAudioStream_getFramesRead; AAudioStream_getTimestamp; Loading media/libaaudio/src/client/AudioStreamInternal.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,10 @@ aaudio_result_t AudioStreamInternal::open(const AudioStreamBuilder &builder) { request.getConfiguration().setDirection(getDirection()); request.getConfiguration().setSharingMode(getSharingMode()); request.getConfiguration().setUsage(getUsage()); request.getConfiguration().setContentType(getContentType()); request.getConfiguration().setInputPreset(getInputPreset()); request.getConfiguration().setBufferCapacity(builder.getBufferCapacity()); mServiceStreamHandle = mServiceInterface.openStream(request, configurationOutput); Loading @@ -131,6 +135,10 @@ aaudio_result_t AudioStreamInternal::open(const AudioStreamBuilder &builder) { setDeviceId(configurationOutput.getDeviceId()); setSharingMode(configurationOutput.getSharingMode()); setUsage(configurationOutput.getUsage()); setContentType(configurationOutput.getContentType()); setInputPreset(configurationOutput.getInputPreset()); // Save device format so we can do format conversion and volume scaling together. mDeviceFormat = configurationOutput.getFormat(); Loading media/libaaudio/src/core/AudioStream.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,8 @@ aaudio_result_t AudioStream::open(const AudioStreamBuilder& builder) mDeviceId, mPerformanceMode, (isDataCallbackSet() ? "ON" : "OFF"), mFramesPerDataCallback); ALOGI("open() usage = %d, contentType = %d, inputPreset = %d", mUsage, mContentType, mInputPreset); return AAUDIO_OK; } Loading Loading @@ -234,6 +236,17 @@ aaudio_result_t AudioStream::createThread(int64_t periodNanoseconds, if (err != 0) { return AAudioConvert_androidToAAudioResult(-errno); } else { // Name the thread with an increasing index, "AAudio_#", for debugging. static std::atomic<uint32_t> nextThreadIndex{1}; char name[16]; // max length for a pthread_name uint32_t index = nextThreadIndex++; // Wrap the index so that we do not hit the 16 char limit // and to avoid hard-to-read large numbers. index = index % 100000; // arbitrary snprintf(name, sizeof(name), "AAudio_%u", index); err = pthread_setname_np(mThread, name); ALOGW_IF((err != 0), "Could not set name of AAudio thread. err = %d", err); mHasThread = true; return AAUDIO_OK; } Loading media/libaaudio/src/core/AudioStream.h +22 −0 Original line number Diff line number Diff line Loading @@ -420,6 +420,7 @@ protected: /** * This should not be called after the open() call. * TODO for multiple setters: assert(mState == AAUDIO_STREAM_STATE_UNINITIALIZED) */ void setSampleRate(int32_t sampleRate) { mSampleRate = sampleRate; Loading Loading @@ -468,6 +469,27 @@ protected: return mPeriodNanoseconds.load(std::memory_order_acquire); } /** * This should not be called after the open() call. */ void setUsage(aaudio_usage_t usage) { mUsage = usage; } /** * This should not be called after the open() call. */ void setContentType(aaudio_content_type_t contentType) { mContentType = contentType; } /** * This should not be called after the open() call. */ void setInputPreset(aaudio_input_preset_t inputPreset) { mInputPreset = inputPreset; } private: std::mutex mStreamLock; Loading media/libmedia/Android.bp +15 −0 Original line number Diff line number Diff line Loading @@ -139,10 +139,18 @@ cc_library_static { }, } filegroup { name: "mediaupdateservice_aidl", srcs: [ "aidl/android/media/IMediaExtractorUpdateService.aidl", ], } cc_library_shared { name: "libmedia", srcs: [ ":mediaupdateservice_aidl", "IDataSource.cpp", "BufferingSettings.cpp", "mediaplayer.cpp", Loading Loading @@ -179,6 +187,11 @@ cc_library_shared { "StringArray.cpp", ], aidl: { local_include_dirs: ["aidl"], export_aidl_headers: true, }, shared_libs: [ "liblog", "libcutils", Loading Loading @@ -306,6 +319,7 @@ cc_library_shared { srcs: [ "AudioParameter.cpp", "JAudioTrack.cpp", "MediaPlayer2Factory.cpp", "MediaPlayer2Manager.cpp", "TestPlayerStub.cpp", Loading @@ -314,6 +328,7 @@ cc_library_shared { ], shared_libs: [ "libandroid_runtime", "libaudioclient", "libbinder", "libcutils", Loading Loading
media/libaaudio/libaaudio.map.txt +6 −6 Original line number Diff line number Diff line Loading @@ -17,9 +17,9 @@ LIBAAUDIO { AAudioStreamBuilder_setSharingMode; AAudioStreamBuilder_setDirection; AAudioStreamBuilder_setBufferCapacityInFrames; AAudioStreamBuilder_setUsage; AAudioStreamBuilder_setContentType; AAudioStreamBuilder_setInputPreset; AAudioStreamBuilder_setUsage; # introduced=28 AAudioStreamBuilder_setContentType; # introduced=28 AAudioStreamBuilder_setInputPreset; # introduced=28 AAudioStreamBuilder_openStream; AAudioStreamBuilder_delete; AAudioStream_close; Loading @@ -45,9 +45,9 @@ LIBAAUDIO { AAudioStream_getFormat; AAudioStream_getSharingMode; AAudioStream_getDirection; AAudioStream_getUsage; AAudioStream_getContentType; AAudioStream_getInputPreset; AAudioStream_getUsage; # introduced=28 AAudioStream_getContentType; # introduced=28 AAudioStream_getInputPreset; # introduced=28 AAudioStream_getFramesWritten; AAudioStream_getFramesRead; AAudioStream_getTimestamp; Loading
media/libaaudio/src/client/AudioStreamInternal.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,10 @@ aaudio_result_t AudioStreamInternal::open(const AudioStreamBuilder &builder) { request.getConfiguration().setDirection(getDirection()); request.getConfiguration().setSharingMode(getSharingMode()); request.getConfiguration().setUsage(getUsage()); request.getConfiguration().setContentType(getContentType()); request.getConfiguration().setInputPreset(getInputPreset()); request.getConfiguration().setBufferCapacity(builder.getBufferCapacity()); mServiceStreamHandle = mServiceInterface.openStream(request, configurationOutput); Loading @@ -131,6 +135,10 @@ aaudio_result_t AudioStreamInternal::open(const AudioStreamBuilder &builder) { setDeviceId(configurationOutput.getDeviceId()); setSharingMode(configurationOutput.getSharingMode()); setUsage(configurationOutput.getUsage()); setContentType(configurationOutput.getContentType()); setInputPreset(configurationOutput.getInputPreset()); // Save device format so we can do format conversion and volume scaling together. mDeviceFormat = configurationOutput.getFormat(); Loading
media/libaaudio/src/core/AudioStream.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,8 @@ aaudio_result_t AudioStream::open(const AudioStreamBuilder& builder) mDeviceId, mPerformanceMode, (isDataCallbackSet() ? "ON" : "OFF"), mFramesPerDataCallback); ALOGI("open() usage = %d, contentType = %d, inputPreset = %d", mUsage, mContentType, mInputPreset); return AAUDIO_OK; } Loading Loading @@ -234,6 +236,17 @@ aaudio_result_t AudioStream::createThread(int64_t periodNanoseconds, if (err != 0) { return AAudioConvert_androidToAAudioResult(-errno); } else { // Name the thread with an increasing index, "AAudio_#", for debugging. static std::atomic<uint32_t> nextThreadIndex{1}; char name[16]; // max length for a pthread_name uint32_t index = nextThreadIndex++; // Wrap the index so that we do not hit the 16 char limit // and to avoid hard-to-read large numbers. index = index % 100000; // arbitrary snprintf(name, sizeof(name), "AAudio_%u", index); err = pthread_setname_np(mThread, name); ALOGW_IF((err != 0), "Could not set name of AAudio thread. err = %d", err); mHasThread = true; return AAUDIO_OK; } Loading
media/libaaudio/src/core/AudioStream.h +22 −0 Original line number Diff line number Diff line Loading @@ -420,6 +420,7 @@ protected: /** * This should not be called after the open() call. * TODO for multiple setters: assert(mState == AAUDIO_STREAM_STATE_UNINITIALIZED) */ void setSampleRate(int32_t sampleRate) { mSampleRate = sampleRate; Loading Loading @@ -468,6 +469,27 @@ protected: return mPeriodNanoseconds.load(std::memory_order_acquire); } /** * This should not be called after the open() call. */ void setUsage(aaudio_usage_t usage) { mUsage = usage; } /** * This should not be called after the open() call. */ void setContentType(aaudio_content_type_t contentType) { mContentType = contentType; } /** * This should not be called after the open() call. */ void setInputPreset(aaudio_input_preset_t inputPreset) { mInputPreset = inputPreset; } private: std::mutex mStreamLock; Loading
media/libmedia/Android.bp +15 −0 Original line number Diff line number Diff line Loading @@ -139,10 +139,18 @@ cc_library_static { }, } filegroup { name: "mediaupdateservice_aidl", srcs: [ "aidl/android/media/IMediaExtractorUpdateService.aidl", ], } cc_library_shared { name: "libmedia", srcs: [ ":mediaupdateservice_aidl", "IDataSource.cpp", "BufferingSettings.cpp", "mediaplayer.cpp", Loading Loading @@ -179,6 +187,11 @@ cc_library_shared { "StringArray.cpp", ], aidl: { local_include_dirs: ["aidl"], export_aidl_headers: true, }, shared_libs: [ "liblog", "libcutils", Loading Loading @@ -306,6 +319,7 @@ cc_library_shared { srcs: [ "AudioParameter.cpp", "JAudioTrack.cpp", "MediaPlayer2Factory.cpp", "MediaPlayer2Manager.cpp", "TestPlayerStub.cpp", Loading @@ -314,6 +328,7 @@ cc_library_shared { ], shared_libs: [ "libandroid_runtime", "libaudioclient", "libbinder", "libcutils", Loading