Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: content/renderer/media/media_stream_center.cc

Issue 1721273002: MediaStream audio object graph untangling and clean-ups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests broken by recent MSAudioTrack::Stop() reworking. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_center.h" 5 #include "content/renderer/media/media_stream_center.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "content/common/media/media_stream_messages.h" 13 #include "content/common/media/media_stream_messages.h"
14 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
15 #include "content/public/renderer/media_stream_audio_sink.h" 15 #include "content/public/renderer/media_stream_audio_sink.h"
16 #include "content/public/renderer/render_thread.h" 16 #include "content/public/renderer/render_thread.h"
17 #include "content/renderer/media/media_stream.h" 17 #include "content/renderer/media/media_stream.h"
18 #include "content/renderer/media/media_stream_audio_track.h"
18 #include "content/renderer/media/media_stream_source.h" 19 #include "content/renderer/media/media_stream_source.h"
19 #include "content/renderer/media/media_stream_video_source.h" 20 #include "content/renderer/media/media_stream_video_source.h"
20 #include "content/renderer/media/media_stream_video_track.h" 21 #include "content/renderer/media/media_stream_video_track.h"
21 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" 22 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
22 #include "content/renderer/media/webrtc_local_audio_source_provider.h" 23 #include "content/renderer/media/webrtc_local_audio_source_provider.h"
23 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" 24 #include "third_party/WebKit/public/platform/WebMediaConstraints.h"
24 #include "third_party/WebKit/public/platform/WebMediaStream.h" 25 #include "third_party/WebKit/public/platform/WebMediaStream.h"
25 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h" 26 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h"
26 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" 27 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
27 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" 28 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
28 #include "third_party/WebKit/public/platform/WebMediaStreamTrackSourcesRequest.h " 29 #include "third_party/WebKit/public/platform/WebMediaStreamTrackSourcesRequest.h "
29 #include "third_party/WebKit/public/platform/WebSourceInfo.h" 30 #include "third_party/WebKit/public/platform/WebSourceInfo.h"
30 #include "third_party/WebKit/public/platform/WebVector.h" 31 #include "third_party/WebKit/public/platform/WebVector.h"
31 #include "third_party/WebKit/public/web/WebFrame.h" 32 #include "third_party/WebKit/public/web/WebFrame.h"
32 33
33 using blink::WebFrame; 34 using blink::WebFrame;
34 using blink::WebView; 35 using blink::WebView;
35 36
36 namespace content { 37 namespace content {
37 38
38 namespace { 39 namespace {
39 40
40 void CreateNativeAudioMediaStreamTrack( 41 void CreateNativeAudioMediaStreamTrack(
41 const blink::WebMediaStreamTrack& track, 42 const blink::WebMediaStreamTrack& track,
42 PeerConnectionDependencyFactory* factory) { 43 PeerConnectionDependencyFactory* factory) {
43 DCHECK(!track.extraData()); 44 DCHECK(!MediaStreamAudioTrack::From(track));
44 blink::WebMediaStreamSource source = track.source(); 45 blink::WebMediaStreamSource source = track.source();
45 DCHECK_EQ(source.getType(), blink::WebMediaStreamSource::TypeAudio); 46 DCHECK_EQ(source.getType(), blink::WebMediaStreamSource::TypeAudio);
46 if (source.remote()) { 47 if (source.remote()) {
47 factory->CreateRemoteAudioTrack(track); 48 factory->CreateRemoteAudioTrack(track);
48 } else { 49 } else {
49 factory->CreateLocalAudioTrack(track); 50 factory->CreateLocalAudioTrack(track);
50 } 51 }
51 } 52 }
52 53
53 void CreateNativeVideoMediaStreamTrack( 54 void CreateNativeVideoMediaStreamTrack(
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 185
185 bool MediaStreamCenter::didRemoveMediaStreamTrack( 186 bool MediaStreamCenter::didRemoveMediaStreamTrack(
186 const blink::WebMediaStream& stream, 187 const blink::WebMediaStream& stream,
187 const blink::WebMediaStreamTrack& track) { 188 const blink::WebMediaStreamTrack& track) {
188 DVLOG(1) << "MediaStreamCenter::didRemoveMediaStreamTrack"; 189 DVLOG(1) << "MediaStreamCenter::didRemoveMediaStreamTrack";
189 MediaStream* native_stream = MediaStream::GetMediaStream(stream); 190 MediaStream* native_stream = MediaStream::GetMediaStream(stream);
190 return native_stream->RemoveTrack(track); 191 return native_stream->RemoveTrack(track);
191 } 192 }
192 193
193 } // namespace content 194 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698