| 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/user_media_client_impl.h" | 5 #include "content/renderer/media/user_media_client_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 void UserMediaClientImpl::OnDevicesEnumerated( | 720 void UserMediaClientImpl::OnDevicesEnumerated( |
| 721 int request_id, | 721 int request_id, |
| 722 const StreamDeviceInfoArray& device_array) { | 722 const StreamDeviceInfoArray& device_array) { |
| 723 DVLOG(1) << "UserMediaClientImpl::OnDevicesEnumerated(" << request_id << ")"; | 723 DVLOG(1) << "UserMediaClientImpl::OnDevicesEnumerated(" << request_id << ")"; |
| 724 | 724 |
| 725 MediaDevicesRequestInfo* request = FindMediaDevicesRequestInfo(request_id); | 725 MediaDevicesRequestInfo* request = FindMediaDevicesRequestInfo(request_id); |
| 726 DCHECK(request); | 726 DCHECK(request); |
| 727 | 727 |
| 728 if (request_id == request->audio_input_request_id) { | 728 if (request_id == request->audio_input_request_id) { |
| 729 request->has_audio_input_returned = true; | 729 request->has_audio_input_returned = true; |
| 730 DCHECK(request->audio_input_devices.empty()); | |
| 731 request->audio_input_devices = device_array; | 730 request->audio_input_devices = device_array; |
| 732 } else if (request_id == request->video_input_request_id) { | 731 } else if (request_id == request->video_input_request_id) { |
| 733 request->has_video_input_returned = true; | 732 request->has_video_input_returned = true; |
| 734 DCHECK(request->video_input_devices.empty()); | |
| 735 request->video_input_devices = device_array; | 733 request->video_input_devices = device_array; |
| 736 } else { | 734 } else { |
| 737 DCHECK_EQ(request->audio_output_request_id, request_id); | 735 DCHECK_EQ(request->audio_output_request_id, request_id); |
| 738 request->has_audio_output_returned = true; | 736 request->has_audio_output_returned = true; |
| 739 DCHECK(request->audio_output_devices.empty()); | |
| 740 request->audio_output_devices = device_array; | 737 request->audio_output_devices = device_array; |
| 741 } | 738 } |
| 742 | 739 |
| 743 if (!request->has_audio_input_returned || | 740 if (!request->has_audio_input_returned || |
| 744 !request->has_video_input_returned || | 741 !request->has_video_input_returned || |
| 745 (!request->IsSourcesRequest() && !request->has_audio_output_returned)) { | 742 (!request->IsSourcesRequest() && !request->has_audio_output_returned)) { |
| 746 // Wait for the rest of the devices to complete. | 743 // Wait for the rest of the devices to complete. |
| 747 return; | 744 return; |
| 748 } | 745 } |
| 749 | 746 |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1143 return; | 1140 return; |
| 1144 } | 1141 } |
| 1145 } | 1142 } |
| 1146 } | 1143 } |
| 1147 | 1144 |
| 1148 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { | 1145 bool UserMediaClientImpl::UserMediaRequestInfo::HasPendingSources() const { |
| 1149 return !sources_waiting_for_callback_.empty(); | 1146 return !sources_waiting_for_callback_.empty(); |
| 1150 } | 1147 } |
| 1151 | 1148 |
| 1152 } // namespace content | 1149 } // namespace content |
| OLD | NEW |