From 2ce6bded0130616eeb61ea279f452969d31f74a5 Mon Sep 17 00:00:00 2001 From: Guosong Zhou Date: Tue, 04 Aug 2015 10:22:48 +0000 Subject: PD#107824:fix camera capture crash Change-Id: Ideeca59fa0cafe214d7566fd634890904147a689 --- diff --git a/v3/fake-pipeline2/JpegCompressor.cpp b/v3/fake-pipeline2/JpegCompressor.cpp index 35730b8..cae9f0d 100755..100644 --- a/v3/fake-pipeline2/JpegCompressor.cpp +++ b/v3/fake-pipeline2/JpegCompressor.cpp @@ -685,7 +685,7 @@ status_t JpegCompressor::compress() { enc_params.src = mAuxBuffer.img; enc_params.src_size = calc_frame_length(mAuxBuffer.format, mAuxBuffer.width, mAuxBuffer.height); enc_params.dst = mJpegBuffer.img; - enc_params.dst_size = kMaxJpegSize; + enc_params.dst_size = mMaxbufsize; enc_params.quality = 80; enc_params.in_width = mAuxBuffer.width; enc_params.in_height = mAuxBuffer.height; @@ -707,7 +707,7 @@ status_t JpegCompressor::thumbcompress() { params enc_params; enc_params.src = mSrcThumbBuffer; enc_params.dst = mDstThumbBuffer; - enc_params.dst_size = kMaxJpegSize; + enc_params.dst_size = mInfo.thumbwidth * mInfo.thumbheight * 3; enc_params.quality = 70; enc_params.src_size = calc_frame_length(mAuxBuffer.format, mAuxBuffer.width, mAuxBuffer.height); enc_params.in_width = mAuxBuffer.width; diff --git a/v3/fake-pipeline2/JpegCompressor.h b/v3/fake-pipeline2/JpegCompressor.h index affac67..5c61aca 100755..100644 --- a/v3/fake-pipeline2/JpegCompressor.h +++ b/v3/fake-pipeline2/JpegCompressor.h @@ -133,7 +133,7 @@ class JpegCompressor: private Thread, public virtual RefBase { int GenExif(ExifElementsTable* exiftable); // TODO: Measure this - static const size_t kMaxJpegSize = 300000; + static const size_t kMaxJpegSize = 8000000; ssize_t mMaxbufsize; private: -- cgit