PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_VideoCapture_Close,
OnClose)
PPAPI_END_MESSAGE_MAP()
+ LOG(ERROR) << "Resource message unresolved";
return PP_ERROR_FAILED;
}
const std::string& device_id,
const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count) {
- if (platform_video_capture_.get())
+ if (platform_video_capture_.get()) {
+ LOG(ERROR) << "Platform video capture is not NULL";
return PP_ERROR_FAILED;
+ }
SetRequestedInfo(requested_info, buffer_count);
GURL document_url = renderer_ppapi_host_->GetDocumentURL(pp_instance());
- if (!document_url.is_valid())
+ if (!document_url.is_valid()) {
+ LOG(ERROR) << "Invalid document URL";
return PP_ERROR_FAILED;
+ }
platform_video_capture_ = std::make_unique<PepperPlatformVideoCapture>(
renderer_ppapi_host_->GetRenderFrameForInstance(pp_instance())
int32_t PepperVideoCaptureHost::OnStartCapture(
ppapi::host::HostMessageContext* context) {
if (!SetStatus(PP_VIDEO_CAPTURE_STATUS_STARTING, false) ||
- !platform_video_capture_.get())
+ !platform_video_capture_.get()) {
+ LOG(ERROR) << "Cannot set PP_VIDEO_CAPTURE_STATUS_STARTING status or "
+ << "platform video capture is NULL";
return PP_ERROR_FAILED;
+ }
DCHECK(buffers_.empty());
int32_t PepperVideoCaptureHost::OnReuseBuffer(
ppapi::host::HostMessageContext* context,
uint32_t buffer) {
- if (buffer >= buffers_.size() || !buffers_[buffer].in_use)
+ if (buffer >= buffers_.size() || !buffers_[buffer].in_use) {
+ LOG(ERROR) << "Wrong buffer ID: " << buffer << "Should be less than "
+ << buffers_.size() << " and should be in use, buffer.in_use ="
+ << buffers_[buffer].in_use;
return PP_ERROR_BADARGUMENT;
+ }
buffers_[buffer].in_use = false;
return PP_OK;
}
}
int32_t PepperVideoCaptureHost::StopCapture() {
- if (!SetStatus(PP_VIDEO_CAPTURE_STATUS_STOPPING, false))
+ if (!SetStatus(PP_VIDEO_CAPTURE_STATUS_STOPPING, false)) {
+ LOG(ERROR) << "Cannot set PP_VIDEO_CAPTURE_STATUS_STOPPING status";
return PP_ERROR_FAILED;
+ }
DCHECK(platform_video_capture_.get());