diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-09-12 23:34:20 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2019-09-12 23:39:55 -0700 |
commit | e4dc7b7d0fc0d85dcb1dddc2c1e106b0beb8fe79 (patch) | |
tree | 43783185992ae42f0b539ce756a2ea852a154ec2 /binding | |
parent | 47e853c8ee6fa8d4a23af4e3d9e8f359d356684e (diff) |
mediaplayer: report metadata on playlist events and subscription
Report metadata on initial metadata event subsciption, and also
when the playlist changes.
Bug-AGL: SPEC-2774
Change-Id: Ieb68d6d5e53af889ad66c52887023b8c94c40080
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding')
-rw-r--r-- | binding/afm-mediaplayer-binding.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c index a7510f1..14a4fa1 100644 --- a/binding/afm-mediaplayer-binding.c +++ b/binding/afm-mediaplayer-binding.c @@ -653,6 +653,8 @@ static json_object *populate_json_metadata(void) json_object_object_add(jresp, "volume", json_object_new_int64(data.volume)); + json_object_object_add(jresp, "track", metadata); + return jresp; } @@ -999,6 +1001,14 @@ static void onevent(afb_api_t api, const char *event, struct json_object *object g_mutex_unlock(&mutex); afb_event_push(playlist_event, jresp); + + // send metadata out after event + g_mutex_lock(&mutex); + jresp = populate_json_metadata(); + g_mutex_unlock(&mutex); + + if (jresp) + afb_event_push(metadata_event, jresp); } void *gstreamer_loop_thread(void *ptr) |