summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-10-23 23:38:49 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2017-10-23 23:39:07 -0700
commit269ceb71b9a18acd37995495af23b2b5ed7f3a56 (patch)
tree33f7c4474bc31e1e27a4746dffe5968c2678d1aa
parent4ce89b162cecc149ad2864c8a839befdbf83487e (diff)
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 <matt.ranostay@konsulko.com>
-rw-r--r--binding/afm-common.c1
-rw-r--r--binding/afm-common.h1
-rw-r--r--binding/afm-mediaplayer-binding.c3
3 files changed, 5 insertions, 0 deletions
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);