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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 | 1056 |
1057 UserMediaClientImpl::UserMediaRequestInfo::~UserMediaRequestInfo() { | 1057 UserMediaClientImpl::UserMediaRequestInfo::~UserMediaRequestInfo() { |
1058 DVLOG(1) << "~UserMediaRequestInfo"; | 1058 DVLOG(1) << "~UserMediaRequestInfo"; |
1059 } | 1059 } |
1060 | 1060 |
1061 void UserMediaClientImpl::UserMediaRequestInfo::StartAudioTrack( | 1061 void UserMediaClientImpl::UserMediaRequestInfo::StartAudioTrack( |
1062 const blink::WebMediaStreamTrack& track, | 1062 const blink::WebMediaStreamTrack& track, |
1063 const blink::WebMediaConstraints& constraints) { | 1063 const blink::WebMediaConstraints& constraints) { |
1064 DCHECK(track.source().getType() == blink::WebMediaStreamSource::TypeAudio); | 1064 DCHECK(track.source().getType() == blink::WebMediaStreamSource::TypeAudio); |
1065 MediaStreamAudioSource* native_source = | 1065 MediaStreamAudioSource* native_source = |
1066 static_cast<MediaStreamAudioSource*>(track.source().getExtraData()); | 1066 MediaStreamAudioSource::From(track.source()); |
1067 DCHECK(native_source); | 1067 DCHECK(native_source); |
1068 | 1068 |
1069 sources_.push_back(track.source()); | 1069 sources_.push_back(track.source()); |
1070 sources_waiting_for_callback_.push_back(native_source); | 1070 sources_waiting_for_callback_.push_back(native_source); |
1071 native_source->AddTrack( | 1071 native_source->AddTrack( |
1072 track, constraints, base::Bind( | 1072 track, constraints, base::Bind( |
1073 &UserMediaClientImpl::UserMediaRequestInfo::OnTrackStarted, | 1073 &UserMediaClientImpl::UserMediaRequestInfo::OnTrackStarted, |
1074 AsWeakPtr())); | 1074 AsWeakPtr())); |
1075 } | 1075 } |
1076 | 1076 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 return; | 1146 return; |
1147 } | 1147 } |
1148 } | 1148 } |
1149 } | 1149 } |
1150 | 1150 |
1151 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { | 1151 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { |
1152 return !sources_waiting_for_callback_.empty(); | 1152 return !sources_waiting_for_callback_.empty(); |
1153 } | 1153 } |
1154 | 1154 |
1155 } // namespace content | 1155 } // namespace content |
OLD | NEW |