Commit 040e9f02 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2: use NOTREACHED when V4L2Buffer::GetVideoFrame() is called improperly

V4L2Buffer::GetVideoFrame() is an internal method that is never exposed
outside of V4L2Device. Change a regular error handling (which would be
the way to do if this was exposed) into a NOTREACHED() so we catch
potential bugs in our code.

BUG=None
TEST=VDAtest --use_vd passes on Kukui.

Change-Id: Ide5cf00447df154d39d1400d156633ea67b45e2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2143426
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarJeffrey Kardatzke <jkardatzke@google.com>
Cr-Commit-Position: refs/heads/master@{#759137}
parent 7e095c83
...@@ -240,9 +240,9 @@ scoped_refptr<VideoFrame> V4L2Buffer::GetVideoFrame() { ...@@ -240,9 +240,9 @@ scoped_refptr<VideoFrame> V4L2Buffer::GetVideoFrame() {
// We can create the VideoFrame only when using MMAP buffers. // We can create the VideoFrame only when using MMAP buffers.
if (v4l2_buffer_.memory != V4L2_MEMORY_MMAP) { if (v4l2_buffer_.memory != V4L2_MEMORY_MMAP) {
VLOGF(1) << "Cannot create video frame from non-MMAP buffer"; VLOGF(1) << "Cannot create video frame from non-MMAP buffer";
// video_frame_ should be null since that's its default value. // Allow NOTREACHED() on invalid argument because this is an internal
DCHECK_EQ(video_frame_, nullptr); // method.
return video_frame_; NOTREACHED();
} }
// Create the video frame instance if requiring it for the first time. // Create the video frame instance if requiring it for the first time.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment