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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 | 1043 |
1044 UserMediaClientImpl::UserMediaRequestInfo::~UserMediaRequestInfo() { | 1044 UserMediaClientImpl::UserMediaRequestInfo::~UserMediaRequestInfo() { |
1045 DVLOG(1) << "~UserMediaRequestInfo"; | 1045 DVLOG(1) << "~UserMediaRequestInfo"; |
1046 } | 1046 } |
1047 | 1047 |
1048 void UserMediaClientImpl::UserMediaRequestInfo::StartAudioTrack( | 1048 void UserMediaClientImpl::UserMediaRequestInfo::StartAudioTrack( |
1049 const blink::WebMediaStreamTrack& track, | 1049 const blink::WebMediaStreamTrack& track, |
1050 const blink::WebMediaConstraints& constraints) { | 1050 const blink::WebMediaConstraints& constraints) { |
1051 DCHECK(track.source().type() == blink::WebMediaStreamSource::TypeAudio); | 1051 DCHECK(track.source().type() == blink::WebMediaStreamSource::TypeAudio); |
1052 MediaStreamAudioSource* native_source = | 1052 MediaStreamAudioSource* native_source = |
1053 static_cast <MediaStreamAudioSource*>(track.source().extraData()); | 1053 MediaStreamAudioSource::From(track.source()); |
1054 DCHECK(native_source); | 1054 DCHECK(native_source); |
1055 | 1055 |
1056 sources_.push_back(track.source()); | 1056 sources_.push_back(track.source()); |
1057 sources_waiting_for_callback_.push_back(native_source); | 1057 sources_waiting_for_callback_.push_back(native_source); |
1058 native_source->AddTrack( | 1058 native_source->AddTrack( |
1059 track, constraints, base::Bind( | 1059 track, constraints, base::Bind( |
1060 &UserMediaClientImpl::UserMediaRequestInfo::OnTrackStarted, | 1060 &UserMediaClientImpl::UserMediaRequestInfo::OnTrackStarted, |
1061 AsWeakPtr())); | 1061 AsWeakPtr())); |
1062 } | 1062 } |
1063 | 1063 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 return; | 1133 return; |
1134 } | 1134 } |
1135 } | 1135 } |
1136 } | 1136 } |
1137 | 1137 |
1138 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { | 1138 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { |
1139 return !sources_waiting_for_callback_.empty(); | 1139 return !sources_waiting_for_callback_.empty(); |
1140 } | 1140 } |
1141 | 1141 |
1142 } // namespace content | 1142 } // namespace content |
OLD | NEW |