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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | extensions/browser/api/webcam_private/v4l2_webcam.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_
6 #define EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_
7
8 #include "extensions/browser/api/webcam_private/webcam.h"
9
10 #include "base/files/scoped_file.h"
11
12 namespace extensions {
13
14 class V4L2Webcam : public Webcam {
15 public:
16 V4L2Webcam(const std::string& device_id);
17 ~V4L2Webcam() override;
18
19 bool Open();
20
21 private:
22 bool EnsureLogitechCommandsMapped();
23 bool SetWebcamParameter(int fd, uint32_t control_id, int value);
24 bool GetWebcamParameter(int fd, uint32_t control_id, int* value);
25
26 // Webcam:
27 void Reset(bool pan, bool tilt, bool zoom) override;
28 bool GetPan(int* value) override;
29 bool GetTilt(int* value) override;
30 bool GetZoom(int* value) override;
31 bool SetPan(int value) override;
32 bool SetTilt(int value) override;
33 bool SetZoom(int value) override;
34 bool SetPanDirection(PanDirection direction) override;
35 bool SetTiltDirection(TiltDirection direction) override;
36
37 const std::string device_id_;
38 base::ScopedFD fd_;
39
40 DISALLOW_COPY_AND_ASSIGN(V4L2Webcam);
41 };
42
43
44 } // namespace extensions
45
46 #endif // EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_
OLDNEW
« 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