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 #include "content/renderer/media/media_stream_impl.h" | 5 #include "content/renderer/media/media_stream_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 video_source_vector); | 318 video_source_vector); |
319 | 319 |
320 // WebUserMediaRequest don't have an implementation in unit tests. | 320 // WebUserMediaRequest don't have an implementation in unit tests. |
321 // Therefore we need to check for isNull here. | 321 // Therefore we need to check for isNull here. |
322 WebKit::WebMediaConstraints audio_constraints = request->isNull() ? | 322 WebKit::WebMediaConstraints audio_constraints = request->isNull() ? |
323 WebKit::WebMediaConstraints() : request->audioConstraints(); | 323 WebKit::WebMediaConstraints() : request->audioConstraints(); |
324 WebKit::WebMediaConstraints video_constraints = request->isNull() ? | 324 WebKit::WebMediaConstraints video_constraints = request->isNull() ? |
325 WebKit::WebMediaConstraints() : request->videoConstraints(); | 325 WebKit::WebMediaConstraints() : request->videoConstraints(); |
326 | 326 |
327 dependency_factory_->CreateNativeMediaSources( | 327 dependency_factory_->CreateNativeMediaSources( |
| 328 RenderViewObserver::routing_id(), |
328 audio_constraints, video_constraints, description, | 329 audio_constraints, video_constraints, description, |
329 base::Bind(&MediaStreamImpl::OnCreateNativeSourcesComplete, AsWeakPtr())); | 330 base::Bind(&MediaStreamImpl::OnCreateNativeSourcesComplete, AsWeakPtr())); |
330 } | 331 } |
331 | 332 |
332 // Callback from MediaStreamDispatcher. | 333 // Callback from MediaStreamDispatcher. |
333 // The requested stream failed to be generated. | 334 // The requested stream failed to be generated. |
334 void MediaStreamImpl::OnStreamGenerationFailed(int request_id) { | 335 void MediaStreamImpl::OnStreamGenerationFailed(int request_id) { |
335 DCHECK(CalledOnValidThread()); | 336 DCHECK(CalledOnValidThread()); |
336 DVLOG(1) << "MediaStreamImpl::OnStreamGenerationFailed(" | 337 DVLOG(1) << "MediaStreamImpl::OnStreamGenerationFailed(" |
337 << request_id << ")"; | 338 << request_id << ")"; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 const StreamStopCallback& stop_callback) { | 571 const StreamStopCallback& stop_callback) { |
571 stream_stop_callback_ = stop_callback; | 572 stream_stop_callback_ = stop_callback; |
572 } | 573 } |
573 | 574 |
574 void MediaStreamExtraData::OnLocalStreamStop() { | 575 void MediaStreamExtraData::OnLocalStreamStop() { |
575 if (!stream_stop_callback_.is_null()) | 576 if (!stream_stop_callback_.is_null()) |
576 stream_stop_callback_.Run(stream_->label()); | 577 stream_stop_callback_.Run(stream_->label()); |
577 } | 578 } |
578 | 579 |
579 } // namespace content | 580 } // namespace content |
OLD | NEW |