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

Commit 43f49377 authored by Taehwan Kim's avatar Taehwan Kim Committed by Hung-ying Tyan
Browse files

libstagefright: add default gralloc usage for detached surface



a surface can be managed by H/W GPU and
it will cause an error at H/W GPU due to
missing GRALLOC_USAGE_HW_TEXTURE usage.

Bug: 350667377
Bug: 355469843
Test: atest android.mediav2.cts.CodecDecoderSurfaceTest

Signed-off-by: default avatarTaehwan Kim <t_h.kim@samsung.com>
(cherry picked from https://android-review.googlesource.com/q/commit:716bdca6d9242af57f877d51c82a6aa190ab7b5e)
Merged-In: I9d7b46fb7ce3b22c2d82b4a3cbd797c9ea5feb69
Change-Id: I9d7b46fb7ce3b22c2d82b4a3cbd797c9ea5feb69
parent 6071b9f6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -6696,8 +6696,8 @@ sp<Surface> MediaCodec::getOrCreateDetachedSurface() {
    if (!mDetachedSurface) {
        uint64_t usage = 0;
        if (!mSurface || mSurface->getConsumerUsage(&usage) != OK) {
            // TODO: should we use a/the default consumer usage?
            usage = 0;
            // By default prepare buffer to be displayed on any of the common surfaces
            usage = (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_COMPOSER);
        }
        mDetachedSurface.reset(new ReleaseSurface(usage));
    }