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

Commit 4cea813a authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Android (Google) Code Review
Browse files

Merge "camera: Map between legacy gralloc0 usage, and HIDL gralloc1 usages" into oc-dev

parents f23752f8 2d80c0d6
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package android.hardware.camera.device@1.0;

import android.hardware.camera.common@1.0::types;
import android.hardware.graphics.allocator@2.0::types;
import android.hardware.graphics.common@1.0::types;

/**
@@ -89,7 +88,7 @@ interface ICameraDevicePreviewCallback {
     *
     * @return Status The status code for this operation.
     */
    setUsage(ProducerUsage usage) generates (Status status);
    setUsage(ProducerUsageFlags usage) generates (Status status);

    /**
     * Set the expected buffering mode for the preview output.
+2 −2
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@ cc_library_shared {
        "libbinder",
    ],
    static_libs: [
        "android.hardware.camera.common@1.0-helper"
        "android.hardware.camera.common@1.0-helper",
        "libgrallocusage"
    ],
    export_include_dirs: ["."]
}
+6 −2
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
#include <hardware/gralloc1.h>
#include <utils/Trace.h>

#include <grallocusage/GrallocUsageConversion.h>

#include "CameraDevice_1_0.h"

namespace android {
@@ -29,7 +31,6 @@ namespace device {
namespace V1_0 {
namespace implementation {

using ::android::hardware::graphics::allocator::V2_0::ProducerUsage;
using ::android::hardware::graphics::common::V1_0::PixelFormat;

HandleImporter& CameraDevice::sHandleImporter = HandleImporter::getInstance();
@@ -252,7 +253,10 @@ int CameraDevice::sSetUsage(struct preview_stream_ops* w, int usage) {
    }

    object->cleanUpCirculatingBuffers();
    return getStatusT(object->mPreviewCallback->setUsage((ProducerUsage) usage));
    ProducerUsageFlags producerUsage;
    uint64_t consumerUsage;
    ::android_convertGralloc0To1Usage(usage, &producerUsage, &consumerUsage);
    return getStatusT(object->mPreviewCallback->setUsage(producerUsage));
}

int CameraDevice::sSetSwapInterval(struct preview_stream_ops *w, int interval) {
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@

package android.hardware.camera.device@1.0;

import android.hardware.graphics.allocator@2.0::types;

typedef bitfield<ProducerUsage> ProducerUsageFlags;

enum CameraFacing : uint32_t {
    /** The facing of the camera is opposite to that of the screen. */
    BACK = 0,
+2 −1
Original line number Diff line number Diff line
@@ -17,7 +17,8 @@ cc_library_shared {
        "libcamera_metadata"
    ],
    static_libs: [
        "android.hardware.camera.common@1.0-helper"
        "android.hardware.camera.common@1.0-helper",
        "libgrallocusage"
    ],
    export_include_dirs: ["."]
}
Loading