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

Commit bda33909 authored by Sanjay Singh's avatar Sanjay Singh Committed by Wonsik Kim
Browse files

OMXNodeInstance: Allow dynamic native handle mode for input buffers

Some camera implementation uses Dynamic native handle to send input
buffers to OMX HAL. Therefore, these buffers should be allowed.

Bug: 77486542
Bug: 80174666
Bug: 80210572
Bug: 80252747
Test: sts-tradefed run sts -m StsHostTestCases -t android.security.sts.Poc18_06#testPocBug_77486542
Test: adb shell am instrument -e size small -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Test: adb shell am instrument -e class android.hardware.cts.CameraTest -w 'android.camera.cts/android.support.test.runner.AndroidJUnitRunner'
Test: adb shell am instrument -e class android.hardware.multiprocess.camera.cts.CameraEvictionTest -w 'android.camera.cts/android.support.test.runner.AndroidJUnitRunner'
Test: Exercise secure playback with Play Movies app.
Test: Record video with Camera app and play it back with Photos app

Change-Id: I1e4eb72e070f4e60ff4df94f9b9d161361828477
parent e4aa5e88
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1063,7 +1063,8 @@ status_t OMXNodeInstance::useBuffer(
        }

        case OMXBuffer::kBufferTypeSharedMem: {
            if (mPortMode[portIndex] != IOMX::kPortModePresetByteBuffer) {
            if (mPortMode[portIndex] != IOMX::kPortModePresetByteBuffer
                    && mPortMode[portIndex] != IOMX::kPortModeDynamicANWBuffer) {
                break;
            }
            return useBuffer_l(portIndex, omxBuffer.mMem, NULL, buffer);
@@ -1078,7 +1079,8 @@ status_t OMXNodeInstance::useBuffer(

        case OMXBuffer::kBufferTypeHidlMemory: {
                if (mPortMode[portIndex] != IOMX::kPortModePresetByteBuffer
                        && mPortMode[portIndex] != IOMX::kPortModeDynamicANWBuffer) {
                        && mPortMode[portIndex] != IOMX::kPortModeDynamicANWBuffer
                        && mPortMode[portIndex] != IOMX::kPortModeDynamicNativeHandle) {
                    break;
                }
                sp<IHidlMemory> hidlMemory = mapMemory(omxBuffer.mHidlMemory);
@@ -1089,7 +1091,8 @@ status_t OMXNodeInstance::useBuffer(
            break;
    }

    ALOGE("b/77486542");
    ALOGE("b/77486542 : bufferType = %d vs. portMode = %d",
          omxBuffer.mBufferType, mPortMode[portIndex]);
    android_errorWriteLog(0x534e4554, "77486542");
    return INVALID_OPERATION;
}