author | guosong.zhou <guosong.zhou@amlogic.com> | 2014-12-01 06:58:14 (GMT) |
---|---|---|
committer | guosong.zhou <guosong.zhou@amlogic.com> | 2014-12-01 06:58:14 (GMT) |
commit | 59886baa71c3c1a620d4bca6f03c7620d414d172 (patch) | |
tree | fd7cab8998f6be54d49054ba79e28d19ee8ca1d4 | |
parent | 4eea29c30bd122628397d0ea6a97b0cc874d7361 (diff) | |
download | camera-59886baa71c3c1a620d4bca6f03c7620d414d172.zip camera-59886baa71c3c1a620d4bca6f03c7620d414d172.tar.gz camera-59886baa71c3c1a620d4bca6f03c7620d414d172.tar.bz2 |
auto get exif maker and model,modify some code
Change-Id: I14efb103ae50aa964efde6efd65f6057fb62197d
-rwxr-xr-x | v3/fake-pipeline2/JpegCompressor.cpp | 16 | ||||
-rwxr-xr-x | v3/fake-pipeline2/Sensor.cpp | 9 |
2 files changed, 18 insertions, 7 deletions
diff --git a/v3/fake-pipeline2/JpegCompressor.cpp b/v3/fake-pipeline2/JpegCompressor.cpp index 652ff54..9629070 100755 --- a/v3/fake-pipeline2/JpegCompressor.cpp +++ b/v3/fake-pipeline2/JpegCompressor.cpp @@ -15,7 +15,7 @@ */ //#define LOG_NDEBUG 0 -#define LOG_TAG "EmulatedCamera2_JpegCompressor" +#define LOG_TAG "EmulatedCamera3_JpegCompressor" #include <utils/Log.h> #include <ui/GraphicBufferMapper.h> @@ -26,8 +26,13 @@ #include <stdlib.h> #include <math.h> #include <sys/time.h> +#include <cutils/properties.h> + +#define EXIF_MAKE_DEFAULT "default_make" +#define EXIF_MODEL_DEFAULT "default_model" #define ARRAY_SIZE(array) (sizeof((array)) / sizeof((array)[0])) + const size_t MARKER_LENGTH = 2; // length of a marker const uint8_t MARK = 0xFF; const uint8_t EOI = 0xD9; @@ -522,9 +527,12 @@ int JpegCompressor::GenExif(ExifElementsTable* exiftable) char SubSecTime[10] = "63"; char SubSecTimeOrig[10]= "63"; char SubSecTimeDig[10]= "63"; - - exiftable->insertElement("Make","m102"); - exiftable->insertElement("Model","m102"); + char property[PROPERTY_VALUE_MAX]; + + property_get("ro.product.manufacturer", property, EXIF_MAKE_DEFAULT); + exiftable->insertElement("Make",property); + property_get("ro.product.model", property, EXIF_MODEL_DEFAULT); + exiftable->insertElement("Model",property); // int orientation = mInfo.orientation; width = mInfo.mainwidth; height = mInfo.mainheight; diff --git a/v3/fake-pipeline2/Sensor.cpp b/v3/fake-pipeline2/Sensor.cpp index 3c37494..cd2bce7 100755 --- a/v3/fake-pipeline2/Sensor.cpp +++ b/v3/fake-pipeline2/Sensor.cpp @@ -16,7 +16,7 @@ //#define LOG_NDEBUG 0 //#define LOG_NNDEBUG 0 -#define LOG_TAG "EmulatedCamera2_Sensor" +#define LOG_TAG "EmulatedCamera3_Sensor" #ifdef LOG_NNDEBUG #define ALOGVV(...) ALOGV(__VA_ARGS__) @@ -1004,7 +1004,7 @@ int Sensor::captureNewImageWithGe2d() { } int Sensor::captureNewImage() { - + bool isjpeg = false; uint32_t gain = mGainFactor; mKernelBuffer = NULL; @@ -1029,6 +1029,7 @@ int Sensor::captureNewImage() { // Add auxillary buffer of the right size // Assumes only one BLOB (JPEG) buffer in // mNextCapturedBuffers + isjpeg = true; StreamBuffer bAux; int orientation; orientation = getPictureRotate(); @@ -1067,7 +1068,9 @@ int Sensor::captureNewImage() { break; } } - putback_frame(vinfo); + if(!isjpeg) { + putback_frame(vinfo); + } mKernelBuffer = NULL; return 0; |