Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63c56a47 authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "SoundPool: Clean up attribute pointer" into tm-dev am: 90f2f63c

parents 7d076eba 90f2f63c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -85,12 +85,13 @@ bool checkLoop(int32_t *loop)
} // namespace

SoundPool::SoundPool(
        int32_t maxStreams, const audio_attributes_t* attributes, const std::string& opPackageName)
        int32_t maxStreams, const audio_attributes_t& attributes,
        const std::string& opPackageName)
    : mStreamManager(maxStreams, kStreamManagerThreads, attributes, opPackageName)
{
    ALOGV("%s(maxStreams=%d, attr={ content_type=%d, usage=%d, flags=0x%x, tags=%s })",
            __func__, maxStreams,
            attributes->content_type, attributes->usage, attributes->flags, attributes->tags);
            attributes.content_type, attributes.usage, attributes.flags, attributes.tags);
}

SoundPool::~SoundPool()
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ namespace android {
 */
class SoundPool {
public:
    SoundPool(int32_t maxStreams, const audio_attributes_t* attributes,
    SoundPool(int32_t maxStreams, const audio_attributes_t& attributes,
            const std::string& opPackageName = {});
    ~SoundPool();

+2 −2
Original line number Diff line number Diff line
@@ -106,10 +106,10 @@ int32_t StreamMap::getNextIdForStream(Stream* stream) const {
#pragma clang diagnostic ignored "-Wthread-safety-analysis"

StreamManager::StreamManager(
        int32_t streams, size_t threads, const audio_attributes_t* attributes,
        int32_t streams, size_t threads, const audio_attributes_t& attributes,
        std::string opPackageName)
    : StreamMap(streams)
    , mAttributes(*attributes)
    , mAttributes(attributes)
    , mOpPackageName(std::move(opPackageName))
    , mLockStreamManagerStop(streams == 1 || kForceLockStreamManagerStop)
{
+1 −1
Original line number Diff line number Diff line
@@ -387,7 +387,7 @@ class StreamManager : public StreamMap {
public:
    // Note: the SoundPool pointer is only used for stream initialization.
    // It is not stored in StreamManager.
    StreamManager(int32_t streams, size_t threads, const audio_attributes_t* attributes,
    StreamManager(int32_t streams, size_t threads, const audio_attributes_t& attributes,
            std::string opPackageName);
    ~StreamManager();

+1 −1
Original line number Diff line number Diff line
@@ -520,7 +520,7 @@ android_media_SoundPool_native_setup(JNIEnv *env, jobject thiz,
            (audio_flags_mask_t) env->GetIntField(jaa, javaAudioAttrFields.fieldFlags);
    ScopedUtfChars opPackageNameStr(env, opPackageName);
    auto soundPool = std::make_shared<SoundPool>(
            maxChannels, &audioAttributes, opPackageNameStr.c_str());
            maxChannels, audioAttributes, opPackageNameStr.c_str());
    soundPool->setCallback(android_media_callback, nullptr /* user */);

    // register with SoundPoolManager.
Loading