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

Commit 9a238f6c authored by malikakash's avatar malikakash
Browse files

Fix VendorTagId to be metadata_vendor_id_t

- It is currently int. This was causing downstream issues
  because the CameraMetadata object passed to
  configureStreams had the wrong vendor_id, so we couldn't
  call update() on it with vendor tags.
- As a drive by, specify getVendorId() as being const.
  Without this, we need to keep copying const CameraMetadata
  objects to simply get their vendor id.

Thanks epeev@ for all your pointers along the debugging
journey!

Bug: 316413287
Test: m
Change-Id: I32bf9bcb7137990d28b9fcbe1b27bc41ebbd50ee
parent 8d7480e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -880,7 +880,7 @@ status_t CameraMetadata::getTagFromName(const char *name,
    return OK;
}

metadata_vendor_id_t CameraMetadata::getVendorId() {
metadata_vendor_id_t CameraMetadata::getVendorId() const {
    return get_camera_metadata_vendor_id(mBuffer);
}

+1 −1
Original line number Diff line number Diff line
@@ -245,7 +245,7 @@ class CameraMetadata: public Parcelable {
    /**
     * Return the current vendor tag id associated with this metadata.
     */
    metadata_vendor_id_t getVendorId();
    metadata_vendor_id_t getVendorId() const;

  private:
    camera_metadata_t *mBuffer;
+1 −1
Original line number Diff line number Diff line
@@ -1133,7 +1133,7 @@ status_t mapRequestTemplateToAidl(camera_request_template_t templateId,
}

void filterParameters(const CameraMetadata& src, const CameraMetadata& deviceInfo,
        int vendorTagId, CameraMetadata& dst) {
        metadata_vendor_id_t vendorTagId, CameraMetadata& dst) {
    const CameraMetadata params(src);
    camera_metadata_ro_entry_t availableSessionKeys = deviceInfo.find(
            ANDROID_REQUEST_AVAILABLE_SESSION_KEYS);
+1 −1
Original line number Diff line number Diff line
@@ -177,7 +177,7 @@ status_t mapRequestTemplateToAidl(camera_request_template_t templateId,
        aidl::android::hardware::camera::device::RequestTemplate* tempId /*out*/);

void filterParameters(const CameraMetadata& src, const CameraMetadata& deviceInfo,
        int vendorTagId, CameraMetadata& dst);
        metadata_vendor_id_t vendorTagId, CameraMetadata& dst);

constexpr int32_t MAX_SURFACES_PER_STREAM = 4;