Loading media/codec2/components/mpeg2/C2SoftMpeg2Dec.h +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ namespace android { #define INPUT_DUMP_EXT "m2v" #define GENERATE_FILE_NAMES() { \ nsecs_t now = systemTime(); \ sprintf(mInFile, "%s_%" PRId64 ".%s", sprintf(mInFile, "%s_%" PRId64 ".%s", \ INPUT_DUMP_PATH, now, \ INPUT_DUMP_EXT); \ } Loading media/codec2/vndk/platform/C2BqBuffer.cpp +0 −16 Original line number Diff line number Diff line Loading @@ -576,14 +576,7 @@ public: } ~Impl() { bool noInit = false; for (int i = 0; i < NUM_BUFFER_SLOTS; ++i) { if (!noInit && mProducer) { Return<HStatus> transResult = mProducer->detachBuffer(static_cast<int32_t>(i)); noInit = !transResult.isOk() || static_cast<HStatus>(transResult) == HStatus::NO_INIT; } mBuffers[i].clear(); } } Loading Loading @@ -692,15 +685,6 @@ public: { sp<GraphicBuffer> buffers[NUM_BUFFER_SLOTS]; std::scoped_lock<std::mutex> lock(mMutex); bool noInit = false; for (int i = 0; i < NUM_BUFFER_SLOTS; ++i) { if (!noInit && mProducer) { Return<HStatus> transResult = mProducer->detachBuffer(static_cast<int32_t>(i)); noInit = !transResult.isOk() || static_cast<HStatus>(transResult) == HStatus::NO_INIT; } } int32_t oldGeneration = mGeneration; if (producer) { mProducer = producer; Loading media/libstagefright/MediaCodec.cpp +16 −4 Original line number Diff line number Diff line Loading @@ -186,9 +186,12 @@ static const char *kCodecShapingEnhanced = "android.media.mediacodec.shaped"; // XXX suppress until we get our representation right static bool kEmitHistogram = false; static int64_t getId(IResourceManagerClient const * client) { return (int64_t) client; } static int64_t getId(const std::shared_ptr<IResourceManagerClient> &client) { return (int64_t) client.get(); return getId(client.get()); } static bool isResourceError(status_t err) { Loading @@ -205,12 +208,20 @@ static const C2MemoryUsage kDefaultReadWriteUsage{ //////////////////////////////////////////////////////////////////////////////// struct ResourceManagerClient : public BnResourceManagerClient { explicit ResourceManagerClient(MediaCodec* codec) : mMediaCodec(codec) {} explicit ResourceManagerClient(MediaCodec* codec, int32_t pid) : mMediaCodec(codec), mPid(pid) {} Status reclaimResource(bool* _aidl_return) override { sp<MediaCodec> codec = mMediaCodec.promote(); if (codec == NULL) { // codec is already gone. // Codec is already gone, so remove the resources as well ::ndk::SpAIBinder binder(AServiceManager_getService("media.resource_manager")); std::shared_ptr<IResourceManagerService> service = IResourceManagerService::fromBinder(binder); if (service == nullptr) { ALOGW("MediaCodec::ResourceManagerClient unable to find ResourceManagerService"); } service->removeClient(mPid, getId(this)); *_aidl_return = true; return Status::ok(); } Loading Loading @@ -247,6 +258,7 @@ struct ResourceManagerClient : public BnResourceManagerClient { private: wp<MediaCodec> mMediaCodec; int32_t mPid; DISALLOW_EVIL_CONSTRUCTORS(ResourceManagerClient); }; Loading Loading @@ -820,7 +832,7 @@ MediaCodec::MediaCodec( mGetCodecBase(getCodecBase), mGetCodecInfo(getCodecInfo) { mResourceManagerProxy = new ResourceManagerServiceProxy(pid, uid, ::ndk::SharedRefBase::make<ResourceManagerClient>(this)); ::ndk::SharedRefBase::make<ResourceManagerClient>(this, pid)); if (!mGetCodecBase) { mGetCodecBase = [](const AString &name, const char *owner) { return GetCodecBase(name, owner); Loading services/audiopolicy/service/AudioPolicyService.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -1938,12 +1938,16 @@ bool AudioPolicyService::AudioCommandThread::threadLoop() while (!exitPending()) { sp<AudioPolicyService> svc; int numTimesBecameEmpty = 0; while (!mAudioCommands.isEmpty() && !exitPending()) { nsecs_t curTime = systemTime(); // commands are sorted by increasing time stamp: execute them from index 0 and up if (mAudioCommands[0]->mTime <= curTime) { sp<AudioCommand> command = mAudioCommands[0]; mAudioCommands.removeAt(0); if (mAudioCommands.isEmpty()) { ++numTimesBecameEmpty; } mLastCommand = command; switch (command->mCommand) { Loading Loading @@ -2180,8 +2184,9 @@ bool AudioPolicyService::AudioCommandThread::threadLoop() } } // release delayed commands wake lock if the queue is empty if (mAudioCommands.isEmpty()) { // release delayed commands wake lock as many times as we made the queue is // empty during popping. while (numTimesBecameEmpty--) { release_wake_lock(mName.string()); } Loading services/camera/libcameraservice/api2/CameraDeviceClient.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -721,8 +721,10 @@ binder::Status CameraDeviceClient::isSessionConfigurationSupported( } *status = false; camera3::metadataGetter getMetadata = [this](const String8 &id, bool /*overrideForPerfClass*/) { return mDevice->infoPhysical(id);}; ret = mProviderManager->isSessionConfigurationSupported(mCameraIdStr.string(), sessionConfiguration, mOverrideForPerfClass, status); sessionConfiguration, mOverrideForPerfClass, getMetadata, status); switch (ret) { case OK: // Expected, do nothing. Loading Loading
media/codec2/components/mpeg2/C2SoftMpeg2Dec.h +1 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ namespace android { #define INPUT_DUMP_EXT "m2v" #define GENERATE_FILE_NAMES() { \ nsecs_t now = systemTime(); \ sprintf(mInFile, "%s_%" PRId64 ".%s", sprintf(mInFile, "%s_%" PRId64 ".%s", \ INPUT_DUMP_PATH, now, \ INPUT_DUMP_EXT); \ } Loading
media/codec2/vndk/platform/C2BqBuffer.cpp +0 −16 Original line number Diff line number Diff line Loading @@ -576,14 +576,7 @@ public: } ~Impl() { bool noInit = false; for (int i = 0; i < NUM_BUFFER_SLOTS; ++i) { if (!noInit && mProducer) { Return<HStatus> transResult = mProducer->detachBuffer(static_cast<int32_t>(i)); noInit = !transResult.isOk() || static_cast<HStatus>(transResult) == HStatus::NO_INIT; } mBuffers[i].clear(); } } Loading Loading @@ -692,15 +685,6 @@ public: { sp<GraphicBuffer> buffers[NUM_BUFFER_SLOTS]; std::scoped_lock<std::mutex> lock(mMutex); bool noInit = false; for (int i = 0; i < NUM_BUFFER_SLOTS; ++i) { if (!noInit && mProducer) { Return<HStatus> transResult = mProducer->detachBuffer(static_cast<int32_t>(i)); noInit = !transResult.isOk() || static_cast<HStatus>(transResult) == HStatus::NO_INIT; } } int32_t oldGeneration = mGeneration; if (producer) { mProducer = producer; Loading
media/libstagefright/MediaCodec.cpp +16 −4 Original line number Diff line number Diff line Loading @@ -186,9 +186,12 @@ static const char *kCodecShapingEnhanced = "android.media.mediacodec.shaped"; // XXX suppress until we get our representation right static bool kEmitHistogram = false; static int64_t getId(IResourceManagerClient const * client) { return (int64_t) client; } static int64_t getId(const std::shared_ptr<IResourceManagerClient> &client) { return (int64_t) client.get(); return getId(client.get()); } static bool isResourceError(status_t err) { Loading @@ -205,12 +208,20 @@ static const C2MemoryUsage kDefaultReadWriteUsage{ //////////////////////////////////////////////////////////////////////////////// struct ResourceManagerClient : public BnResourceManagerClient { explicit ResourceManagerClient(MediaCodec* codec) : mMediaCodec(codec) {} explicit ResourceManagerClient(MediaCodec* codec, int32_t pid) : mMediaCodec(codec), mPid(pid) {} Status reclaimResource(bool* _aidl_return) override { sp<MediaCodec> codec = mMediaCodec.promote(); if (codec == NULL) { // codec is already gone. // Codec is already gone, so remove the resources as well ::ndk::SpAIBinder binder(AServiceManager_getService("media.resource_manager")); std::shared_ptr<IResourceManagerService> service = IResourceManagerService::fromBinder(binder); if (service == nullptr) { ALOGW("MediaCodec::ResourceManagerClient unable to find ResourceManagerService"); } service->removeClient(mPid, getId(this)); *_aidl_return = true; return Status::ok(); } Loading Loading @@ -247,6 +258,7 @@ struct ResourceManagerClient : public BnResourceManagerClient { private: wp<MediaCodec> mMediaCodec; int32_t mPid; DISALLOW_EVIL_CONSTRUCTORS(ResourceManagerClient); }; Loading Loading @@ -820,7 +832,7 @@ MediaCodec::MediaCodec( mGetCodecBase(getCodecBase), mGetCodecInfo(getCodecInfo) { mResourceManagerProxy = new ResourceManagerServiceProxy(pid, uid, ::ndk::SharedRefBase::make<ResourceManagerClient>(this)); ::ndk::SharedRefBase::make<ResourceManagerClient>(this, pid)); if (!mGetCodecBase) { mGetCodecBase = [](const AString &name, const char *owner) { return GetCodecBase(name, owner); Loading
services/audiopolicy/service/AudioPolicyService.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -1938,12 +1938,16 @@ bool AudioPolicyService::AudioCommandThread::threadLoop() while (!exitPending()) { sp<AudioPolicyService> svc; int numTimesBecameEmpty = 0; while (!mAudioCommands.isEmpty() && !exitPending()) { nsecs_t curTime = systemTime(); // commands are sorted by increasing time stamp: execute them from index 0 and up if (mAudioCommands[0]->mTime <= curTime) { sp<AudioCommand> command = mAudioCommands[0]; mAudioCommands.removeAt(0); if (mAudioCommands.isEmpty()) { ++numTimesBecameEmpty; } mLastCommand = command; switch (command->mCommand) { Loading Loading @@ -2180,8 +2184,9 @@ bool AudioPolicyService::AudioCommandThread::threadLoop() } } // release delayed commands wake lock if the queue is empty if (mAudioCommands.isEmpty()) { // release delayed commands wake lock as many times as we made the queue is // empty during popping. while (numTimesBecameEmpty--) { release_wake_lock(mName.string()); } Loading
services/camera/libcameraservice/api2/CameraDeviceClient.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -721,8 +721,10 @@ binder::Status CameraDeviceClient::isSessionConfigurationSupported( } *status = false; camera3::metadataGetter getMetadata = [this](const String8 &id, bool /*overrideForPerfClass*/) { return mDevice->infoPhysical(id);}; ret = mProviderManager->isSessionConfigurationSupported(mCameraIdStr.string(), sessionConfiguration, mOverrideForPerfClass, status); sessionConfiguration, mOverrideForPerfClass, getMetadata, status); switch (ret) { case OK: // Expected, do nothing. Loading