| 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/user_media_client_impl.h" | 5 #include "content/renderer/media/user_media_client_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/hash.h" | 9 #include "base/hash.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 weak_factory_.GetWeakPtr()), | 573 weak_factory_.GetWeakPtr()), |
| 574 dependency_factory_)); | 574 dependency_factory_)); |
| 575 webkit_source->setExtraData(audio_source); | 575 webkit_source->setExtraData(audio_source); |
| 576 } | 576 } |
| 577 local_sources_.push_back(*webkit_source); | 577 local_sources_.push_back(*webkit_source); |
| 578 } | 578 } |
| 579 | 579 |
| 580 MediaStreamVideoSource* UserMediaClientImpl::CreateVideoSource( | 580 MediaStreamVideoSource* UserMediaClientImpl::CreateVideoSource( |
| 581 const StreamDeviceInfo& device, | 581 const StreamDeviceInfo& device, |
| 582 const MediaStreamSource::SourceStoppedCallback& stop_callback) { | 582 const MediaStreamSource::SourceStoppedCallback& stop_callback) { |
| 583 scoped_ptr<VideoCapturerDelegate> delegate(new VideoCapturerDelegate(device)); |
| 583 return new content::MediaStreamVideoCapturerSource( | 584 return new content::MediaStreamVideoCapturerSource( |
| 584 device, | 585 device, |
| 585 stop_callback, | 586 stop_callback, |
| 586 new VideoCapturerDelegate(device)); | 587 delegate.Pass()); |
| 587 } | 588 } |
| 588 | 589 |
| 589 void UserMediaClientImpl::CreateVideoTracks( | 590 void UserMediaClientImpl::CreateVideoTracks( |
| 590 const StreamDeviceInfoArray& devices, | 591 const StreamDeviceInfoArray& devices, |
| 591 const blink::WebMediaConstraints& constraints, | 592 const blink::WebMediaConstraints& constraints, |
| 592 blink::WebVector<blink::WebMediaStreamTrack>* webkit_tracks, | 593 blink::WebVector<blink::WebMediaStreamTrack>* webkit_tracks, |
| 593 UserMediaRequestInfo* request) { | 594 UserMediaRequestInfo* request) { |
| 594 DCHECK_EQ(devices.size(), webkit_tracks->size()); | 595 DCHECK_EQ(devices.size(), webkit_tracks->size()); |
| 595 | 596 |
| 596 for (size_t i = 0; i < devices.size(); ++i) { | 597 for (size_t i = 0; i < devices.size(); ++i) { |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 return; | 1063 return; |
| 1063 } | 1064 } |
| 1064 } | 1065 } |
| 1065 } | 1066 } |
| 1066 | 1067 |
| 1067 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { | 1068 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { |
| 1068 return !sources_waiting_for_callback_.empty(); | 1069 return !sources_waiting_for_callback_.empty(); |
| 1069 } | 1070 } |
| 1070 | 1071 |
| 1071 } // namespace content | 1072 } // namespace content |
| OLD | NEW |