Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: content/renderer/media/media_stream_video_capturer_source.cc

Issue 391703002: Implement ConstraintNotSatisfiedError for getusermedia (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 128 }
129 running_callback_.Reset(); 129 running_callback_.Reset();
130 source_formats_callback_.Reset(); 130 source_formats_callback_.Reset();
131 } 131 }
132 132
133 void VideoCapturerDelegate::OnStateUpdateOnRenderThread( 133 void VideoCapturerDelegate::OnStateUpdateOnRenderThread(
134 VideoCaptureState state) { 134 VideoCaptureState state) {
135 DCHECK(thread_checker_.CalledOnValidThread()); 135 DCHECK(thread_checker_.CalledOnValidThread());
136 DVLOG(3) << "OnStateUpdateOnRenderThread state = " << state; 136 DVLOG(3) << "OnStateUpdateOnRenderThread state = " << state;
137 if (state == VIDEO_CAPTURE_STATE_STARTED && !running_callback_.is_null()) { 137 if (state == VIDEO_CAPTURE_STATE_STARTED && !running_callback_.is_null()) {
138 running_callback_.Run(true); 138 running_callback_.Run(MEDIA_DEVICE_OK);
139 return; 139 return;
140 } 140 }
141 if (state > VIDEO_CAPTURE_STATE_STARTED && !running_callback_.is_null()) { 141 if (state > VIDEO_CAPTURE_STATE_STARTED && !running_callback_.is_null()) {
142 base::ResetAndReturn(&running_callback_).Run(false); 142 base::ResetAndReturn(&running_callback_).Run(
143 MEDIA_DEVICE_TRACK_START_FAILURE);
143 } 144 }
144 } 145 }
145 146
146 void VideoCapturerDelegate::OnDeviceFormatsInUseReceived( 147 void VideoCapturerDelegate::OnDeviceFormatsInUseReceived(
147 const media::VideoCaptureFormats& formats_in_use) { 148 const media::VideoCaptureFormats& formats_in_use) {
148 DVLOG(3) << "OnDeviceFormatsInUseReceived: " << formats_in_use.size(); 149 DVLOG(3) << "OnDeviceFormatsInUseReceived: " << formats_in_use.size();
149 DCHECK(thread_checker_.CalledOnValidThread()); 150 DCHECK(thread_checker_.CalledOnValidThread());
150 // StopCapture() might have destroyed |source_formats_callback_| before 151 // StopCapture() might have destroyed |source_formats_callback_| before
151 // arriving here. 152 // arriving here.
152 if (source_formats_callback_.is_null()) 153 if (source_formats_callback_.is_null())
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 frame_callback, 237 frame_callback,
237 base::Bind(&MediaStreamVideoCapturerSource::OnStartDone, 238 base::Bind(&MediaStreamVideoCapturerSource::OnStartDone,
238 base::Unretained(this))); 239 base::Unretained(this)));
239 } 240 }
240 241
241 void MediaStreamVideoCapturerSource::StopSourceImpl() { 242 void MediaStreamVideoCapturerSource::StopSourceImpl() {
242 delegate_->StopCapture(); 243 delegate_->StopCapture();
243 } 244 }
244 245
245 } // namespace content 246 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698