Commit 64cc93dd authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2: pass format to AllocatedSizeFromV4L2Format by reference

AllocatedSizeFromV4L2Format() returns the calculated size of a buffer,
being given its V4L2 format. This method does not modify the format
whatsoever ; thus, pass it as const reference in order to avoid an
unneeded copy.

Bug: None
Test: video_decode_accelerator_tests passes on Kevin.

Change-Id: Ifd0bf98022efe44a6b72f6c684a452c969add83d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1871490
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708069}
parent 475b428e
......@@ -1356,7 +1356,8 @@ int32_t V4L2Device::H264LevelIdcToV4L2H264Level(uint8_t level_idc) {
}
// static
gfx::Size V4L2Device::AllocatedSizeFromV4L2Format(struct v4l2_format format) {
gfx::Size V4L2Device::AllocatedSizeFromV4L2Format(
const struct v4l2_format& format) {
gfx::Size coded_size;
gfx::Size visible_size;
VideoPixelFormat frame_format = PIXEL_FORMAT_UNKNOWN;
......
......@@ -390,7 +390,8 @@ class MEDIA_GPU_EXPORT V4L2Device
bool is_encoder);
static uint32_t V4L2PixFmtToDrmFormat(uint32_t format);
// Calculates the largest plane's allocation size requested by a V4L2 device.
static gfx::Size AllocatedSizeFromV4L2Format(struct v4l2_format format);
static gfx::Size AllocatedSizeFromV4L2Format(
const struct v4l2_format& format);
// Convert required H264 profile and level to V4L2 enums.
static int32_t VideoCodecProfileToV4L2H264Profile(VideoCodecProfile profile);
......
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