| 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 video_source_vector); | 324 video_source_vector); |
| 325 | 325 |
| 326 // WebUserMediaRequest don't have an implementation in unit tests. | 326 // WebUserMediaRequest don't have an implementation in unit tests. |
| 327 // Therefore we need to check for isNull here. | 327 // Therefore we need to check for isNull here. |
| 328 WebKit::WebMediaConstraints audio_constraints = request->isNull() ? | 328 WebKit::WebMediaConstraints audio_constraints = request->isNull() ? |
| 329 WebKit::WebMediaConstraints() : request->audioConstraints(); | 329 WebKit::WebMediaConstraints() : request->audioConstraints(); |
| 330 WebKit::WebMediaConstraints video_constraints = request->isNull() ? | 330 WebKit::WebMediaConstraints video_constraints = request->isNull() ? |
| 331 WebKit::WebMediaConstraints() : request->videoConstraints(); | 331 WebKit::WebMediaConstraints() : request->videoConstraints(); |
| 332 | 332 |
| 333 dependency_factory_->CreateNativeMediaSources( | 333 dependency_factory_->CreateNativeMediaSources( |
| 334 RenderViewObserver::routing_id(), |
| 334 audio_constraints, video_constraints, description, | 335 audio_constraints, video_constraints, description, |
| 335 base::Bind(&MediaStreamImpl::OnCreateNativeSourcesComplete, AsWeakPtr())); | 336 base::Bind(&MediaStreamImpl::OnCreateNativeSourcesComplete, AsWeakPtr())); |
| 336 } | 337 } |
| 337 | 338 |
| 338 // Callback from MediaStreamDispatcher. | 339 // Callback from MediaStreamDispatcher. |
| 339 // The requested stream failed to be generated. | 340 // The requested stream failed to be generated. |
| 340 void MediaStreamImpl::OnStreamGenerationFailed(int request_id) { | 341 void MediaStreamImpl::OnStreamGenerationFailed(int request_id) { |
| 341 DCHECK(CalledOnValidThread()); | 342 DCHECK(CalledOnValidThread()); |
| 342 DVLOG(1) << "MediaStreamImpl::OnStreamGenerationFailed(" | 343 DVLOG(1) << "MediaStreamImpl::OnStreamGenerationFailed(" |
| 343 << request_id << ")"; | 344 << request_id << ")"; |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 const StreamStopCallback& stop_callback) { | 588 const StreamStopCallback& stop_callback) { |
| 588 stream_stop_callback_ = stop_callback; | 589 stream_stop_callback_ = stop_callback; |
| 589 } | 590 } |
| 590 | 591 |
| 591 void MediaStreamExtraData::OnLocalStreamStop() { | 592 void MediaStreamExtraData::OnLocalStreamStop() { |
| 592 if (!stream_stop_callback_.is_null()) | 593 if (!stream_stop_callback_.is_null()) |
| 593 stream_stop_callback_.Run(stream_->label()); | 594 stream_stop_callback_.Run(stream_->label()); |
| 594 } | 595 } |
| 595 | 596 |
| 596 } // namespace content | 597 } // namespace content |
| OLD | NEW |