[Pkg-voip-commits] [janus] 206/282: Allow Streaming viewers to temporarily disable/enable audio/video/data
Jonas Smedegaard
dr at jones.dk
Wed Dec 20 21:53:41 UTC 2017
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/0.2.6-1
in repository janus.
commit 11282b321a2663dfe49270d4b1b5c54fbd35b182
Author: Lorenzo Miniero <lminiero at gmail.com>
Date: Mon Nov 27 17:43:37 2017 +0100
Allow Streaming viewers to temporarily disable/enable audio/video/data
---
plugins/janus_streaming.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/plugins/janus_streaming.c b/plugins/janus_streaming.c
index e21bcc0..85a75dd 100644
--- a/plugins/janus_streaming.c
+++ b/plugins/janus_streaming.c
@@ -331,6 +331,14 @@ static struct janus_json_parameter simulcast_parameters[] = {
{"substream", JSON_INTEGER, JANUS_JSON_PARAM_POSITIVE},
{"temporal", JSON_INTEGER, JANUS_JSON_PARAM_POSITIVE}
};
+static struct janus_json_parameter configure_parameters[] = {
+ {"audio", JANUS_JSON_BOOL, 0},
+ {"video", JANUS_JSON_BOOL, 0},
+ {"data", JANUS_JSON_BOOL, 0},
+ /* For VP8 simulcast */
+ {"substream", JSON_INTEGER, JANUS_JSON_PARAM_POSITIVE},
+ {"temporal", JSON_INTEGER, JANUS_JSON_PARAM_POSITIVE},
+};
/* Static configuration instance */
static janus_config *config = NULL;
@@ -2703,6 +2711,18 @@ static void *janus_streaming_handler(void *data) {
g_snprintf(error_cause, 512, "Can't configure: not on a mountpoint");
goto error;
}
+ JANUS_VALIDATE_JSON_OBJECT(root, configure_parameters,
+ error_code, error_cause, TRUE,
+ JANUS_STREAMING_ERROR_MISSING_ELEMENT, JANUS_STREAMING_ERROR_INVALID_ELEMENT);
+ json_t *audio = json_object_get(root, "audio");
+ if(audio)
+ session->audio = json_is_true(audio);
+ json_t *video = json_object_get(root, "video");
+ if(video)
+ session->video = json_is_true(video);
+ json_t *data = json_object_get(root, "data");
+ if(data)
+ session->data = json_is_true(data);
if(mp->streaming_source == janus_streaming_source_rtp) {
janus_streaming_rtp_source *source = (janus_streaming_rtp_source *)mp->source;
if(source && source->simulcast) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/janus.git
More information about the Pkg-voip-commits
mailing list