v4l2_codec2 encoder: Remove 'VIDEO_ENCODER' flag workaround.
In the past we avoided using the 'VIDEO_ENCODER' flag on input buffers.
Due to format conversion these buffers would never be sent directly to
the host, and adding the flag would cause an extra shadow buffer to be
allocated on the host. This is no longer the case and no performance
differences can be observed when always adding the 'VIDEO_ENCODER'
flag, so this CL removes the workaround.
Bug: 167640667
Test: arc.VideoEncodeAccel.h264_192p_i420_vm
Change-Id: Id247b62dfe2e6d09bc5dccbf050b0b4fe8cc263f
(cherry picked from commit a354b9103fe6b3eb303fa9eb33ee8cc0d8f36835)
diff --git a/components/V4L2EncodeInterface.cpp b/components/V4L2EncodeInterface.cpp
index 03d8c37..314794f 100644
--- a/components/V4L2EncodeInterface.cpp
+++ b/components/V4L2EncodeInterface.cpp
@@ -382,17 +382,10 @@
.withConstValue(new C2StreamBufferTypeSetting::input(0u, C2BufferData::GRAPHIC))
.build());
- // TODO(b/167640667) Add VIDEO_ENCODER flag once input convertor is not enabled by default.
- // When using the format convertor (which is currently always enabled) it's not useful to add
- // the VIDEO_ENCODER buffer flag for input buffers here. Currently zero-copy is not supported
- // yet, so when using this flag an additional buffer will be allocated on host side and a copy
- // will be performed between the guest and host buffer to keep them in sync. This is wasteful as
- // the buffer is only used on guest side by the format convertor which converts and copies the
- // buffer into another buffer.
- //addParameter(DefineParam(mInputMemoryUsage, C2_PARAMKEY_INPUT_STREAM_USAGE)
- // .withConstValue(new C2StreamUsageTuning::input(
- // 0u, static_cast<uint64_t>(BufferUsage::VIDEO_ENCODER)))
- // .build());
+ addParameter(DefineParam(mInputMemoryUsage, C2_PARAMKEY_INPUT_STREAM_USAGE)
+ .withConstValue(new C2StreamUsageTuning::input(
+ 0u, static_cast<uint64_t>(BufferUsage::VIDEO_ENCODER)))
+ .build());
addParameter(
DefineParam(mOutputFormat, C2_PARAMKEY_OUTPUT_STREAM_BUFFER_TYPE)