OLD | NEW |
(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_ |
OLD | NEW |