liyujie
2025-08-28 867b8b7b729282c7e14e200ca277435329ebe747
android/hardware/interfaces/camera/device/3.4/default/ExternalCameraUtils.cpp
old mode 100755new mode 100644
....@@ -164,6 +164,7 @@
164164 const int kDefaultNumStillBuffer = 2;
165165 const int kDefaultOrientation = 0; // suitable for natural landscape displays like tablet/TV
166166 // For phone devices 270 is better
167
+ const int kDefaultJpegOrientation = 0;
167168 } // anonymous namespace
168169
169170 const char* ExternalCameraConfig::kDefaultCfgPath = "/vendor/etc/external_camera_config.xml";
....@@ -284,10 +285,19 @@
284285 ret.orientation = orientation->IntAttribute("degree", /*Default*/kDefaultOrientation);
285286 }
286287
288
+ XMLElement *jpegOrientation = deviceCfg->FirstChildElement("JpegOrientation");
289
+ if (jpegOrientation == nullptr) {
290
+ ALOGI("%s: no jpeg orientation specified", __FUNCTION__);
291
+ } else {
292
+ ret.jpegOrientation = jpegOrientation->IntAttribute("degree",
293
+ /*Default*/kDefaultJpegOrientation);
294
+ }
295
+
287296 ALOGI("%s: external camera cfg loaded: maxJpgBufSize %d,"
288
- " num video buffers %d, num still buffers %d, orientation %d",
297
+ " num video buffers %d, num still buffers %d, orientation %d jpeg orientation %d",
289298 __FUNCTION__, ret.maxJpegBufSize,
290
- ret.numVideoBuffers, ret.numStillBuffers, ret.orientation);
299
+ ret.numVideoBuffers, ret.numStillBuffers,
300
+ ret.orientation, ret.jpegOrientation);
291301 for (const auto& limit : ret.fpsLimits) {
292302 ALOGI("%s: fpsLimitList: %dx%d@%f", __FUNCTION__,
293303 limit.size.width, limit.size.height, limit.fpsUpperBound);