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

Side by Side Diff: extensions/browser/api/webcam_private/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
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_WEBCAM_H_
6 #define EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_WEBCAM_H_
7
8 #include <set>
9 #include <string>
10
11 #include "base/macros.h"
12
13 namespace extensions {
14
15 class Webcam {
16 public:
17 enum PanDirection {
18 PAN_LEFT,
19 PAN_RIGHT,
20 PAN_STOP,
21 };
22
23 enum TiltDirection {
24 TILT_UP,
25 TILT_DOWN,
26 TILT_STOP,
27 };
28
29 Webcam();
30 virtual ~Webcam();
31
32 virtual void Reset(bool pan, bool tilt, bool zoom) = 0;
33 virtual bool GetPan(int* value) = 0;
34 virtual bool GetTilt(int* value) = 0;
35 virtual bool GetZoom(int* value) = 0;
36 virtual bool SetPan(int value) = 0;
37 virtual bool SetTilt(int value) = 0;
38 virtual bool SetZoom(int value) = 0;
39 virtual bool SetPanDirection(PanDirection direction) = 0;
40 virtual bool SetTiltDirection(TiltDirection direction) = 0;
41
42 void AddExtensionRef(const std::string& extension_id) {
43 extension_refs_.insert(extension_id);
44 }
45
46 void RemoveExtensionRef(const std::string& extension_id) {
47 extension_refs_.erase(extension_id);
48 }
49
50 bool ShouldDelete() {
51 return extension_refs_.empty();
52 }
53
54 private:
55 std::set<std::string> extension_refs_;
56
57 DISALLOW_COPY_AND_ASSIGN(Webcam);
58 };
59
60 } // namespace extensions
61
62 #endif // EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_WEBCAM_H_
OLDNEW
« no previous file with comments | « extensions/browser/api/webcam_private/v4l2_webcam.cc ('k') | extensions/browser/api/webcam_private/webcam.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698