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

Commit 1ee279df authored by Yin-Chia Yeh's avatar Yin-Chia Yeh
Browse files

Camera: use framework header for VideoNativeHandleMetadata

Test: build
Bug: 35625849
Change-Id: I8159dd571b6b390fa089d497d45b76c1ec5bda31
parent 1c6cb69c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@ cc_library_shared {
    static_libs: [
        "android.hardware.camera.common@1.0-helper"
    ],
    include_dirs: [
        "frameworks/native/include/media/openmax"
    ],
    export_include_dirs: ["."]
}
+3 −2
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <log/log.h>
#include <utils/Trace.h>

#include <media/hardware/HardwareAPI.h> // For VideoNativeHandleMetadata
#include "CameraDevice_1_0.h"

namespace android {
@@ -500,7 +501,7 @@ void CameraDevice::sDataCbTimestamp(nsecs_t timestamp, int32_t msg_type,
        if (mem->mBufSize == sizeof(VideoNativeHandleMetadata)) {
            VideoNativeHandleMetadata* md = (VideoNativeHandleMetadata*)
                    ((uint8_t*) mem->mHidlHeapMemData + index * mem->mBufSize);
            if (md->eType == VideoNativeHandleMetadata::kMetadataBufferTypeNativeHandleSource) {
            if (md->eType == kMetadataBufferTypeNativeHandleSource) {
                handle = md->pHandle;
            }
        }
@@ -837,7 +838,7 @@ void CameraDevice::releaseRecordingFrameLocked(
        void *data = ((uint8_t *) camMemory->mHidlHeapMemData) + bufferIndex * camMemory->mBufSize;
        if (handle) {
            VideoNativeHandleMetadata* md = (VideoNativeHandleMetadata*) data;
            if (md->eType == VideoNativeHandleMetadata::kMetadataBufferTypeNativeHandleSource) {
            if (md->eType == kMetadataBufferTypeNativeHandleSource) {
                // Input handle will be closed by HIDL transport later, so clone it
                // HAL implementation is responsible to close/delete the clone
                native_handle_t* clone = native_handle_clone(handle);
+0 −11
Original line number Diff line number Diff line
@@ -133,17 +133,6 @@ private:
    };
    sp<IAllocator> mAshmemAllocator;


    // TODO: b/35625849
    // Meta data buffer layout for passing a native_handle to codec
    // matching frameworks/native/include/media/hardware/MetadataBufferType.h and
    //          frameworks/native/include/media/hardware/HardwareAPI.h
    struct VideoNativeHandleMetadata {
        static const uint32_t kMetadataBufferTypeNativeHandleSource = 3;
        uint32_t eType; // must be kMetadataBufferTypeNativeHandleSource
        native_handle_t* pHandle;
    };

    const sp<CameraModule> mModule;
    const std::string mCameraId;
    // const after ctor