diff options
author | mcasas <mcasas@chromium.org> | 2016-02-18 10:09:57 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-18 18:11:16 +0000 |
commit | a9349677919cf6ce59045869782109ce3ac0dd19 (patch) | |
tree | c53bf20a01cbb82c2a268c66fd37bf96a25cee58 /content/browser/renderer_host/media/video_capture_device_client.cc | |
parent | cf48b0a2409754f872d17335131bd14fd67b3f0b (diff) | |
download | chromium_src-a9349677919cf6ce59045869782109ce3ac0dd19.zip chromium_src-a9349677919cf6ce59045869782109ce3ac0dd19.tar.gz chromium_src-a9349677919cf6ce59045869782109ce3ac0dd19.tar.bz2 |
Remove V4L2CaptureDelegate{Single,Multi}Plane, VCD::Client::OnIncomingCapturedYuvData()
this CL:
- removes both V4L2CaptureDelegateMultiPlane and
V4L2CaptureDelegateSinglePlane, leaving only the single
plane version, which is intelligently blended into
their parent class V4L2CaptureDelegate.
- Since the former class is the only user of
VideoCaptureDevice::Client::OnIncomingCapturedYuvData(),
that method is removed (yay!).
- Also cleaned up a bit here and there.
- VideoCaptureDeviceClientTest also updated and
improved.
BUG=585519
Review URL: https://codereview.chromium.org/1685713003
Cr-Commit-Position: refs/heads/master@{#376200}
Diffstat (limited to 'content/browser/renderer_host/media/video_capture_device_client.cc')
-rw-r--r-- | content/browser/renderer_host/media/video_capture_device_client.cc | 58 |
1 files changed, 4 insertions, 54 deletions
diff --git a/content/browser/renderer_host/media/video_capture_device_client.cc b/content/browser/renderer_host/media/video_capture_device_client.cc index b4d142e..03d64d2 100644 --- a/content/browser/renderer_host/media/video_capture_device_client.cc +++ b/content/browser/renderer_host/media/video_capture_device_client.cc @@ -188,10 +188,10 @@ void VideoCaptureDeviceClient::OnIncomingCapturedData( NOTREACHED() << "RGB24 is only available in Linux and Windows platforms"; #endif #if defined(OS_WIN) - // TODO(wjia): Currently, for RGB24 on WIN, capture device always - // passes in positive src_width and src_height. Remove this hardcoded - // value when nagative src_height is supported. The negative src_height - // indicates that vertical flipping is needed. + // TODO(wjia): Currently, for RGB24 on WIN, capture device always passes + // in positive src_width and src_height. Remove this hardcoded value when + // negative src_height is supported. The negative src_height indicates + // that vertical flipping is needed. flip = true; #endif break; @@ -256,56 +256,6 @@ void VideoCaptureDeviceClient::OnIncomingCapturedData( OnIncomingCapturedBuffer(std::move(buffer), output_format, timestamp); } -void VideoCaptureDeviceClient::OnIncomingCapturedYuvData( - const uint8_t* y_data, - const uint8_t* u_data, - const uint8_t* v_data, - size_t y_stride, - size_t u_stride, - size_t v_stride, - const VideoCaptureFormat& frame_format, - int clockwise_rotation, - const base::TimeTicks& timestamp) { - TRACE_EVENT0("video", "VideoCaptureDeviceClient::OnIncomingCapturedYuvData"); - DCHECK_EQ(media::PIXEL_FORMAT_I420, frame_format.pixel_format); - DCHECK_EQ(media::PIXEL_STORAGE_CPU, frame_format.pixel_storage); - DCHECK_EQ(0, clockwise_rotation) << "Rotation not supported"; - - uint8_t *y_plane_data, *u_plane_data, *v_plane_data; - scoped_ptr<Buffer> buffer(ReserveI420OutputBuffer( - frame_format.frame_size, frame_format.pixel_storage, &y_plane_data, - &u_plane_data, &v_plane_data)); - if (!buffer.get()) - return; - - const size_t dst_y_stride = - VideoFrame::RowBytes(VideoFrame::kYPlane, media::PIXEL_FORMAT_I420, - frame_format.frame_size.width()); - const size_t dst_u_stride = - VideoFrame::RowBytes(VideoFrame::kUPlane, media::PIXEL_FORMAT_I420, - frame_format.frame_size.width()); - const size_t dst_v_stride = - VideoFrame::RowBytes(VideoFrame::kVPlane, media::PIXEL_FORMAT_I420, - frame_format.frame_size.width()); - DCHECK_GE(y_stride, dst_y_stride); - DCHECK_GE(u_stride, dst_u_stride); - DCHECK_GE(v_stride, dst_v_stride); - - if (libyuv::I420Copy(y_data, y_stride, - u_data, u_stride, - v_data, v_stride, - y_plane_data, dst_y_stride, - u_plane_data, dst_u_stride, - v_plane_data, dst_v_stride, - frame_format.frame_size.width(), - frame_format.frame_size.height())) { - DLOG(WARNING) << "Failed to copy buffer"; - return; - } - - OnIncomingCapturedBuffer(std::move(buffer), frame_format, timestamp); -}; - scoped_ptr<media::VideoCaptureDevice::Client::Buffer> VideoCaptureDeviceClient::ReserveOutputBuffer( const gfx::Size& frame_size, |