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 "content/renderer/media/video_capture_impl.h" | 5 #include "content/renderer/media/video_capture_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "content/common/child_process.h" | 9 #include "content/common/child_process.h" |
10 #include "content/common/media/video_capture_messages.h" | 10 #include "content/common/media/video_capture_messages.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 VideoCaptureMessageFilter* filter) | 49 VideoCaptureMessageFilter* filter) |
50 : VideoCapture(), | 50 : VideoCapture(), |
51 message_filter_(filter), | 51 message_filter_(filter), |
52 ml_proxy_(ml_proxy), | 52 ml_proxy_(ml_proxy), |
53 device_id_(0), | 53 device_id_(0), |
54 video_type_(media::VideoFrame::I420), | 54 video_type_(media::VideoFrame::I420), |
55 device_info_available_(false), | 55 device_info_available_(false), |
56 state_(video_capture::kStopped) { | 56 state_(video_capture::kStopped) { |
57 DCHECK(filter); | 57 DCHECK(filter); |
58 memset(¤t_params_, 0, sizeof(current_params_)); | 58 memset(¤t_params_, 0, sizeof(current_params_)); |
| 59 memset(&device_info_, 0, sizeof(device_info_)); |
59 current_params_.session_id = id; | 60 current_params_.session_id = id; |
60 } | 61 } |
61 | 62 |
62 VideoCaptureImpl::~VideoCaptureImpl() { | 63 VideoCaptureImpl::~VideoCaptureImpl() { |
63 STLDeleteContainerPairSecondPointers(cached_dibs_.begin(), | 64 STLDeleteContainerPairSecondPointers(cached_dibs_.begin(), |
64 cached_dibs_.end()); | 65 cached_dibs_.end()); |
65 } | 66 } |
66 | 67 |
67 void VideoCaptureImpl::Init() { | 68 void VideoCaptureImpl::Init() { |
68 base::MessageLoopProxy* io_message_loop_proxy = | 69 base::MessageLoopProxy* io_message_loop_proxy = |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 } | 436 } |
436 | 437 |
437 bool VideoCaptureImpl::ClientHasDIB() { | 438 bool VideoCaptureImpl::ClientHasDIB() { |
438 CachedDIB::iterator it; | 439 CachedDIB::iterator it; |
439 for (it = cached_dibs_.begin(); it != cached_dibs_.end(); it++) { | 440 for (it = cached_dibs_.begin(); it != cached_dibs_.end(); it++) { |
440 if (it->second->references > 0) | 441 if (it->second->references > 0) |
441 return true; | 442 return true; |
442 } | 443 } |
443 return false; | 444 return false; |
444 } | 445 } |
OLD | NEW |