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/public/common/media_stream_request.h" | 5 #include "content/public/common/media_stream_request.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 bool MediaStreamDevice::IsEqual(const MediaStreamDevice& second) const { | 61 bool MediaStreamDevice::IsEqual(const MediaStreamDevice& second) const { |
62 const AudioDeviceParameters& input_second = second.input; | 62 const AudioDeviceParameters& input_second = second.input; |
63 return type == second.type && | 63 return type == second.type && |
64 name == second.name && | 64 name == second.name && |
65 id == second.id && | 65 id == second.id && |
66 input.sample_rate == input_second.sample_rate && | 66 input.sample_rate == input_second.sample_rate && |
67 input.channel_layout == input_second.channel_layout; | 67 input.channel_layout == input_second.channel_layout; |
68 } | 68 } |
69 | 69 |
| 70 MediaStreamDevices::MediaStreamDevices() {} |
| 71 |
| 72 MediaStreamDevices::MediaStreamDevices(size_t count, |
| 73 const MediaStreamDevice& value) |
| 74 : std::vector<MediaStreamDevice>(count, value) { |
| 75 } |
| 76 |
| 77 const MediaStreamDevice* MediaStreamDevices::FindById( |
| 78 const std::string& device_id) const { |
| 79 for (const_iterator iter = begin(); iter != end(); ++iter) { |
| 80 if (iter->id == device_id) |
| 81 return &(*iter); |
| 82 } |
| 83 return NULL; |
| 84 } |
| 85 |
70 MediaStreamRequest::MediaStreamRequest( | 86 MediaStreamRequest::MediaStreamRequest( |
71 int render_process_id, | 87 int render_process_id, |
72 int render_view_id, | 88 int render_view_id, |
73 int page_request_id, | 89 int page_request_id, |
74 const GURL& security_origin, | 90 const GURL& security_origin, |
75 bool user_gesture, | 91 bool user_gesture, |
76 MediaStreamRequestType request_type, | 92 MediaStreamRequestType request_type, |
77 const std::string& requested_audio_device_id, | 93 const std::string& requested_audio_device_id, |
78 const std::string& requested_video_device_id, | 94 const std::string& requested_video_device_id, |
79 MediaStreamType audio_type, | 95 MediaStreamType audio_type, |
80 MediaStreamType video_type) | 96 MediaStreamType video_type) |
81 : render_process_id(render_process_id), | 97 : render_process_id(render_process_id), |
82 render_view_id(render_view_id), | 98 render_view_id(render_view_id), |
83 page_request_id(page_request_id), | 99 page_request_id(page_request_id), |
84 security_origin(security_origin), | 100 security_origin(security_origin), |
85 user_gesture(user_gesture), | 101 user_gesture(user_gesture), |
86 request_type(request_type), | 102 request_type(request_type), |
87 requested_audio_device_id(requested_audio_device_id), | 103 requested_audio_device_id(requested_audio_device_id), |
88 requested_video_device_id(requested_video_device_id), | 104 requested_video_device_id(requested_video_device_id), |
89 audio_type(audio_type), | 105 audio_type(audio_type), |
90 video_type(video_type) { | 106 video_type(video_type) { |
91 } | 107 } |
92 | 108 |
93 MediaStreamRequest::~MediaStreamRequest() {} | 109 MediaStreamRequest::~MediaStreamRequest() {} |
94 | 110 |
95 } // namespace content | 111 } // namespace content |
OLD | NEW |