From 269ceb71b9a18acd37995495af23b2b5ed7f3a56 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Mon, 23 Oct 2017 23:38:49 -0700 Subject: binding: mediaplayer: add stop verb for playback Add stop verb mostly for resetting playback on media removal Bug-AGL: SPEC-931 Change-Id: Ic564d2329aab300bbff0bb8afcf47a65dc73103b Signed-off-by: Matt Ranostay --- binding/afm-common.c | 1 + binding/afm-common.h | 1 + binding/afm-mediaplayer-binding.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/binding/afm-common.c b/binding/afm-common.c index 0f27d57..ec68b8d 100644 --- a/binding/afm-common.c +++ b/binding/afm-common.c @@ -30,6 +30,7 @@ const char *control_commands[] = { "pick-track", "volume", "loop", + "stop", }; int get_command_index(const char *name) diff --git a/binding/afm-common.h b/binding/afm-common.h index 5b36404..302dd26 100644 --- a/binding/afm-common.h +++ b/binding/afm-common.h @@ -48,6 +48,7 @@ enum { PICKTRACK_CMD, VOLUME_CMD, LOOP_CMD, + STOP_CMD, NUM_CMDS }; diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c index 805a6bb..e95b4ba 100644 --- a/binding/afm-mediaplayer-binding.c +++ b/binding/afm-mediaplayer-binding.c @@ -387,6 +387,9 @@ static void controls(struct afb_req request) data.loop = !strcasecmp(state, "true") ? TRUE : FALSE; break; } + case STOP_CMD: + gst_element_set_state(data.playbin, GST_STATE_NULL); + break; default: afb_req_fail(request, "failed", "unknown command"); pthread_mutex_unlock(&mutex); -- cgit 1.2.3-korg