diff options
Diffstat (limited to 'chromium/media/capture/video/chromeos/camera_hal_dispatcher_impl.cc')
-rw-r--r-- | chromium/media/capture/video/chromeos/camera_hal_dispatcher_impl.cc | 66 |
1 files changed, 48 insertions, 18 deletions
diff --git a/chromium/media/capture/video/chromeos/camera_hal_dispatcher_impl.cc b/chromium/media/capture/video/chromeos/camera_hal_dispatcher_impl.cc index 5825b3a1a7e..07ade5dbc04 100644 --- a/chromium/media/capture/video/chromeos/camera_hal_dispatcher_impl.cc +++ b/chromium/media/capture/video/chromeos/camera_hal_dispatcher_impl.cc @@ -49,6 +49,10 @@ const base::FilePath::CharType kForceEnableAePath[] = "/run/camera/force_enable_face_ae"; const base::FilePath::CharType kForceDisableAePath[] = "/run/camera/force_disable_face_ae"; +const base::FilePath::CharType kForceEnableHdrNetPath[] = + "/run/camera/force_enable_hdrnet"; +const base::FilePath::CharType kForceDisableHdrNetPath[] = + "/run/camera/force_disable_hdrnet"; std::string GenerateRandomToken() { char random_bytes[16]; @@ -174,24 +178,50 @@ bool CameraHalDispatcherImpl::Start( TRACE_EVENT0("camera", "CameraHalDispatcherImpl"); base::trace_event::TraceLog::GetInstance()->AddEnabledStateObserver(this); - base::FilePath enable_file_path(kForceEnableAePath); - base::FilePath disable_file_path(kForceDisableAePath); - if (!base::DeleteFile(enable_file_path)) { - LOG(WARNING) << "Could not delete " << kForceEnableAePath; - } - if (!base::DeleteFile(disable_file_path)) { - LOG(WARNING) << "Could not delete " << kForceDisableAePath; - } - const base::CommandLine* command_line = - base::CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(media::switches::kForceControlFaceAe)) { - if (command_line->GetSwitchValueASCII( - media::switches::kForceControlFaceAe) == "enable") { - base::File file(enable_file_path, base::File::FLAG_CREATE_ALWAYS); - file.Close(); - } else { - base::File file(disable_file_path, base::File::FLAG_CREATE_ALWAYS); - file.Close(); + { + base::FilePath enable_file_path(kForceEnableAePath); + base::FilePath disable_file_path(kForceDisableAePath); + if (!base::DeleteFile(enable_file_path)) { + LOG(WARNING) << "Could not delete " << kForceEnableAePath; + } + if (!base::DeleteFile(disable_file_path)) { + LOG(WARNING) << "Could not delete " << kForceDisableAePath; + } + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch(media::switches::kForceControlFaceAe)) { + if (command_line->GetSwitchValueASCII( + media::switches::kForceControlFaceAe) == "enable") { + base::File file(enable_file_path, base::File::FLAG_CREATE_ALWAYS); + file.Close(); + } else { + base::File file(disable_file_path, base::File::FLAG_CREATE_ALWAYS); + file.Close(); + } + } + } + + { + base::FilePath enable_file_path(kForceEnableHdrNetPath); + base::FilePath disable_file_path(kForceDisableHdrNetPath); + if (!base::DeleteFile(enable_file_path)) { + LOG(WARNING) << "Could not delete " << kForceEnableHdrNetPath; + } + if (!base::DeleteFile(disable_file_path)) { + LOG(WARNING) << "Could not delete " << kForceDisableHdrNetPath; + } + const base::CommandLine* command_line = + base::CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch(media::switches::kHdrNetOverride)) { + std::string value = + command_line->GetSwitchValueASCII(switches::kHdrNetOverride); + if (value == switches::kHdrNetForceEnabled) { + base::File file(enable_file_path, base::File::FLAG_CREATE_ALWAYS); + file.Close(); + } else if (value == switches::kHdrNetForceDisabled) { + base::File file(disable_file_path, base::File::FLAG_CREATE_ALWAYS); + file.Close(); + } } } |