summaryrefslogtreecommitdiffstats
path: root/camera/Encoder_libjpeg.cpp
diff options
context:
space:
mode:
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;