summaryrefslogtreecommitdiff
path: root/devices
diff options
context:
space:
mode:
authorJayant Chowdhary <jchowdhary@google.com>2022-05-12 04:16:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-05-12 04:16:57 +0000
commit899d1c699ba15cf160c0b1d42948edd50c90c7ae (patch)
tree73d9891752ad3e3c5833665f76c89db9fe561143 /devices
parente3c3ea15410ff9b403129d42826453542525ef10 (diff)
parent4593bfbd28b9f9b735d16d618290451067ad9ffe (diff)
downloadcamera-899d1c699ba15cf160c0b1d42948edd50c90c7ae.tar.gz
Merge "Make CameraBlob consistent with AIDL definition." into tm-dev
Diffstat (limited to 'devices')
-rw-r--r--devices/EmulatedCamera/hwl/JpegCompressor.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/devices/EmulatedCamera/hwl/JpegCompressor.cpp b/devices/EmulatedCamera/hwl/JpegCompressor.cpp
index c1ae8ea..582c92f 100644
--- a/devices/EmulatedCamera/hwl/JpegCompressor.cpp
+++ b/devices/EmulatedCamera/hwl/JpegCompressor.cpp
@@ -19,14 +19,16 @@
#include "JpegCompressor.h"
+#include <camera_blob.h>
#include <cutils/properties.h>
-#include <hardware/camera3.h>
#include <libyuv.h>
#include <utils/Log.h>
#include <utils/Trace.h>
namespace android {
+using google_camera_hal::CameraBlob;
+using google_camera_hal::CameraBlobId;
using google_camera_hal::ErrorCode;
using google_camera_hal::MessageType;
using google_camera_hal::NotifyMessage;
@@ -204,13 +206,12 @@ void JpegCompressor::CompressYUV420(std::unique_ptr<JpegYUV420Job> job) {
}
auto jpeg_header_offset =
- job->output->plane.img.buffer_size - sizeof(struct camera3_jpeg_blob);
+ job->output->plane.img.buffer_size - sizeof(struct CameraBlob);
if (jpeg_header_offset > encoded_size) {
- struct camera3_jpeg_blob* blob =
- reinterpret_cast<struct camera3_jpeg_blob*>(job->output->plane.img.img +
- jpeg_header_offset);
- blob->jpeg_blob_id = CAMERA3_JPEG_BLOB_ID;
- blob->jpeg_size = encoded_size;
+ struct CameraBlob* blob = reinterpret_cast<struct CameraBlob*>(
+ job->output->plane.img.img + jpeg_header_offset);
+ blob->blob_id = CameraBlobId::JPEG;
+ blob->blob_size = encoded_size;
} else {
ALOGW("%s: No space for jpeg header at offset: %u and jpeg size: %u",
__FUNCTION__, static_cast<unsigned>(jpeg_header_offset),