Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(808)

Unified Diff: media/capture/video/linux/camera_config_chromeos.h

Issue 2648743002: Rotate frames according to camera orientation (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/capture/video/linux/camera_config_chromeos.h
diff --git a/media/capture/video/linux/camera_facing_chromeos.h b/media/capture/video/linux/camera_config_chromeos.h
similarity index 79%
rename from media/capture/video/linux/camera_facing_chromeos.h
rename to media/capture/video/linux/camera_config_chromeos.h
index 7e4ddcc6041f8683f63dd4c7bf4766657540d306..091c710508c5498f7b2f0c933dff25df2d127d88 100644
--- a/media/capture/video/linux/camera_facing_chromeos.h
+++ b/media/capture/video/linux/camera_config_chromeos.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MEDIA_CAPTURE_VIDEO_LINUX_CAMERA_FACING_CHROMEOS_H_
-#define MEDIA_CAPTURE_VIDEO_LINUX_CAMERA_FACING_CHROMEOS_H_
+#ifndef MEDIA_CAPTURE_VIDEO_LINUX_CAMERA_CONFIG_CHROMEOS_H_
+#define MEDIA_CAPTURE_VIDEO_LINUX_CAMERA_CONFIG_CHROMEOS_H_
#include <stddef.h>
@@ -16,7 +16,7 @@
namespace media {
-// CameraFacingChromeOS reads the file /etc/camera/camera_characteristics.conf
+// CameraConfigChromeOS reads the file /etc/camera/camera_characteristics.conf
// and populates |camera_id_to_facing_|, |usb_id_to_camera_id_| and
// |model_id_to_camera_id_|.
//
@@ -48,11 +48,11 @@ namespace media {
// camera0.module1.lens_info_available_focal_lengths=1.69,2
// camera1.lens_facing=1
// camera1.sensor_orientation=180
-class CAPTURE_EXPORT CameraFacingChromeOS {
+class CAPTURE_EXPORT CameraConfigChromeOS {
public:
- CameraFacingChromeOS();
- CAPTURE_EXPORT CameraFacingChromeOS(const std::string& config_file_path);
- CAPTURE_EXPORT ~CameraFacingChromeOS();
+ CameraConfigChromeOS();
+ CAPTURE_EXPORT CameraConfigChromeOS(const std::string& config_file_path);
+ CAPTURE_EXPORT ~CameraConfigChromeOS();
// Get camera facing by specifying USB vid and pid and device path. |model_id|
// should be formatted as "vid:pid". |device_id| is something like
@@ -61,21 +61,25 @@ class CAPTURE_EXPORT CameraFacingChromeOS {
CAPTURE_EXPORT VideoFacingMode
GetCameraFacing(const std::string& device_id,
const std::string& model_id) const;
wuchengli 2017/01/23 09:43:27 Document what the orientation is. Copy the documen
shenghao 2017/01/23 12:06:58 Done.
+ CAPTURE_EXPORT int GetOrientation(const std::string& device_id,
+ const std::string& model_id) const;
static const VideoFacingMode kLensFacingDefault =
VideoFacingMode::MEDIA_VIDEO_FACING_NONE;
private:
std::string GetUsbId(const std::string& device_id) const;
+ int GetCameraId(const std::string& device_id, const std::string& model_id) const;
// Read file content and populate |camera_id_to_facing_|,
// |usb_id_to_camera_id_| and |model_id_to_camera_id_|.
void InitializeDeviceInfo(const std::string& config_file_path);
std::unordered_map<int, VideoFacingMode> camera_id_to_facing_;
+ std::unordered_map<int, int> camera_id_to_orientation_;
std::unordered_map<std::string, int> usb_id_to_camera_id_;
std::unordered_map<std::string, int> model_id_to_camera_id_;
};
} // namespace media
-#endif // MEDIA_CAPTURE_VIDEO_LINUX_CAMERA_FACING_CHROMEOS_H_
+#endif // MEDIA_CAPTURE_VIDEO_LINUX_CAMERA_CONFIG_CHROMEOS_H_

Powered by Google App Engine
This is Rietveld 408576698