| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |