| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_ |
| 6 #define EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_ | 6 #define EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_ |
| 7 | 7 |
| 8 #include "extensions/browser/api/webcam_private/webcam.h" | 8 #include "extensions/browser/api/webcam_private/webcam.h" |
| 9 | 9 |
| 10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
| 11 | 11 |
| 12 namespace extensions { | 12 namespace extensions { |
| 13 | 13 |
| 14 class V4L2Webcam : public Webcam { | 14 class V4L2Webcam : public Webcam { |
| 15 public: | 15 public: |
| 16 V4L2Webcam(const std::string& device_id); | 16 V4L2Webcam(const std::string& device_id); |
| 17 bool Open(); | 17 bool Open(); |
| 18 | 18 |
| 19 private: | 19 private: |
| 20 ~V4L2Webcam() override; | 20 ~V4L2Webcam() override; |
| 21 bool EnsureLogitechCommandsMapped(); | 21 bool EnsureLogitechCommandsMapped(); |
| 22 bool SetWebcamParameter(int fd, uint32_t control_id, int value); | 22 bool SetWebcamParameter(int fd, uint32_t control_id, int value); |
| 23 bool GetWebcamParameter(int fd, uint32_t control_id, int* value); | 23 bool GetWebcamParameter(int fd, uint32_t control_id, int* value); |
| 24 | 24 |
| 25 // Webcam: | 25 // Webcam: |
| 26 void Reset(bool pan, bool tilt, bool zoom) override; | 26 void GetPan(const GetPTZCompleteCallback& callback) override; |
| 27 bool GetPan(int* value) override; | 27 void GetTilt(const GetPTZCompleteCallback& callback) override; |
| 28 bool GetTilt(int* value) override; | 28 void GetZoom(const GetPTZCompleteCallback& callback) override; |
| 29 bool GetZoom(int* value) override; | 29 void SetPan(int value, const SetPTZCompleteCallback& callback) override; |
| 30 bool SetPan(int value) override; | 30 void SetTilt(int value, const SetPTZCompleteCallback& callback) override; |
| 31 bool SetTilt(int value) override; | 31 void SetZoom(int value, const SetPTZCompleteCallback& callback) override; |
| 32 bool SetZoom(int value) override; | 32 void SetPanDirection(PanDirection direction, |
| 33 bool SetPanDirection(PanDirection direction) override; | 33 const SetPTZCompleteCallback& callback) override; |
| 34 bool SetTiltDirection(TiltDirection direction) override; | 34 void SetTiltDirection(TiltDirection direction, |
| 35 const SetPTZCompleteCallback& callback) override; |
| 36 void Reset(bool pan, |
| 37 bool tilt, |
| 38 bool zoom, |
| 39 const SetPTZCompleteCallback& callback) override; |
| 35 | 40 |
| 36 const std::string device_id_; | 41 const std::string device_id_; |
| 37 base::ScopedFD fd_; | 42 base::ScopedFD fd_; |
| 38 | 43 |
| 39 DISALLOW_COPY_AND_ASSIGN(V4L2Webcam); | 44 DISALLOW_COPY_AND_ASSIGN(V4L2Webcam); |
| 40 }; | 45 }; |
| 41 | 46 |
| 42 | 47 |
| 43 } // namespace extensions | 48 } // namespace extensions |
| 44 | 49 |
| 45 #endif // EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_ | 50 #endif // EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_V4L2_WEBCAM_H_ |
| OLD | NEW |