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_VISCA_WEBCAM_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_VISCA_WEBCAM_H_ |
6 #define EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_VISCA_WEBCAM_H_ | 6 #define EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_VISCA_WEBCAM_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // cleared successfully. | 54 // cleared successfully. |
55 void OnClearAllCompleted(const OpenCompleteCallback& open_callback, | 55 void OnClearAllCompleted(const OpenCompleteCallback& open_callback, |
56 bool success, | 56 bool success, |
57 const std::vector<char>& response); | 57 const std::vector<char>& response); |
58 | 58 |
59 // Send or queue a command and wait for the camera's response. | 59 // Send or queue a command and wait for the camera's response. |
60 void Send(const std::vector<char>& command, | 60 void Send(const std::vector<char>& command, |
61 const CommandCompleteCallback& callback); | 61 const CommandCompleteCallback& callback); |
62 void OnSendCompleted(const CommandCompleteCallback& callback, | 62 void OnSendCompleted(const CommandCompleteCallback& callback, |
63 int bytes_sent, | 63 int bytes_sent, |
64 core_api::serial::SendError error); | 64 api::serial::SendError error); |
65 void ReceiveLoop(const CommandCompleteCallback& callback); | 65 void ReceiveLoop(const CommandCompleteCallback& callback); |
66 void OnReceiveCompleted(const CommandCompleteCallback& callback, | 66 void OnReceiveCompleted(const CommandCompleteCallback& callback, |
67 const std::vector<char>& data, | 67 const std::vector<char>& data, |
68 core_api::serial::ReceiveError error); | 68 api::serial::ReceiveError error); |
69 // Callback function that will be called after the send and reply of a command | 69 // Callback function that will be called after the send and reply of a command |
70 // are both completed. Update |value| according to |type| and |response| if | 70 // are both completed. Update |value| according to |type| and |response| if |
71 // necessory. | 71 // necessory. |
72 void OnCommandCompleted(CommandType type, | 72 void OnCommandCompleted(CommandType type, |
73 int* value, | 73 int* value, |
74 bool success, | 74 bool success, |
75 const std::vector<char>& response); | 75 const std::vector<char>& response); |
76 | 76 |
77 // Webcam Overrides: | 77 // Webcam Overrides: |
78 void Reset(bool pan, bool tilt, bool zoom) override; | 78 void Reset(bool pan, bool tilt, bool zoom) override; |
(...skipping 22 matching lines...) Expand all Loading... |
101 int tilt_; | 101 int tilt_; |
102 | 102 |
103 base::WeakPtrFactory<ViscaWebcam> weak_ptr_factory_; | 103 base::WeakPtrFactory<ViscaWebcam> weak_ptr_factory_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(ViscaWebcam); | 105 DISALLOW_COPY_AND_ASSIGN(ViscaWebcam); |
106 }; | 106 }; |
107 | 107 |
108 } // namespace extensions | 108 } // namespace extensions |
109 | 109 |
110 #endif // EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_VISCA_WEBCAM_H_ | 110 #endif // EXTENSIONS_BROWSER_API_WEBCAM_PRIVATE_VISCA_WEBCAM_H_ |
OLD | NEW |