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

Side by Side Diff: content/public/common/media_stream_request.h

Issue 2291893002: Let Contraints Controll Mute/Unmute Audio Local Playback For Desktop Sharing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename To DisableLocalEcho Created 4 years, 3 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 #ifndef CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
6 #define CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ 6 #define CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 typedef std::map<MediaStreamType, MediaStreamDevices> MediaStreamDeviceMap; 197 typedef std::map<MediaStreamType, MediaStreamDevices> MediaStreamDeviceMap;
198 198
199 // Represents a request for media streams (audio/video). 199 // Represents a request for media streams (audio/video).
200 // TODO(vrk): Decouple MediaStreamDevice from this header file so that 200 // TODO(vrk): Decouple MediaStreamDevice from this header file so that
201 // media_stream_options.h no longer depends on this file. 201 // media_stream_options.h no longer depends on this file.
202 // TODO(vrk,justinlin,wjia): Figure out a way to share this code cleanly between 202 // TODO(vrk,justinlin,wjia): Figure out a way to share this code cleanly between
203 // vanilla WebRTC, Tab Capture, and Pepper Video Capture. Right now there is 203 // vanilla WebRTC, Tab Capture, and Pepper Video Capture. Right now there is
204 // Tab-only stuff and Pepper-only stuff being passed around to all clients, 204 // Tab-only stuff and Pepper-only stuff being passed around to all clients,
205 // which is icky. 205 // which is icky.
206 struct CONTENT_EXPORT MediaStreamRequest { 206 struct CONTENT_EXPORT MediaStreamRequest {
207 MediaStreamRequest( 207 MediaStreamRequest(int render_process_id,
208 int render_process_id, 208 int render_frame_id,
209 int render_frame_id, 209 int page_request_id,
210 int page_request_id, 210 const GURL& security_origin,
211 const GURL& security_origin, 211 bool user_gesture,
212 bool user_gesture, 212 MediaStreamRequestType request_type,
213 MediaStreamRequestType request_type, 213 const std::string& requested_audio_device_id,
214 const std::string& requested_audio_device_id, 214 const std::string& requested_video_device_id,
215 const std::string& requested_video_device_id, 215 MediaStreamType audio_type,
216 MediaStreamType audio_type, 216 MediaStreamType video_type,
217 MediaStreamType video_type); 217 bool disable_local_echo);
218 218
219 MediaStreamRequest(const MediaStreamRequest& other); 219 MediaStreamRequest(const MediaStreamRequest& other);
220 220
221 ~MediaStreamRequest(); 221 ~MediaStreamRequest();
222 222
223 // This is the render process id for the renderer associated with generating 223 // This is the render process id for the renderer associated with generating
224 // frames for a MediaStream. Any indicators associated with a capture will be 224 // frames for a MediaStream. Any indicators associated with a capture will be
225 // displayed for this renderer. 225 // displayed for this renderer.
226 int render_process_id; 226 int render_process_id;
227 227
(...skipping 21 matching lines...) Expand all
249 // Stores the requested raw device id for physical audio or video devices. 249 // Stores the requested raw device id for physical audio or video devices.
250 std::string requested_audio_device_id; 250 std::string requested_audio_device_id;
251 std::string requested_video_device_id; 251 std::string requested_video_device_id;
252 252
253 // Flag to indicate if the request contains audio. 253 // Flag to indicate if the request contains audio.
254 MediaStreamType audio_type; 254 MediaStreamType audio_type;
255 255
256 // Flag to indicate if the request contains video. 256 // Flag to indicate if the request contains video.
257 MediaStreamType video_type; 257 MediaStreamType video_type;
258 258
259 // Flag for desktop share to indicate whether to mute the source audio during
miu 2016/09/16 21:22:48 nit: s/desktop share/Desktop or WebContents captur
qiangchen 2016/09/16 22:02:24 Done.
260 // sharing.
261 bool disable_local_echo;
262
259 // True if all ancestors of the requesting frame have the same origin. 263 // True if all ancestors of the requesting frame have the same origin.
260 bool all_ancestors_have_same_origin; 264 bool all_ancestors_have_same_origin;
261 }; 265 };
262 266
263 // Interface used by the content layer to notify chrome about changes in the 267 // Interface used by the content layer to notify chrome about changes in the
264 // state of a media stream. Instances of this class are passed to content layer 268 // state of a media stream. Instances of this class are passed to content layer
265 // when MediaStream access is approved using MediaResponseCallback. 269 // when MediaStream access is approved using MediaResponseCallback.
266 class MediaStreamUI { 270 class MediaStreamUI {
267 public: 271 public:
268 virtual ~MediaStreamUI() {} 272 virtual ~MediaStreamUI() {}
269 273
270 // Called when MediaStream capturing is started. Chrome layer can call |stop| 274 // Called when MediaStream capturing is started. Chrome layer can call |stop|
271 // to stop the stream. Returns the platform-dependent window ID for the UI, or 275 // to stop the stream. Returns the platform-dependent window ID for the UI, or
272 // 0 if not applicable. 276 // 0 if not applicable.
273 virtual gfx::NativeViewId OnStarted(const base::Closure& stop) = 0; 277 virtual gfx::NativeViewId OnStarted(const base::Closure& stop) = 0;
274 }; 278 };
275 279
276 // Callback used return results of media access requests. 280 // Callback used return results of media access requests.
277 typedef base::Callback<void(const MediaStreamDevices& devices, 281 typedef base::Callback<void(const MediaStreamDevices& devices,
278 content::MediaStreamRequestResult result, 282 content::MediaStreamRequestResult result,
279 std::unique_ptr<MediaStreamUI> ui)> 283 std::unique_ptr<MediaStreamUI> ui)>
280 MediaResponseCallback; 284 MediaResponseCallback;
281 285
282 } // namespace content 286 } // namespace content
283 287
284 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ 288 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698