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

Side by Side Diff: content/browser/renderer_host/media/media_stream_manager.cc

Issue 2729783003: [Mojo Video Capture] Add content_browsertest for exercising video capture (Closed)
Patch Set: incorporated miu@'s suggestions Created 3 years, 9 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
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/browser/renderer_host/media/media_stream_manager.h" 5 #include "content/browser/renderer_host/media/media_stream_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 &state)) { 1510 &state)) {
1511 request->devices.push_back(device_info); 1511 request->devices.push_back(device_info);
1512 request->SetState(device_info.device.type, state); 1512 request->SetState(device_info.device.type, state);
1513 DVLOG(1) << "HandleAccessRequestResponse - device already opened " 1513 DVLOG(1) << "HandleAccessRequestResponse - device already opened "
1514 << ", {label = " << label << "}" 1514 << ", {label = " << label << "}"
1515 << ", device_id = " << device.id << "}"; 1515 << ", device_id = " << device.id << "}";
1516 continue; 1516 continue;
1517 } 1517 }
1518 } 1518 }
1519 device_info.session_id = 1519 device_info.session_id =
1520 GetDeviceManager(device_info.device.type)->Open(device_info); 1520 GetDeviceManager(device_info.device.type)->Open(device_info.device);
1521 TranslateDeviceIdToSourceId(request, &device_info.device); 1521 TranslateDeviceIdToSourceId(request, &device_info.device);
1522 request->devices.push_back(device_info); 1522 request->devices.push_back(device_info);
1523 1523
1524 request->SetState(device_info.device.type, MEDIA_REQUEST_STATE_OPENING); 1524 request->SetState(device_info.device.type, MEDIA_REQUEST_STATE_OPENING);
1525 DVLOG(1) << "HandleAccessRequestResponse - opening device " 1525 DVLOG(1) << "HandleAccessRequestResponse - opening device "
1526 << ", {label = " << label << "}" 1526 << ", {label = " << label << "}"
1527 << ", {device_id = " << device_info.device.id << "}" 1527 << ", {device_id = " << device_info.device.id << "}"
1528 << ", {session_id = " << device_info.session_id << "}"; 1528 << ", {session_id = " << device_info.session_id << "}";
1529 } 1529 }
1530 1530
(...skipping 28 matching lines...) Expand all
1559 CancelRequest(label); 1559 CancelRequest(label);
1560 } 1560 }
1561 1561
1562 void MediaStreamManager::WillDestroyCurrentMessageLoop() { 1562 void MediaStreamManager::WillDestroyCurrentMessageLoop() {
1563 DVLOG(3) << "MediaStreamManager::WillDestroyCurrentMessageLoop()"; 1563 DVLOG(3) << "MediaStreamManager::WillDestroyCurrentMessageLoop()";
1564 DCHECK(CalledOnIOThread()); 1564 DCHECK(CalledOnIOThread());
1565 DCHECK(requests_.empty()); 1565 DCHECK(requests_.empty());
1566 if (media_devices_manager_) 1566 if (media_devices_manager_)
1567 media_devices_manager_->StopMonitoring(); 1567 media_devices_manager_->StopMonitoring();
1568 if (video_capture_manager_) 1568 if (video_capture_manager_)
1569 video_capture_manager_->UnregisterListener(); 1569 video_capture_manager_->UnregisterListener(this);
1570 if (audio_input_device_manager_) 1570 if (audio_input_device_manager_)
1571 audio_input_device_manager_->UnregisterListener(); 1571 audio_input_device_manager_->UnregisterListener(this);
1572 1572
1573 device_task_runner_ = nullptr; 1573 device_task_runner_ = nullptr;
1574 audio_input_device_manager_ = nullptr; 1574 audio_input_device_manager_ = nullptr;
1575 video_capture_manager_ = nullptr; 1575 video_capture_manager_ = nullptr;
1576 media_devices_manager_ = nullptr; 1576 media_devices_manager_ = nullptr;
1577 g_media_stream_manager_tls_ptr.Pointer()->Set(nullptr); 1577 g_media_stream_manager_tls_ptr.Pointer()->Set(nullptr);
1578 } 1578 }
1579 1579
1580 void MediaStreamManager::NotifyDevicesChanged( 1580 void MediaStreamManager::NotifyDevicesChanged(
1581 MediaDeviceType device_type, 1581 MediaDeviceType device_type,
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1768 return devices; 1768 return devices;
1769 1769
1770 for (auto& device : devices) { 1770 for (auto& device : devices) {
1771 device.camera_calibration = 1771 device.camera_calibration =
1772 video_capture_manager()->GetCameraCalibration(device.id); 1772 video_capture_manager()->GetCameraCalibration(device.id);
1773 } 1773 }
1774 return devices; 1774 return devices;
1775 } 1775 }
1776 1776
1777 } // namespace content 1777 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698