OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/media_stream_video_capturer_source.h" | 5 #include "content/renderer/media/media_stream_video_capturer_source.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "content/renderer/media/video_capture_impl_manager.h" | 10 #include "content/renderer/media/video_capture_impl_manager.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 } | 130 } |
131 running_callback_.Reset(); | 131 running_callback_.Reset(); |
132 source_formats_callback_.Reset(); | 132 source_formats_callback_.Reset(); |
133 } | 133 } |
134 | 134 |
135 void VideoCapturerDelegate::OnStateUpdateOnRenderThread( | 135 void VideoCapturerDelegate::OnStateUpdateOnRenderThread( |
136 VideoCaptureState state) { | 136 VideoCaptureState state) { |
137 DCHECK(thread_checker_.CalledOnValidThread()); | 137 DCHECK(thread_checker_.CalledOnValidThread()); |
138 DVLOG(3) << "OnStateUpdateOnRenderThread state = " << state; | 138 DVLOG(3) << "OnStateUpdateOnRenderThread state = " << state; |
139 if (state == VIDEO_CAPTURE_STATE_STARTED && !running_callback_.is_null()) { | 139 if (state == VIDEO_CAPTURE_STATE_STARTED && !running_callback_.is_null()) { |
140 running_callback_.Run(true); | 140 running_callback_.Run(MEDIA_DEVICE_OK); |
141 return; | 141 return; |
142 } | 142 } |
143 if (state > VIDEO_CAPTURE_STATE_STARTED && !running_callback_.is_null()) { | 143 if (state > VIDEO_CAPTURE_STATE_STARTED && !running_callback_.is_null()) { |
144 base::ResetAndReturn(&running_callback_).Run(false); | 144 base::ResetAndReturn(&running_callback_).Run( |
145 MEDIA_DEVICE_TRACK_START_FAILURE); | |
no longer working on chromium
2014/07/25 19:27:35
why isn't it MEDIA_DEVICE_SOURCE_START_FAILURE ?
| |
145 } | 146 } |
146 } | 147 } |
147 | 148 |
148 void VideoCapturerDelegate::OnDeviceFormatsInUseReceived( | 149 void VideoCapturerDelegate::OnDeviceFormatsInUseReceived( |
149 const media::VideoCaptureFormats& formats_in_use) { | 150 const media::VideoCaptureFormats& formats_in_use) { |
150 DVLOG(3) << "OnDeviceFormatsInUseReceived: " << formats_in_use.size(); | 151 DVLOG(3) << "OnDeviceFormatsInUseReceived: " << formats_in_use.size(); |
151 DCHECK(thread_checker_.CalledOnValidThread()); | 152 DCHECK(thread_checker_.CalledOnValidThread()); |
152 // StopCapture() might have destroyed |source_formats_callback_| before | 153 // StopCapture() might have destroyed |source_formats_callback_| before |
153 // arriving here. | 154 // arriving here. |
154 if (source_formats_callback_.is_null()) | 155 if (source_formats_callback_.is_null()) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
238 frame_callback, | 239 frame_callback, |
239 base::Bind(&MediaStreamVideoCapturerSource::OnStartDone, | 240 base::Bind(&MediaStreamVideoCapturerSource::OnStartDone, |
240 base::Unretained(this))); | 241 base::Unretained(this))); |
241 } | 242 } |
242 | 243 |
243 void MediaStreamVideoCapturerSource::StopSourceImpl() { | 244 void MediaStreamVideoCapturerSource::StopSourceImpl() { |
244 delegate_->StopCapture(); | 245 delegate_->StopCapture(); |
245 } | 246 } |
246 | 247 |
247 } // namespace content | 248 } // namespace content |
OLD | NEW |