summaryrefslogtreecommitdiffstats
path: root/camera/Encoder_libjpeg.cpp
diff options
context:
space:
mode:
authorEmilian Peev <epeev@mm-sol.com>2012-05-23 18:50:05 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-23 18:50:05 -0700
commit3a2286ed1770865c324655c197bd315adc5d4149 (patch)
tree816400ccfc9632b7de7a35061a0ca5025c9c2a76 /camera/Encoder_libjpeg.cpp
parent5cea9942049630f7a188dc304311c0c51fd887c2 (diff)
parentca48276c03af29e1e7f221f96bd2699cd4fa13c3 (diff)
downloadhardware_ti_omap4xxx-3a2286ed1770865c324655c197bd315adc5d4149.zip
hardware_ti_omap4xxx-3a2286ed1770865c324655c197bd315adc5d4149.tar.gz
hardware_ti_omap4xxx-3a2286ed1770865c324655c197bd315adc5d4149.tar.bz2
am ca48276c: am c78626b1: CameraHal: Avoids possible race conditions while accessing \'mParams\'
* commit 'ca48276c03af29e1e7f221f96bd2699cd4fa13c3': CameraHal: Avoids possible race conditions while accessing 'mParams'
Diffstat (limited to 'camera/Encoder_libjpeg.cpp')
-rw-r--r--camera/Encoder_libjpeg.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/camera/Encoder_libjpeg.cpp b/camera/Encoder_libjpeg.cpp
index d50b2ea..c7da115 100644
--- a/camera/Encoder_libjpeg.cpp
+++ b/camera/Encoder_libjpeg.cpp
@@ -47,17 +47,17 @@ extern "C" {
#define MIN(x,y) ((x < y) ? x : y)
namespace android {
-struct string_pair {
- const char* string1;
- const char* string2;
+struct integer_string_pair {
+ unsigned int integer;
+ const char* string;
};
-static string_pair degress_to_exif_lut [] = {
+static integer_string_pair degress_to_exif_lut [] = {
// degrees, exif_orientation
- {"0", "1"},
- {"90", "6"},
- {"180", "3"},
- {"270", "8"},
+ {0, "1"},
+ {90, "6"},
+ {180, "3"},
+ {270, "8"},
};
struct libjpeg_destination_mgr : jpeg_destination_mgr {
libjpeg_destination_mgr(uint8_t* input, int size);
@@ -200,10 +200,10 @@ static void resize_nv12(Encoder_libjpeg::params* params, uint8_t* dst_buffer) {
}
/* public static functions */
-const char* ExifElementsTable::degreesToExifOrientation(const char* degrees) {
+const char* ExifElementsTable::degreesToExifOrientation(unsigned int degrees) {
for (unsigned int i = 0; i < ARRAY_SIZE(degress_to_exif_lut); i++) {
- if (!strcmp(degrees, degress_to_exif_lut[i].string1)) {
- return degress_to_exif_lut[i].string2;
+ if (degrees == degress_to_exif_lut[i].integer) {
+ return degress_to_exif_lut[i].string;
}
}
return NULL;