diff options
| author | Ajay Dudani <adudani@codeaurora.org> | 2013-08-23 17:02:25 -0700 |
|---|---|---|
| committer | Ali B <abittin@gmail.com> | 2018-06-17 19:16:29 +0300 |
| commit | 3fc6a94b6a9858d1369795de6eea378ee1bc8fa7 (patch) | |
| tree | b6113eaf417e7e24e2917aaee5a332253b2b5200 | |
| parent | d163167ef9a2bd0f4eb621516a171f4be8bb8610 (diff) | |
Camera3: Fix thumbnail stretch issue
If image is already rotated by post proc, swap the thumbnail
destination buffer width and height before giving it to the
encoder
Change-Id: I328a762887b469fc88d298c131cde356dc2dd03f
(cherry picked from commit ab93af6714041141d8a66e6e2c921097e1341a08)
| -rwxr-xr-x | camera/QCamera2/HAL3/QCamera3PostProc.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/camera/QCamera2/HAL3/QCamera3PostProc.cpp b/camera/QCamera2/HAL3/QCamera3PostProc.cpp index 0ee075f..a69257d 100755 --- a/camera/QCamera2/HAL3/QCamera3PostProc.cpp +++ b/camera/QCamera2/HAL3/QCamera3PostProc.cpp @@ -920,18 +920,22 @@ int32_t QCamera3PostProcessor::encodeData(qcamera_jpeg_data_t *jpeg_job_data, memset(&crop, 0, sizeof(cam_rect_t)); //TBD_later - Zoom event removed in stream //thumb_stream->getCropInfo(crop); - memset(&src_dim, 0, sizeof(cam_dimension_t)); - thumb_stream->getFrameDimension(src_dim); - jpg_job.encode_job.thumb_dim.src_dim = src_dim; m_parent->getThumbnailSize(jpg_job.encode_job.thumb_dim.dst_dim); + if (!hal_obj->needRotationReprocess()) { + memset(&src_dim, 0, sizeof(cam_dimension_t)); + thumb_stream->getFrameDimension(src_dim); + jpg_job.encode_job.rotation = m_parent->getJpegRotation(); + ALOGD("%s: jpeg rotation is set to %d", __func__, jpg_job.encode_job.rotation); + } else { + //swap the thumbnail destination width and height if it has already been rotated + int temp = jpg_job.encode_job.thumb_dim.dst_dim.width; + jpg_job.encode_job.thumb_dim.dst_dim.width = jpg_job.encode_job.thumb_dim.dst_dim.height; + jpg_job.encode_job.thumb_dim.dst_dim.height = temp; + } + jpg_job.encode_job.thumb_dim.src_dim = src_dim; jpg_job.encode_job.thumb_dim.crop = crop; jpg_job.encode_job.thumb_index = thumb_frame->buf_idx; } - if (!hal_obj->needRotationReprocess()) { - jpg_job.encode_job.rotation = m_parent->getJpegRotation(); - ALOGD("%s: jpeg rotation is set to %d", __func__, jpg_job.encode_job.rotation); - } - // Find meta data frame. Meta data frame contains additional exif info // which will be extracted and filled in by encoder. //Note: In this version meta data will be null |
