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

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

Issue 2684233005: Revert of Use spec-compliant algorithm to select video devices in getUserMedia. (Closed)
Patch Set: Created 3 years, 10 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/mock_media_stream_dispatcher.h" 5 #include "content/renderer/media/mock_media_stream_dispatcher.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "content/public/common/media_stream_request.h" 8 #include "content/public/common/media_stream_request.h"
9 #include "media/base/audio_parameters.h" 9 #include "media/base/audio_parameters.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 12 matching lines...) Expand all
23 stop_video_device_counter_(0), 23 stop_video_device_counter_(0),
24 session_id_(0), 24 session_id_(0),
25 test_same_id_(false) {} 25 test_same_id_(false) {}
26 26
27 MockMediaStreamDispatcher::~MockMediaStreamDispatcher() {} 27 MockMediaStreamDispatcher::~MockMediaStreamDispatcher() {}
28 28
29 void MockMediaStreamDispatcher::GenerateStream( 29 void MockMediaStreamDispatcher::GenerateStream(
30 int request_id, 30 int request_id,
31 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler, 31 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler,
32 const StreamControls& controls, 32 const StreamControls& controls,
33 const url::Origin& security_origin, 33 const url::Origin& url) {
34 bool is_processing_user_gesture) {
35 // Audio and video share the same request so we use |audio_input_request_id_| 34 // Audio and video share the same request so we use |audio_input_request_id_|
36 // only. 35 // only.
37 audio_input_request_id_ = request_id; 36 audio_input_request_id_ = request_id;
38 37
39 stream_label_ = "local_stream" + base::IntToString(request_id); 38 stream_label_ = "local_stream" + base::IntToString(request_id);
40 audio_input_array_.clear(); 39 audio_input_array_.clear();
41 video_array_.clear(); 40 video_array_.clear();
42 41
43 if (controls.audio.requested) { 42 if (controls.audio.requested) {
44 AddAudioInputDeviceToArray(false, controls.audio.device_id); 43 AddAudioInputDeviceToArray(false, controls.audio.device_id);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 video.device.name = "usb video camera"; 110 video.device.name = "usb video camera";
112 video.device.type = MEDIA_DEVICE_VIDEO_CAPTURE; 111 video.device.type = MEDIA_DEVICE_VIDEO_CAPTURE;
113 video.device.video_facing = facing_user 112 video.device.video_facing = facing_user
114 ? media::MEDIA_VIDEO_FACING_USER 113 ? media::MEDIA_VIDEO_FACING_USER
115 : media::MEDIA_VIDEO_FACING_ENVIRONMENT; 114 : media::MEDIA_VIDEO_FACING_ENVIRONMENT;
116 video.session_id = session_id_; 115 video.session_id = session_id_;
117 video_array_.push_back(video); 116 video_array_.push_back(video);
118 } 117 }
119 118
120 } // namespace content 119 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/mock_media_stream_dispatcher.h ('k') | content/renderer/media/user_media_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698