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

Side by Side Diff: content/browser/renderer_host/media/media_stream_manager.cc

Issue 11298006: Browser-wide audio mirroring for TabCapture API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last nit Created 8 years 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 | Annotate | Revision Log
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/browser/renderer_host/media/media_stream_manager.h" 5 #include "content/browser/renderer_host/media/media_stream_manager.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 if (options.video_type != MEDIA_TAB_VIDEO_CAPTURE && 103 if (options.video_type != MEDIA_TAB_VIDEO_CAPTURE &&
104 options.audio_type != MEDIA_TAB_AUDIO_CAPTURE) 104 options.audio_type != MEDIA_TAB_AUDIO_CAPTURE)
105 return; 105 return;
106 106
107 MediaObserver* media_observer = 107 MediaObserver* media_observer =
108 GetContentClient()->browser()->GetMediaObserver(); 108 GetContentClient()->browser()->GetMediaObserver();
109 if (media_observer == NULL) 109 if (media_observer == NULL)
110 return; 110 return;
111 111
112 // If we appended a device_id scheme, we want to remove it when notifying
113 // observers which may be in different modules since this scheme is only
114 // used internally within the content module.
115 std::string device_id =
116 WebContentsCaptureUtil::StripWebContentsDeviceScheme(
117 requested_device_id);
118
112 media_observer->OnMediaRequestStateChanged( 119 media_observer->OnMediaRequestStateChanged(
113 render_process_id, render_view_id, 120 render_process_id, render_view_id,
114 MediaStreamDevice( 121 MediaStreamDevice(
115 stream_type, requested_device_id, requested_device_id), new_state); 122 stream_type, device_id, device_id), new_state);
116 } 123 }
117 124
118 MediaRequestState getState(MediaStreamType stream_type) const { 125 MediaRequestState getState(MediaStreamType stream_type) const {
119 return state_[stream_type]; 126 return state_[stream_type];
120 } 127 }
121 128
122 MediaStreamRequester* requester; // Can be NULL. 129 MediaStreamRequester* requester; // Can be NULL.
123 StreamOptions options; 130 StreamOptions options;
124 RequestType type; 131 RequestType type;
125 int render_process_id; 132 int render_process_id;
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 } 1081 }
1075 1082
1076 // Always do enumeration even though some enumeration is in progress, 1083 // Always do enumeration even though some enumeration is in progress,
1077 // because those enumeration commands could be sent before these devices 1084 // because those enumeration commands could be sent before these devices
1078 // change. 1085 // change.
1079 ++active_enumeration_ref_count_[stream_type]; 1086 ++active_enumeration_ref_count_[stream_type];
1080 GetDeviceManager(stream_type)->EnumerateDevices(); 1087 GetDeviceManager(stream_type)->EnumerateDevices();
1081 } 1088 }
1082 1089
1083 } // namespace content 1090 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698