From add8929f1d781fabf5526d90c17a853274655e79 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Thu, 13 Dec 2018 19:23:36 -0800 Subject: Consume video frames An input device currently reads video frames, and stores them into local queue. We limit the queue size to 10 frames. Here, we add the step where an input mapper would consume the video frames from the video device for a given input device, and then pass them onto the input listener. Test: integration tested by checking that frames are processed correctly in input hal. To check if frames are processed correctly, look at the active touch area and print a log message when the total area exceeds a certain threshold. Bug: 111480215 Change-Id: Ifc519389e12b44540e9a54fd273241f9f7cd057d --- services/inputflinger/InputReader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'services/inputflinger/InputReader.cpp') diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp index 73fcb1124d..3d5f1d92d5 100644 --- a/services/inputflinger/InputReader.cpp +++ b/services/inputflinger/InputReader.cpp @@ -6483,11 +6483,13 @@ void TouchInputMapper::dispatchMotion(nsecs_t when, uint32_t policyFlags, uint32 } } - NotifyMotionArgs args(mContext->getNextSequenceNum(), when, getDeviceId(), + const int32_t deviceId = getDeviceId(); + std::vector frames = mDevice->getEventHub()->getVideoFrames(deviceId); + NotifyMotionArgs args(mContext->getNextSequenceNum(), when, deviceId, source, mViewport.displayId, policyFlags, action, actionButton, flags, metaState, buttonState, edgeFlags, deviceTimestamp, pointerCount, pointerProperties, pointerCoords, - xPrecision, yPrecision, downTime, /* videoFrames */ {}); + xPrecision, yPrecision, downTime, std::move(frames)); getListener()->notifyMotion(&args); } -- cgit v1.2.3-59-g8ed1b