aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-11-16 01:52:55 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-11-21 15:41:23 -0800
commitbe08bb6ed75e747b540a1b3eace5a32ca0ac955b (patch)
treeac01de66b62e1c82afb3757f7eee63cd9472e3fb
parent246361069bf6bf973847b5365c17d91bdee07aa6 (diff)
binding: mediaplayer: remove metadata verb
Since no client actually uses the metadata verb, but just the events this can be removed. Also the verb wouldn't show avrcp metadata. Bug-AGL: SPEC-1630 Change-Id: Iae7ba5a2e63107cb920566c83507bb2c7365a168 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r--README.md42
-rw-r--r--binding/afm-mediaplayer-binding.c15
2 files changed, 22 insertions, 35 deletions
diff --git a/README.md b/README.md
index 8f9a667..d27ffc8 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,6 @@ MediaPlayer service controls playback of media from a playlist using one provide
| subscribe | subscribe to respectice events | *Request:* {"value": "playlist"} |
| unsubscribe | unsubscribe to respective events | *Request:* {"value": "playlist"} |
| controls | controls for media playback | See **MediaPlayer Controls** section |
-| metadata | get current metadata of selected media | See **metadata Reporting** section |
| playlist | get current playlist of media | See **playlist JSON Response** section |
### MediaPlayer Controls
@@ -33,23 +32,6 @@ the parameter of *value* (i.e. *{"value": "play"}*)
| volume | set volume 0-100% for media stream | {"value": "volume, "volume": 40} |
| loop | loop playlist | {"value": "loop", "state": "true"} |
-### metadata Reporting
-
-JSON response for *metadata* request parameters
-
-| Name | Description |
-|:------------|----------------------------------------------------|
-| index | index number within playlist |
-| duration | length of track in milliseconds |
-| position | current position in milliseconds |
-| volume | current volume in percent |
-| path | path to media on filesystem |
-| title | title for current track |
-| album | album name for current track |
-| artist | artist name for current track |
-| genre | genre type for current track |
-| image | *(optional)* base64 encoded data URI for album art |
-
### playlist JSON Response
JSON response is an array of playlist entries with the parameter name of *list*.
@@ -77,5 +59,25 @@ JSON response data is an array of the same fields documented in **playlist JSON
### metadata Event Notes
-JSON response data is the same fields documented in **metadata Reporting** section *with the exception
-of album art due to performance issues*
+JSON response for *metadata* event
+
+These fields are in the root level of the event
+
+| Name | Description |
+|:------------|----------------------------------------------------|
+| position | current position in milliseconds |
+| volume | current volume in percent |
+
+These fields are part of a dictionary named "track"
+
+| Name | Description |
+|:------------|----------------------------------------------------|
+| index | index number within playlist |
+| duration | length of track in milliseconds |
+| path | path to media on filesystem |
+| title | title for current track |
+| album | album name for current track |
+| artist | artist name for current track |
+| genre | genre type for current track |
+| image | *(optional)* base64 encoded data URI for album art |
+
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c
index 6e85fa1..8a60541 100644
--- a/binding/afm-mediaplayer-binding.c
+++ b/binding/afm-mediaplayer-binding.c
@@ -615,20 +615,6 @@ static json_object *populate_json_metadata(void)
return jresp;
}
-static void metadata(afb_req_t request)
-{
- json_object *jresp;
-
- pthread_mutex_lock(&mutex);
- jresp = populate_json_metadata();
- pthread_mutex_unlock(&mutex);
-
- if (jresp == NULL)
- afb_req_fail(request, "failed", "No metadata");
- else
- afb_req_success(request, jresp, "Metadata results");
-}
-
static int bluetooth_subscribe(afb_api_t api)
{
json_object *response, *query;
@@ -1007,7 +993,6 @@ static int init(afb_api_t api)
static const afb_verb_t binding_verbs[] = {
{ .verb = "playlist", .callback = audio_playlist, .info = "Get/set playlist" },
{ .verb = "controls", .callback = controls, .info = "Audio controls" },
- { .verb = "metadata", .callback = metadata, .info = "Get metadata of current track" },
{ .verb = "subscribe", .callback = subscribe, .info = "Subscribe to GStreamer events" },
{ .verb = "unsubscribe", .callback = unsubscribe, .info = "Unsubscribe to GStreamer events" },
{ }