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

Unified Diff: extensions/browser/api/webcam_private/v4l2_webcam.h

Issue 1136883004: Move V4L2 code into a webcam helper class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 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
« no previous file with comments | « no previous file | extensions/browser/api/webcam_private/v4l2_webcam.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/webcam_private/v4l2_webcam.h
diff --git a/extensions/browser/api/webcam_private/v4l2_webcam.h b/extensions/browser/api/webcam_private/v4l2_webcam.h
new file mode 100644
index 0000000000000000000000000000000000000000..53efcfceb18f19dea922a709c751a64b624889f6
--- /dev/null
+++ b/extensions/browser/api/webcam_private/v4l2_webcam.h
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_
+#define EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_
+
+#include "extensions/browser/api/webcam_private/webcam.h"
+
+#include "base/files/scoped_file.h"
+
+namespace extensions {
+
+class V4L2Webcam : public Webcam {
+ public:
+ V4L2Webcam(const std::string& device_id);
+ ~V4L2Webcam() override;
+
+ bool Open();
+
+ private:
+ bool EnsureLogitechCommandsMapped();
+ bool SetWebcamParameter(int fd, uint32_t control_id, int value);
+ bool GetWebcamParameter(int fd, uint32_t control_id, int* value);
+
+ // Webcam:
+ void Reset(bool pan, bool tilt, bool zoom) override;
+ bool GetPan(int* value) override;
+ bool GetTilt(int* value) override;
+ bool GetZoom(int* value) override;
+ bool SetPan(int value) override;
+ bool SetTilt(int value) override;
+ bool SetZoom(int value) override;
+ bool SetPanDirection(PanDirection direction) override;
+ bool SetTiltDirection(TiltDirection direction) override;
+
+ const std::string device_id_;
+ base::ScopedFD fd_;
+
+ DISALLOW_COPY_AND_ASSIGN(V4L2Webcam);
+};
+
+
+} // namespace extensions
+
+#endif // EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_
« no previous file with comments | « no previous file | extensions/browser/api/webcam_private/v4l2_webcam.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698