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

Commit 5753fb1d authored by Sungtak Lee's avatar Sungtak Lee
Browse files

media.c2 aidl: Handle Gralloc buffer conversion from C2HandleAhwb

Currently only C2HandleGralloc can be converted to Gralloc buffer.
Handle conversion from C2HandleAhwb to Gralloc buffer.

Bug: 317372247
Test: atest android.media.codec.cts.DecodeEditEncodeTest
Change-Id: I187faf80e94298db09bb2fbe36f86bf8d8ae5fca
parent 1e9513e6
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1049,8 +1049,12 @@ public:
        // Unwrap raw buffer handle from the C2Handle
        native_handle_t *nh = UnwrapNativeCodec2GrallocHandle(handle);
        if (!nh) {
            nh = UnwrapNativeCodec2AhwbHandle(handle);
            if (!nh) {
                ALOGE("handle is not compatible to neither C2HandleGralloc nor C2HandleAhwb");
                return;
            }
        }
        // Import the raw handle so IMapper can use the buffer. The imported
        // handle must be freed when the client is done with the buffer.
        status_t status = mapper.importBufferNoValidate(