Chromium Code Reviews| Index: content/browser/renderer_host/media/video_capture_host.cc |
| diff --git a/content/browser/renderer_host/media/video_capture_host.cc b/content/browser/renderer_host/media/video_capture_host.cc |
| index 91a67b85dbe5036ce4f9b428726a954886016df2..504d3be6d1eb0ce67ad56dc3e6daf3b3be8ed697 100644 |
| --- a/content/browser/renderer_host/media/video_capture_host.cc |
| +++ b/content/browser/renderer_host/media/video_capture_host.cc |
| @@ -202,6 +202,7 @@ bool VideoCaptureHost::OnMessageReceived(const IPC::Message& message) { |
| IPC_BEGIN_MESSAGE_MAP(VideoCaptureHost, message) |
| IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Start, OnStartCapture) |
| IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Pause, OnPauseCapture) |
| + IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Resume, OnResumeCapture) |
| IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_Stop, OnStopCapture) |
| IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_BufferReady, OnReceiveEmptyBuffer) |
| IPC_MESSAGE_HANDLER(VideoCaptureHostMsg_GetDeviceSupportedFormats, |
| @@ -295,8 +296,36 @@ void VideoCaptureHost::OnStopCapture(int device_id) { |
| void VideoCaptureHost::OnPauseCapture(int device_id) { |
| DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| DVLOG(1) << "VideoCaptureHost::OnPauseCapture, device_id " << device_id; |
| - // Not used. |
| - Send(new VideoCaptureMsg_StateChanged(device_id, VIDEO_CAPTURE_STATE_ERROR)); |
| + |
| + VideoCaptureControllerID controller_id(device_id); |
| + EntryMap::iterator it = entries_.find(controller_id); |
| + if (it == entries_.end()) |
| + return; |
| + |
| + if (it->second) { |
| + media_stream_manager_->video_capture_manager()->PauseCaptureForClient( |
|
tommi (sloooow) - chröme
2014/10/01 07:17:03
fix indent
michaelbai
2014/10/01 22:09:33
Done.
|
| + it->second.get(), controller_id, this); |
| + } |
| + |
| + // Send PAUSED_STATE? |
|
tommi (sloooow) - chröme
2014/10/01 07:17:03
is this something for the next patch set?
michaelbai
2014/10/01 22:09:33
I don't think this ACK message is needed if curren
|
| +} |
| + |
| +void VideoCaptureHost::OnResumeCapture( |
| + int device_id, |
| + media::VideoCaptureSessionId session_id, |
| + const media::VideoCaptureParams& params) { |
| + DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| + DVLOG(1) << "VideoCaptureHost::OnResumeCapture, device_id " << device_id; |
| + |
| + VideoCaptureControllerID controller_id(device_id); |
| + EntryMap::iterator it = entries_.find(controller_id); |
| + if (it == entries_.end()) |
| + return; |
| + |
| + if (it->second) { |
| + media_stream_manager_->video_capture_manager()->ResumeCaptureForClient( |
|
tommi (sloooow) - chröme
2014/10/01 07:17:03
indent
michaelbai
2014/10/01 22:09:33
Done.
|
| + session_id, params, it->second.get(), controller_id, this); |
| + } |
| } |
| void VideoCaptureHost::OnReceiveEmptyBuffer(int device_id, |