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

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

Issue 312773002: Support for audio output devices for getMediaDevices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | 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/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 "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 AddAudioDeviceToArray(); 60 AddAudioDeviceToArray();
61 } else if (type == MEDIA_DEVICE_VIDEO_CAPTURE) { 61 } else if (type == MEDIA_DEVICE_VIDEO_CAPTURE) {
62 video_request_id_ = request_id; 62 video_request_id_ = request_id;
63 video_array_.clear(); 63 video_array_.clear();
64 AddVideoDeviceToArray(); 64 AddVideoDeviceToArray();
65 } 65 }
66 } 66 }
67 67
68 void MockMediaStreamDispatcher::StopStreamDevice( 68 void MockMediaStreamDispatcher::StopStreamDevice(
69 const StreamDeviceInfo& device_info) { 69 const StreamDeviceInfo& device_info) {
70 if (IsAudioMediaType(device_info.device.type)) { 70 if (IsAudioInputMediaType(device_info.device.type)) {
71 ++stop_audio_device_counter_; 71 ++stop_audio_device_counter_;
72 return; 72 return;
73 } 73 }
74 if (IsVideoMediaType(device_info.device.type)) { 74 if (IsVideoMediaType(device_info.device.type)) {
75 ++stop_video_device_counter_; 75 ++stop_video_device_counter_;
76 return; 76 return;
77 } 77 }
78 NOTREACHED(); 78 NOTREACHED();
79 } 79 }
80 80
(...skipping 23 matching lines...) Expand all
104 void MockMediaStreamDispatcher::AddVideoDeviceToArray() { 104 void MockMediaStreamDispatcher::AddVideoDeviceToArray() {
105 StreamDeviceInfo video; 105 StreamDeviceInfo video;
106 video.device.id = "video_device_id" + base::IntToString(session_id_); 106 video.device.id = "video_device_id" + base::IntToString(session_id_);
107 video.device.name = "usb video camera"; 107 video.device.name = "usb video camera";
108 video.device.type = MEDIA_DEVICE_VIDEO_CAPTURE; 108 video.device.type = MEDIA_DEVICE_VIDEO_CAPTURE;
109 video.session_id = session_id_; 109 video.session_id = session_id_;
110 video_array_.push_back(video); 110 video_array_.push_back(video);
111 } 111 }
112 112
113 } // namespace content 113 } // namespace content
OLDNEW
« content/renderer/media/media_stream_impl.cc ('K') | « content/renderer/media/media_stream_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698