summaryrefslogtreecommitdiff
path: root/cmds/dumpstate/utils.cpp
diff options
context:
space:
mode:
author Siarhei Vishniakou <svv@google.com> 2018-11-02 17:19:19 -0700
committer Siarhei Vishniakou <svv@google.com> 2019-01-02 13:49:31 -0800
commit12598681b0f189ed8116d7194b3806d7771b39ba (patch)
tree55f82fe078e7a7299d132347bb638afdf1a01b3b /cmds/dumpstate/utils.cpp
parent49a99b9ff288a105de660cd43ce73e0ce2e7d2f2 (diff)
Add video device to epoll in EventHub
The video device is already being watched, and we now need to start actually reading the video frames. This is done similarly to the input devices. The video device fd is added to epoll. Whenever an epoll detects new data, the frames will be added to video device's internal queue. In the subsequent commits we will consume these frames and report them to the InputClassifier HAL. Note here that registering for epoll is a bit complex. It is important to only have the video device in epoll if the input device is in epoll. There are several situations possible here: 1) Video device is found during directory traversal of /dev 2) Video device is found through inotify 3) Video device is added after matching input device 4) Video device is added before matching input device 5) Video device is added while input device is disabled 6) As long as input device is enabled, and has a video device, the video device should be part of epoll. That means input device.enable() should add the video device to epoll. Therefore, the decision here was made to registerVideoDevice inside registerDevice (=registerInputDevice), which should account for most cases. For the other corner cases, handle adding video device to epoll separately. Test: video device is being read, because InputClassifier receives video frames and classifies them. Bug: 111480215 Change-Id: I340b44a9b17182444b8a3308e3ab322ae1ad444c
Diffstat (limited to 'cmds/dumpstate/utils.cpp')
0 files changed, 0 insertions, 0 deletions