Commit 9124544d authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2: don't use C++ string for string constants

V4L2MemoryToString() returns a string constant, so change its type to
const char* to save some processing and make it more generic.

Bug: None
Test: Chromium builds and runs for Kukui.
Change-Id: I4cab66813e702493cbbce52a9956021dfdb4e818
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1939997
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719889}
parent abe7a981
...@@ -1470,7 +1470,7 @@ gfx::Size V4L2Device::AllocatedSizeFromV4L2Format( ...@@ -1470,7 +1470,7 @@ gfx::Size V4L2Device::AllocatedSizeFromV4L2Format(
} }
// static // static
std::string V4L2Device::V4L2MemoryToString(const v4l2_memory memory) { const char* V4L2Device::V4L2MemoryToString(const v4l2_memory memory) {
switch (memory) { switch (memory) {
case V4L2_MEMORY_MMAP: case V4L2_MEMORY_MMAP:
return "V4L2_MEMORY_MMAP"; return "V4L2_MEMORY_MMAP";
......
...@@ -400,7 +400,7 @@ class MEDIA_GPU_EXPORT V4L2Device ...@@ -400,7 +400,7 @@ class MEDIA_GPU_EXPORT V4L2Device
static int32_t H264LevelIdcToV4L2H264Level(uint8_t level_idc); static int32_t H264LevelIdcToV4L2H264Level(uint8_t level_idc);
// Converts v4l2_memory to a string. // Converts v4l2_memory to a string.
static std::string V4L2MemoryToString(const v4l2_memory memory); static const char* V4L2MemoryToString(const v4l2_memory memory);
// Composes human readable string of v4l2_format. // Composes human readable string of v4l2_format.
static std::string V4L2FormatToString(const struct v4l2_format& format); static std::string V4L2FormatToString(const struct v4l2_format& format);
......
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