Chromium Code Reviews| Index: content/browser/renderer_host/media/video_capture_manager.cc |
| diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc |
| index 6568407bdfdf5042ebdc69c83106492945788bb9..817a81c1cff1b2c579c7c460580bc77b1def5514 100644 |
| --- a/content/browser/renderer_host/media/video_capture_manager.cc |
| +++ b/content/browser/renderer_host/media/video_capture_manager.cc |
| @@ -96,13 +96,22 @@ VideoCaptureManager::VideoCaptureManager( |
| scoped_ptr<media::VideoCaptureDeviceFactory> factory) |
| : listener_(NULL), |
| new_capture_session_id_(1), |
| - video_capture_device_factory_(factory.Pass()) { |
| + video_capture_device_factory_(factory.Pass()), |
| + display_rotation_(gfx::Display::ROTATE_0) { |
| } |
| VideoCaptureManager::~VideoCaptureManager() { |
| DCHECK(devices_.empty()); |
| } |
| +void VideoCaptureManager::SetDisplayRotation(gfx::Display::Rotation rotation) { |
| + display_rotation_ = rotation; |
|
vrk (LEFT CHROMIUM)
2014/05/08 21:43:34
Set this field on IO thread as well so as to keep
Zachary Kuznia
2014/05/08 21:51:22
Done.
|
| + device_task_runner_->PostTask( |
| + FROM_HERE, |
| + base::Bind(&VideoCaptureManager::SetDisplayRotationOnDeviceThread, |
| + this, rotation)); |
| +} |
| + |
| void VideoCaptureManager::Register( |
| MediaStreamProviderListener* listener, |
| const scoped_refptr<base::SingleThreadTaskRunner>& device_task_runner) { |
| @@ -579,6 +588,9 @@ VideoCaptureManager::DeviceEntry* VideoCaptureManager::GetOrCreateDeviceEntry( |
| scoped_ptr<VideoCaptureController> video_capture_controller( |
| new VideoCaptureController()); |
| + |
| + if (device_info.type == MEDIA_DEVICE_VIDEO_CAPTURE) |
| + video_capture_controller->SetDisplayRotation(display_rotation_); |
| DeviceEntry* new_device = new DeviceEntry(device_info.type, |
| device_info.id, |
| video_capture_controller.Pass()); |
| @@ -618,4 +630,15 @@ void VideoCaptureManager::SaveDesktopCaptureWindowIdOnDeviceThread( |
| notification_window_ids_[session_id] = window_id; |
| } |
| +void VideoCaptureManager::SetDisplayRotationOnDeviceThread( |
| + gfx::Display::Rotation rotation) { |
| + DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| + for (DeviceEntries::iterator it = devices_.begin(); |
| + it != devices_.end(); ++it) { |
| + DeviceEntry* device = *it; |
| + if (device->stream_type == MEDIA_DEVICE_VIDEO_CAPTURE) |
| + device->video_capture_controller->SetDisplayRotation(rotation); |
| + } |
| +} |
| + |
| } // namespace content |