Commit 6802ee0e authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2device: add request parameter to SetExtCtrls()

Controls can be applied on the device as a whole, or only on a request.
Add an optional request parameter to SetExtCtrls() to cover this
use-case. We can use it in the V4L2DecodeSurface once the config store
is retired.

BUG=chromium:1009921
TEST=video.DecodeAccel.h264 passes on Kukui.

Change-Id: I2fefdedd2b9ad3a2b02d3a8ecfe74bbd19b6db58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2421994
Commit-Queue: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: default avatarFritz Koenig <frkoenig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809444}
parent be0c323a
...@@ -2146,7 +2146,8 @@ bool V4L2Device::IsCtrlExposed(uint32_t ctrl_id) { ...@@ -2146,7 +2146,8 @@ bool V4L2Device::IsCtrlExposed(uint32_t ctrl_id) {
} }
bool V4L2Device::SetExtCtrls(uint32_t ctrl_class, bool V4L2Device::SetExtCtrls(uint32_t ctrl_class,
std::vector<V4L2ExtCtrl> ctrls) { std::vector<V4L2ExtCtrl> ctrls,
V4L2RequestRef* request_ref) {
DCHECK_CALLED_ON_VALID_SEQUENCE(client_sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(client_sequence_checker_);
if (ctrls.empty()) if (ctrls.empty())
...@@ -2157,6 +2158,10 @@ bool V4L2Device::SetExtCtrls(uint32_t ctrl_class, ...@@ -2157,6 +2158,10 @@ bool V4L2Device::SetExtCtrls(uint32_t ctrl_class,
ext_ctrls.ctrl_class = ctrl_class; ext_ctrls.ctrl_class = ctrl_class;
ext_ctrls.count = ctrls.size(); ext_ctrls.count = ctrls.size();
ext_ctrls.controls = &ctrls[0].ctrl; ext_ctrls.controls = &ctrls[0].ctrl;
if (request_ref)
request_ref->ApplyCtrls(&ext_ctrls);
return Ioctl(VIDIOC_S_EXT_CTRLS, &ext_ctrls) == 0; return Ioctl(VIDIOC_S_EXT_CTRLS, &ext_ctrls) == 0;
} }
......
...@@ -755,8 +755,11 @@ class MEDIA_GPU_EXPORT V4L2Device ...@@ -755,8 +755,11 @@ class MEDIA_GPU_EXPORT V4L2Device
// Check whether the V4L2 control with specified |ctrl_id| is supported. // Check whether the V4L2 control with specified |ctrl_id| is supported.
bool IsCtrlExposed(uint32_t ctrl_id); bool IsCtrlExposed(uint32_t ctrl_id);
// Set the specified list of |ctrls| for the specified |ctrl_class|, returns // Set the specified list of |ctrls| for the specified |ctrl_class|, returns
// whether the operation succeeded. // whether the operation succeeded. If |request_ref| is not nullptr, the
bool SetExtCtrls(uint32_t ctrl_class, std::vector<V4L2ExtCtrl> ctrls); // controls are applied to the request instead of globally for the device.
bool SetExtCtrls(uint32_t ctrl_class,
std::vector<V4L2ExtCtrl> ctrls,
V4L2RequestRef* request_ref = nullptr);
// Get the value of a single control, or base::nullopt of the control is not // Get the value of a single control, or base::nullopt of the control is not
// exposed by the device. // exposed by the device.
......
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