| 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/browser/renderer_host/media/video_capture_manager.h" | 5 #include "content/browser/renderer_host/media/video_capture_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 | 543 |
| 544 if (entry->stream_type == MEDIA_DESKTOP_VIDEO_CAPTURE) { | 544 if (entry->stream_type == MEDIA_DESKTOP_VIDEO_CAPTURE) { |
| 545 const media::VideoCaptureSessionId session_id = | 545 const media::VideoCaptureSessionId session_id = |
| 546 device_start_queue_.front().session_id(); | 546 device_start_queue_.front().session_id(); |
| 547 DCHECK(session_id != kFakeSessionId); | 547 DCHECK(session_id != kFakeSessionId); |
| 548 MaybePostDesktopCaptureWindowId(session_id); | 548 MaybePostDesktopCaptureWindowId(session_id); |
| 549 } | 549 } |
| 550 | 550 |
| 551 auto request = photo_request_queue_.begin(); | 551 auto request = photo_request_queue_.begin(); |
| 552 while(request != photo_request_queue_.end()) { | 552 while(request != photo_request_queue_.end()) { |
| 553 if (GetDeviceEntryBySessionId(request->first)->video_capture_device()) { | 553 DeviceEntry* maybe_entry = GetDeviceEntryBySessionId(request->first); |
| 554 request->second.Run(entry->video_capture_device()); | 554 if (maybe_entry && maybe_entry->video_capture_device()) { |
| 555 request->second.Run(maybe_entry->video_capture_device()); |
| 555 photo_request_queue_.erase(request); | 556 photo_request_queue_.erase(request); |
| 556 } | 557 } |
| 557 ++request; | 558 ++request; |
| 558 } | 559 } |
| 559 } | 560 } |
| 560 | 561 |
| 561 device_start_queue_.pop_front(); | 562 device_start_queue_.pop_front(); |
| 562 HandleQueuedStartRequest(); | 563 HandleQueuedStartRequest(); |
| 563 } | 564 } |
| 564 | 565 |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 if (!device_in_queue) { | 1283 if (!device_in_queue) { |
| 1283 // Session ID is only valid for Screen capture. So we can fake it to | 1284 // Session ID is only valid for Screen capture. So we can fake it to |
| 1284 // resume video capture devices here. | 1285 // resume video capture devices here. |
| 1285 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters); | 1286 QueueStartDevice(kFakeSessionId, entry.get(), entry->parameters); |
| 1286 } | 1287 } |
| 1287 } | 1288 } |
| 1288 } | 1289 } |
| 1289 #endif // defined(OS_ANDROID) | 1290 #endif // defined(OS_ANDROID) |
| 1290 | 1291 |
| 1291 } // namespace content | 1292 } // namespace content |
| OLD | NEW |