Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/public/renderer/media_stream_audio_sink.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "content/renderer/media/media_stream_track_extra_data.h" | |
| 9 #include "content/renderer/media/webrtc_local_audio_track.h" | |
| 10 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | |
| 11 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | |
| 12 | |
| 13 namespace content { | |
| 14 | |
| 15 void AddToAudioTrack(MediaStreamAudioSink* sink, | |
| 16 const blink::WebMediaStreamTrack& track) { | |
| 17 DCHECK(track.source().type() == blink::WebMediaStreamSource::TypeAudio); | |
| 18 MediaStreamTrackExtraData* extra_data = | |
|
Alpha Left Google
2013/12/02 19:11:38
track.isNull() can be true and extra_data can also
no longer working on chromium
2013/12/03 11:45:45
The sinks are depending on the track, and they sho
| |
| 19 static_cast<MediaStreamTrackExtraData*>(track.extraData()); | |
| 20 DCHECK(extra_data->is_local_track()); | |
| 21 WebRtcLocalAudioTrack* audio_track = | |
| 22 static_cast<WebRtcLocalAudioTrack*>(extra_data->track().get()); | |
| 23 audio_track->AddSink(sink); | |
| 24 } | |
| 25 | |
| 26 void RemoveFromAudioTrack(MediaStreamAudioSink* sink, | |
| 27 const blink::WebMediaStreamTrack& track) { | |
| 28 MediaStreamTrackExtraData* extra_data = | |
| 29 static_cast<MediaStreamTrackExtraData*>(track.extraData()); | |
| 30 DCHECK(extra_data->is_local_track()); | |
| 31 WebRtcLocalAudioTrack* audio_track = | |
| 32 static_cast<WebRtcLocalAudioTrack*>(extra_data->track().get()); | |
| 33 audio_track->RemoveSink(sink); | |
| 34 } | |
| 35 | |
| 36 } // namespace content | |
| OLD | NEW |