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

Commit 1d94733b authored by Wonsik Kim's avatar Wonsik Kim
Browse files

MediaCodec: manage resources for hardware audio codecs

Bug: 191447420
Test: cts/media/device-small
Change-Id: I9e40f8fefcfffada6fe174b2543dfd6e7624f7e4
parent 918f4ad2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2506,8 +2506,11 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
                        mediametrics_setInt32(mMetricsHandle, kCodecSecure, 0);
                    }

                    if (mIsVideo) {
                        // audio codec is currently ignored.
                    MediaCodecInfo::Attributes attr = mCodecInfo
                            ? mCodecInfo->getAttributes()
                            : MediaCodecInfo::Attributes(0);
                    if (!(attr & MediaCodecInfo::kFlagIsSoftwareOnly)) {
                        // software codec is currently ignored.
                        mResourceManagerProxy->addResource(
                                MediaResource::CodecResource(mFlags & kFlagIsSecure, mIsVideo));
                    }