Loading camera/device/3.4/default/ExternalCameraDevice.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -378,8 +378,12 @@ status_t ExternalCameraDevice::initDefaultCharsKeys( const uint8_t timestampSource = ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN; UPDATE(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE, ×tampSource, 1); // Orientation probably isn't useful for external facing camera? const int32_t orientation = 0; // Orientation is a bit odd for external camera, but consider it as the orientation // between the external camera sensor (which is usually landscape) and the device's // natural display orientation. For devices with natural landscape display (ex: tablet/TV), the // orientation should be 0. For devices with natural portrait display (phone), the orientation // should be 270. const int32_t orientation = mCfg.orientation; UPDATE(ANDROID_SENSOR_ORIENTATION, &orientation, 1); // android.shading Loading camera/device/3.4/default/ExternalCameraUtils.cpp +16 −6 Original line number Diff line number Diff line Loading @@ -163,6 +163,8 @@ namespace { const int kDefaultJpegBufSize = 5 << 20; // 5MB const int kDefaultNumVideoBuffer = 4; const int kDefaultNumStillBuffer = 2; const int kDefaultOrientation = 0; // suitable for natural landscape displays like tablet/TV // For phone devices 270 is better } // anonymous namespace const char* ExternalCameraConfig::kDefaultCfgPath = "/vendor/etc/external_camera_config.xml"; Loading Loading @@ -276,10 +278,17 @@ ExternalCameraConfig ExternalCameraConfig::loadFromCfg(const char* cfgPath) { minStreamSize->UnsignedAttribute("height", /*Default*/0)}; } XMLElement *orientation = deviceCfg->FirstChildElement("Orientation"); if (orientation == nullptr) { ALOGI("%s: no sensor orientation specified", __FUNCTION__); } else { ret.orientation = orientation->IntAttribute("degree", /*Default*/kDefaultOrientation); } ALOGI("%s: external camera cfg loaded: maxJpgBufSize %d," " num video buffers %d, num still buffers %d", " num video buffers %d, num still buffers %d, orientation %d", __FUNCTION__, ret.maxJpegBufSize, ret.numVideoBuffers, ret.numStillBuffers); ret.numVideoBuffers, ret.numStillBuffers, ret.orientation); for (const auto& limit : ret.fpsLimits) { ALOGI("%s: fpsLimitList: %dx%d@%f", __FUNCTION__, limit.size.width, limit.size.height, limit.fpsUpperBound); Loading @@ -292,7 +301,8 @@ ExternalCameraConfig ExternalCameraConfig::loadFromCfg(const char* cfgPath) { ExternalCameraConfig::ExternalCameraConfig() : maxJpegBufSize(kDefaultJpegBufSize), numVideoBuffers(kDefaultNumVideoBuffer), numStillBuffers(kDefaultNumStillBuffer) { numStillBuffers(kDefaultNumStillBuffer), orientation(kDefaultOrientation) { fpsLimits.push_back({/*Size*/{ 640, 480}, /*FPS upper bound*/30.0}); fpsLimits.push_back({/*Size*/{1280, 720}, /*FPS upper bound*/7.5}); fpsLimits.push_back({/*Size*/{1920, 1080}, /*FPS upper bound*/5.0}); Loading camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraUtils.h +3 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ struct ExternalCameraConfig { // Minimum output stream size Size minStreamSize; // The value of android.sensor.orientation int32_t orientation; private: ExternalCameraConfig(); }; Loading Loading
camera/device/3.4/default/ExternalCameraDevice.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -378,8 +378,12 @@ status_t ExternalCameraDevice::initDefaultCharsKeys( const uint8_t timestampSource = ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN; UPDATE(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE, ×tampSource, 1); // Orientation probably isn't useful for external facing camera? const int32_t orientation = 0; // Orientation is a bit odd for external camera, but consider it as the orientation // between the external camera sensor (which is usually landscape) and the device's // natural display orientation. For devices with natural landscape display (ex: tablet/TV), the // orientation should be 0. For devices with natural portrait display (phone), the orientation // should be 270. const int32_t orientation = mCfg.orientation; UPDATE(ANDROID_SENSOR_ORIENTATION, &orientation, 1); // android.shading Loading
camera/device/3.4/default/ExternalCameraUtils.cpp +16 −6 Original line number Diff line number Diff line Loading @@ -163,6 +163,8 @@ namespace { const int kDefaultJpegBufSize = 5 << 20; // 5MB const int kDefaultNumVideoBuffer = 4; const int kDefaultNumStillBuffer = 2; const int kDefaultOrientation = 0; // suitable for natural landscape displays like tablet/TV // For phone devices 270 is better } // anonymous namespace const char* ExternalCameraConfig::kDefaultCfgPath = "/vendor/etc/external_camera_config.xml"; Loading Loading @@ -276,10 +278,17 @@ ExternalCameraConfig ExternalCameraConfig::loadFromCfg(const char* cfgPath) { minStreamSize->UnsignedAttribute("height", /*Default*/0)}; } XMLElement *orientation = deviceCfg->FirstChildElement("Orientation"); if (orientation == nullptr) { ALOGI("%s: no sensor orientation specified", __FUNCTION__); } else { ret.orientation = orientation->IntAttribute("degree", /*Default*/kDefaultOrientation); } ALOGI("%s: external camera cfg loaded: maxJpgBufSize %d," " num video buffers %d, num still buffers %d", " num video buffers %d, num still buffers %d, orientation %d", __FUNCTION__, ret.maxJpegBufSize, ret.numVideoBuffers, ret.numStillBuffers); ret.numVideoBuffers, ret.numStillBuffers, ret.orientation); for (const auto& limit : ret.fpsLimits) { ALOGI("%s: fpsLimitList: %dx%d@%f", __FUNCTION__, limit.size.width, limit.size.height, limit.fpsUpperBound); Loading @@ -292,7 +301,8 @@ ExternalCameraConfig ExternalCameraConfig::loadFromCfg(const char* cfgPath) { ExternalCameraConfig::ExternalCameraConfig() : maxJpegBufSize(kDefaultJpegBufSize), numVideoBuffers(kDefaultNumVideoBuffer), numStillBuffers(kDefaultNumStillBuffer) { numStillBuffers(kDefaultNumStillBuffer), orientation(kDefaultOrientation) { fpsLimits.push_back({/*Size*/{ 640, 480}, /*FPS upper bound*/30.0}); fpsLimits.push_back({/*Size*/{1280, 720}, /*FPS upper bound*/7.5}); fpsLimits.push_back({/*Size*/{1920, 1080}, /*FPS upper bound*/5.0}); Loading
camera/device/3.4/default/include/ext_device_v3_4_impl/ExternalCameraUtils.h +3 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,9 @@ struct ExternalCameraConfig { // Minimum output stream size Size minStreamSize; // The value of android.sensor.orientation int32_t orientation; private: ExternalCameraConfig(); }; Loading