X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontent%2Fbrowser%2Frenderer_host%2Fmedia%2Fvideo_capture_host.cc;h=cc340e3dd80182520dfbf3a5ac20024d7097614f;hb=3545e9f2671f595d2a2f3ee75ca0393b01e35ef6;hp=604cb323be12741569cdd7cd8fa2541cac4bc02b;hpb=7d210d4c7e9ba36e635eabc5b5780495f8a63292;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/content/browser/renderer_host/media/video_capture_host.cc b/src/content/browser/renderer_host/media/video_capture_host.cc index 604cb32..cc340e3 100644 --- a/src/content/browser/renderer_host/media/video_capture_host.cc +++ b/src/content/browser/renderer_host/media/video_capture_host.cc @@ -77,6 +77,7 @@ void VideoCaptureHost::OnBufferReady( const VideoCaptureControllerID& controller_id, int buffer_id, const media::VideoCaptureFormat& frame_format, + const gfx::Rect& visible_rect, base::TimeTicks timestamp) { BrowserThread::PostTask( BrowserThread::IO, @@ -86,6 +87,7 @@ void VideoCaptureHost::OnBufferReady( controller_id, buffer_id, frame_format, + visible_rect, timestamp)); } @@ -143,6 +145,7 @@ void VideoCaptureHost::DoSendFilledBufferOnIOThread( const VideoCaptureControllerID& controller_id, int buffer_id, const media::VideoCaptureFormat& format, + const gfx::Rect& visible_rect, base::TimeTicks timestamp) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -150,7 +153,7 @@ void VideoCaptureHost::DoSendFilledBufferOnIOThread( return; Send(new VideoCaptureMsg_BufferReady( - controller_id.device_id, buffer_id, format, timestamp)); + controller_id.device_id, buffer_id, format, visible_rect, timestamp)); } void VideoCaptureHost::DoSendFilledMailboxBufferOnIOThread( @@ -199,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, @@ -218,9 +222,11 @@ void VideoCaptureHost::OnStartCapture(int device_id, DVLOG(1) << "VideoCaptureHost::OnStartCapture:" << " session_id=" << session_id << ", device_id=" << device_id - << ", format=" << params.requested_format.frame_size.ToString() + << ", format=" << params.requested_format.ToString() << "@" << params.requested_format.frame_rate - << " (" << (params.allow_resolution_change ? "variable" : "constant") + << " (" << (params.resolution_change_policy == + media::RESOLUTION_POLICY_DYNAMIC_WITHIN_LIMIT ? + "variable" : "constant") << ")"; VideoCaptureControllerID controller_id(device_id); if (entries_.find(controller_id) != entries_.end()) { @@ -290,8 +296,34 @@ 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( + it->second.get(), controller_id, this); + } +} + +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( + session_id, params, it->second.get(), controller_id, this); + } } void VideoCaptureHost::OnReceiveEmptyBuffer(int device_id,