From 87423e5686296b1938959ff8bf9817490ddee2f1 Mon Sep 17 00:00:00 2001 From: Hyeonmyeong Choi Date: Thu, 4 Oct 2012 16:34:55 +0900 Subject: [PATCH] hardware: samsung_slsi: libcamera2: Support JPEG quality This patch support JPEG quality and thumbnail quality. The default values of JPEG and thumbnail quality are 100. Change-Id: I4dc1f21b5b36cb21b3500646817378a0d91e49d6 Signed-off-by: Hyeonmyeong Choi --- libcamera2/ExynosCamera2.cpp | 4 ++-- libcamera2/ExynosCameraHWInterface2.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libcamera2/ExynosCamera2.cpp b/libcamera2/ExynosCamera2.cpp index 68d9702..9c8d887 100644 --- a/libcamera2/ExynosCamera2.cpp +++ b/libcamera2/ExynosCamera2.cpp @@ -851,7 +851,7 @@ status_t ExynosCamera2::constructDefaultRequest( ADD_OR_SIZE(ANDROID_SCALER_CROP_REGION, cropRegion, 3); /** android.jpeg */ - static const int32_t jpegQuality = 80; + static const int32_t jpegQuality = 100; ADD_OR_SIZE(ANDROID_JPEG_QUALITY, &jpegQuality, 1); static const int32_t thumbnailSize[2] = { @@ -859,7 +859,7 @@ status_t ExynosCamera2::constructDefaultRequest( }; ADD_OR_SIZE(ANDROID_JPEG_THUMBNAIL_SIZE, thumbnailSize, 2); - static const int32_t thumbnailQuality = 80; + static const int32_t thumbnailQuality = 100; ADD_OR_SIZE(ANDROID_JPEG_THUMBNAIL_QUALITY, &thumbnailQuality, 1); static const double gpsCoordinates[3] = { diff --git a/libcamera2/ExynosCameraHWInterface2.cpp b/libcamera2/ExynosCameraHWInterface2.cpp index 2a74037..1f70ef4 100644 --- a/libcamera2/ExynosCameraHWInterface2.cpp +++ b/libcamera2/ExynosCameraHWInterface2.cpp @@ -4652,7 +4652,7 @@ bool ExynosCameraHWInterface2::yuv2Jpeg(ExynosBuffer *yuvBuf, goto jpeg_encode_done; } - if (jpegEnc.setQuality(100)) { + if (jpegEnc.setQuality(m_jpegMetadata.shot.ctl.jpeg.quality)) { ALOGE("ERR(%s):jpegEnc.setQuality() fail", __FUNCTION__); goto jpeg_encode_done; } @@ -4695,7 +4695,7 @@ bool ExynosCameraHWInterface2::yuv2Jpeg(ExynosBuffer *yuvBuf, } ALOGV("(%s):jpegEnc.setThumbnailSize(%d, %d) ", __FUNCTION__, m_thumbNailW, m_thumbNailW); - if (jpegEnc.setThumbnailQuality(50)) { + if (jpegEnc.setThumbnailQuality(m_jpegMetadata.shot.ctl.jpeg.thumbnailQuality)) { ALOGE("ERR(%s):jpegEnc.setThumbnailQuality fail", __FUNCTION__); goto jpeg_encode_done; } -- 2.20.1