OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "media/video/capture/win/video_capture_device_win.h" | 5 #include "media/video/capture/win/video_capture_device_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 VideoCaptureDeviceWin* self = new VideoCaptureDeviceWin(device_name); | 245 VideoCaptureDeviceWin* self = new VideoCaptureDeviceWin(device_name); |
246 if (self && self->Init()) | 246 if (self && self->Init()) |
247 return self; | 247 return self; |
248 | 248 |
249 delete self; | 249 delete self; |
250 return NULL; | 250 return NULL; |
251 } | 251 } |
252 | 252 |
253 VideoCaptureDeviceWin::VideoCaptureDeviceWin(const Name& device_name) | 253 VideoCaptureDeviceWin::VideoCaptureDeviceWin(const Name& device_name) |
254 : device_name_(device_name), | 254 : device_name_(device_name), |
255 state_(kIdle) { | 255 state_(kIdle), |
| 256 observer_(NULL) { |
256 } | 257 } |
257 | 258 |
258 VideoCaptureDeviceWin::~VideoCaptureDeviceWin() { | 259 VideoCaptureDeviceWin::~VideoCaptureDeviceWin() { |
259 if (media_control_) | 260 if (media_control_) |
260 media_control_->Stop(); | 261 media_control_->Stop(); |
261 | 262 |
262 if (graph_builder_) { | 263 if (graph_builder_) { |
263 if (sink_filter_) { | 264 if (sink_filter_) { |
264 graph_builder_->RemoveFilter(sink_filter_); | 265 graph_builder_->RemoveFilter(sink_filter_); |
265 sink_filter_ = NULL; | 266 sink_filter_ = NULL; |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 return diff_list.front().capability_index; | 648 return diff_list.front().capability_index; |
648 } | 649 } |
649 | 650 |
650 void VideoCaptureDeviceWin::SetErrorState(const char* reason) { | 651 void VideoCaptureDeviceWin::SetErrorState(const char* reason) { |
651 DLOG(ERROR) << reason; | 652 DLOG(ERROR) << reason; |
652 state_ = kError; | 653 state_ = kError; |
653 observer_->OnError(); | 654 observer_->OnError(); |
654 } | 655 } |
655 | 656 |
656 } // namespace media | 657 } // namespace media |
OLD | NEW |