diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-12-30 19:28:26 -0800 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2020-01-13 21:37:15 -0800 |
commit | 5c85eb1ae7c637471b6091c7694843f63d3e4f97 (patch) | |
tree | 2ce57a65b6ebb0fd3db5571323ed45ececd6b9a0 /binding/afm-mediaplayer-binding.c | |
parent | 7120a21d0880df6aa9f1c3cb7f7224699a6fe033 (diff) |
steering-wheel: add event.media.mode functionalityicefish_8.99.5icefish/8.99.58.99.5
Allow mode event to switch between AVRCP and local media.
Bug-AGL: SPEC-3047
Change-Id: Id7f697b8608695fd56a57a4f41eafc4c7c31a26d
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/afm-mediaplayer-binding.c')
-rw-r--r-- | binding/afm-mediaplayer-binding.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c index b0ee725..2a66afb 100644 --- a/binding/afm-mediaplayer-binding.c +++ b/binding/afm-mediaplayer-binding.c @@ -1037,6 +1037,8 @@ static void onevent(afb_api_t api, const char *event, struct json_object *object #else mediaplayer_set_role_state(api, GST_STATE_PAUSED); #endif + // Local media playback cannot be corked at this point if it's stopped + data.corked = FALSE; } else { json_object *jresp = populate_json_metadata(); @@ -1110,7 +1112,9 @@ static void onevent(afb_api_t api, const char *event, struct json_object *object afb_event_push(metadata_event, object); } } else if (!strcmp(uid, "event.media.mode")) { - // Do nothing ATM + g_mutex_lock(&mutex); + avrcp_cmd(api, data.avrcp_connected ? "disconnect" : "connect"); + g_mutex_unlock(&mutex); } else { AFB_WARNING("Unhandled signal-composer uid '%s'", uid); } |