summaryrefslogtreecommitdiff
authorguosong.zhou <guosong.zhou@amlogic.com>2014-11-13 08:40:52 (GMT)
committer guosong.zhou <guosong.zhou@amlogic.com>2014-11-13 08:40:52 (GMT)
commit4f50ff32090a28d577ad8e0bf1ddd4b1fa147f70 (patch)
treef6d7b07a8b2eac7f0d6473cca7ef1d19b3cd8b6d
parent756d18a042646cd7a5c991fe46e100d3aa369766 (diff)
downloadcamera-4f50ff32090a28d577ad8e0bf1ddd4b1fa147f70.zip
camera-4f50ff32090a28d577ad8e0bf1ddd4b1fa147f70.tar.gz
camera-4f50ff32090a28d577ad8e0bf1ddd4b1fa147f70.tar.bz2
resolve testJpegExif case of StillCaptureTest for cts
Diffstat
-rwxr-xr-xv3/fake-pipeline2/JpegCompressor.cpp17
-rwxr-xr-xv3/fake-pipeline2/JpegCompressor.h2
2 files changed, 12 insertions, 7 deletions
diff --git a/v3/fake-pipeline2/JpegCompressor.cpp b/v3/fake-pipeline2/JpegCompressor.cpp
index 488bb5f..652ff54 100755
--- a/v3/fake-pipeline2/JpegCompressor.cpp
+++ b/v3/fake-pipeline2/JpegCompressor.cpp
@@ -74,7 +74,8 @@ JpegCompressor::JpegCompressor():
Thread(false),
mIsBusy(false),
mSynchronous(false),
- mNeedexif(false),
+ mNeedexif(true),
+ mNeedThumbnail(false),
mMainJpegSize(0),
mThumbJpegSize(0),
mSrcThumbBuffer(NULL),
@@ -166,15 +167,19 @@ bool JpegCompressor::threadLoop() {
memset(&blob,0,sizeof(struct camera2_jpeg_blob));
exiftable = new ExifElementsTable();
GenExif(exiftable);
+ }
+ if (mNeedThumbnail) {
res = thumbcompress();
}
- if ((exiftable)&&(mDstThumbBuffer != NULL)) {
+ if (exiftable) {
uint32_t realjpegsize = 0;
Section_t* exif_section = NULL;
ExifElementsTable* exif = exiftable;
exif->insertExifToJpeg((unsigned char*)mJpegBuffer.img,mMainJpegSize);
+ if ((mNeedThumbnail)&&(mDstThumbBuffer != NULL)) {
exif->insertExifThumbnailImage((const char*)mDstThumbBuffer,mThumbJpegSize);
+ }
exif_section = FindSection(M_EXIF);
if (exif_section) {
exif->saveJpeg((unsigned char*) mJpegBuffer.img, mMainJpegSize + exif_section->Size);
@@ -228,7 +233,7 @@ status_t JpegCompressor::compress() {
return BAD_VALUE;
}
- if (mNeedexif == true) {
+ if (mNeedThumbnail == true) {
if (mSrcThumbBuffer == NULL) {
mSrcThumbBuffer = (uint8_t*)malloc(mInfo.thumbwidth*mInfo.thumbheight*3);
}
@@ -397,8 +402,8 @@ void JpegCompressor::cleanUp() {
status_t res;
jpeg_destroy_compress(&mCInfo);
Mutex::Autolock lock(mBusyMutex);
- if (mNeedexif == true) {
- mNeedexif = false;
+ if (mNeedThumbnail == true) {
+ mNeedThumbnail = false;
if (mSrcThumbBuffer != NULL) {
free(mSrcThumbBuffer);
mSrcThumbBuffer = NULL;
@@ -500,7 +505,7 @@ void JpegCompressor::SetExifInfo(struct ExifInfo info)
mInfo.has_gpsTimestamp = info.has_gpsTimestamp;
mInfo.has_focallen = info.has_focallen;
if ((mInfo.thumbwidth>0)&&(mInfo.thumbheight>0)) {
- mNeedexif = true;
+ mNeedThumbnail = true;
}
}
int JpegCompressor::GenExif(ExifElementsTable* exiftable)
diff --git a/v3/fake-pipeline2/JpegCompressor.h b/v3/fake-pipeline2/JpegCompressor.h
index 8b19fec..0a57f04 100755
--- a/v3/fake-pipeline2/JpegCompressor.h
+++ b/v3/fake-pipeline2/JpegCompressor.h
@@ -143,7 +143,7 @@ class JpegCompressor: private Thread, public virtual RefBase {
bool mFoundJpeg, mFoundAux;
bool mNeedexif;
-
+ bool mNeedThumbnail;
int mMainJpegSize, mThumbJpegSize;