avrcp: Implement Press/Hold/Release method for MediaPlayer1
authorArchie Pusaka <apusaka@chromium.org>
Thu, 3 Sep 2020 03:50:39 +0000 (11:50 +0800)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:50 +0000 (14:30 +0530)
commitd86601e78f64bfcf7b9e623a957ddec4266b7d15
tree4c27292f094acdc8295487758c5789a65184a4ff
parentcb382308cc0865d422b6c7eb097b4dfc031fd8be
avrcp: Implement Press/Hold/Release method for MediaPlayer1

This allows us to send any passthrough command, complete with the
support to hold down the key. Using Press() will automatically
release the key, while using Hold() will keep the key held until
an explicit call to Release() is received.

This doesn't allow us to hold multiple keys simultaneously, since
according to the AV/C Panel Subunit Specification, part 9.4, when the
target receive a pressed command without receiving a release command
of the previous key, it will be treated as if the release command is
sent but not received.

Previously, the rewind and fast_forward keys are unique in terms that
they are treated as holdable keys, this patch preserves that behavior
of calling Rewind() and FastForward(). A rewind event which is
reported via the new Press() method will automatically be released
instead.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/audio/avctp.c
profiles/audio/avctp.h
profiles/audio/avrcp.c
profiles/audio/control.c
profiles/audio/player.c
profiles/audio/player.h