aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2019-09-12 23:34:20 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2019-09-12 23:39:55 -0700
commite4dc7b7d0fc0d85dcb1dddc2c1e106b0beb8fe79 (patch)
tree43783185992ae42f0b539ce756a2ea852a154ec2
parent47e853c8ee6fa8d4a23af4e3d9e8f359d356684e (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>
-rw-r--r--binding/afm-mediaplayer-binding.c10
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)