Chromium Code Reviews| Index: media/video/capture/linux/video_capture_device_linux.cc |
| diff --git a/media/video/capture/linux/video_capture_device_linux.cc b/media/video/capture/linux/video_capture_device_linux.cc |
| index 60d8f77d55cfe0497fe3835cdfe76f6016ff037a..5d3b12c1459a0944a77d773d3b585344b2103266 100644 |
| --- a/media/video/capture/linux/video_capture_device_linux.cc |
| +++ b/media/video/capture/linux/video_capture_device_linux.cc |
| @@ -362,6 +362,14 @@ void VideoCaptureDeviceLinux::V4L2CaptureDelegate::AllocateAndStart( |
| capture_format_.pixel_format = |
| V4l2FourCcToChromiumPixelFormat(video_fmt.fmt.pix.pixelformat); |
| + if (capture_format_.pixel_format == PIXEL_FORMAT_MJPEG) { |
| + // TODO(kcwu) remove this hacky api |
| + if (!client_->InitializeJpegDecoder()) { |
|
wuchengli
2015/03/23 06:30:15
How about calling this when |last_captured_pixel_f
kcwu
2015/03/30 18:12:14
Done.
|
| + SetErrorState("InitializeJpegDecoder failed"); |
| + return; |
| + } |
| + } |
| + |
| if (!AllocateVideoBuffers()) { |
| SetErrorState("Allocate buffer failed (Cannot recover from this error)"); |
| return; |
| @@ -438,6 +446,7 @@ void VideoCaptureDeviceLinux::V4L2CaptureDelegate::DoCapture() { |
| v4l2_buffer buffer = {}; |
| buffer.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
| buffer.memory = V4L2_MEMORY_MMAP; |
| + LOG(ERROR) << "DQBUF"; |
| if (HANDLE_EINTR(ioctl(device_fd_.get(), VIDIOC_DQBUF, &buffer)) < 0) { |
| SetErrorState("Failed to dequeue capture buffer"); |
| return; |
| @@ -449,6 +458,7 @@ void VideoCaptureDeviceLinux::V4L2CaptureDelegate::DoCapture() { |
| rotation_, |
| base::TimeTicks::Now()); |
| + LOG(ERROR) << "QBUF"; |
| if (HANDLE_EINTR(ioctl(device_fd_.get(), VIDIOC_QBUF, &buffer)) < 0) |
| SetErrorState("Failed to enqueue capture buffer"); |
| } |