OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // VideoCaptureController is the glue between a VideoCaptureDevice and all | 5 // VideoCaptureController is the glue between a VideoCaptureDevice and all |
6 // VideoCaptureHosts that have connected to it. A controller exists on behalf of | 6 // VideoCaptureHosts that have connected to it. A controller exists on behalf of |
7 // one (and only one) VideoCaptureDevice; both are owned by the | 7 // one (and only one) VideoCaptureDevice; both are owned by the |
8 // VideoCaptureManager. | 8 // VideoCaptureManager. |
9 // | 9 // |
10 // The VideoCaptureController is responsible for: | 10 // The VideoCaptureController is responsible for: |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 const media::VideoCaptureFormat& GetVideoCaptureFormat() const; | 127 const media::VideoCaptureFormat& GetVideoCaptureFormat() const; |
128 | 128 |
129 bool has_received_frames() const { return has_received_frames_; } | 129 bool has_received_frames() const { return has_received_frames_; } |
130 | 130 |
131 // Implementation of media::VideoFrameReceiver interface: | 131 // Implementation of media::VideoFrameReceiver interface: |
132 void OnIncomingCapturedVideoFrame( | 132 void OnIncomingCapturedVideoFrame( |
133 media::VideoCaptureDevice::Client::Buffer buffer, | 133 media::VideoCaptureDevice::Client::Buffer buffer, |
134 scoped_refptr<media::VideoFrame> frame) override; | 134 scoped_refptr<media::VideoFrame> frame) override; |
135 void OnError() override; | 135 void OnError() override; |
136 void OnLog(const std::string& message) override; | 136 void OnLog(const std::string& message) override; |
| 137 void OnStarted() override; |
137 void OnBufferDestroyed(int buffer_id_to_drop) override; | 138 void OnBufferDestroyed(int buffer_id_to_drop) override; |
138 | 139 |
139 private: | 140 private: |
140 struct ControllerClient; | 141 struct ControllerClient; |
141 typedef std::list<std::unique_ptr<ControllerClient>> ControllerClients; | 142 typedef std::list<std::unique_ptr<ControllerClient>> ControllerClients; |
142 | 143 |
143 class BufferState { | 144 class BufferState { |
144 public: | 145 public: |
145 explicit BufferState( | 146 explicit BufferState( |
146 int buffer_id, | 147 int buffer_id, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 media::VideoCaptureFormat video_capture_format_; | 197 media::VideoCaptureFormat video_capture_format_; |
197 | 198 |
198 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; | 199 base::WeakPtrFactory<VideoCaptureController> weak_ptr_factory_; |
199 | 200 |
200 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); | 201 DISALLOW_COPY_AND_ASSIGN(VideoCaptureController); |
201 }; | 202 }; |
202 | 203 |
203 } // namespace content | 204 } // namespace content |
204 | 205 |
205 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ | 206 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ |
OLD | NEW |