Revision ea2bce5b

View differences:

Public/assets/mysource.js
64 64
			success: function(jsep) {
65 65
				Janus.debug("Got publisher SDP!");
66 66
				Janus.debug(jsep);
67
				var publish = { "request": "configure", "audio": useAudio, "video": true };
67
				var publish = { "request": "configure", "audio": useAudio, "video": true, "audiocodec": "opus", "videocodec": "vp8" };
68 68
				// You can force a specific codec to use when publishing by using the
69 69
				// audiocodec and videocodec properties, for instance:
70 70
				// 		publish["audiocodec"] = "opus"
......
160 160
}
161 161

  
162 162
function startStreaming() {
163
	var register = { "request": "join", "room": myroom, "ptype": "publisher", "display": description, "id": myid };
163
	var register = { "request": "joinandconfigure", "bitrate": 128000, "room": myroom, "ptype": "publisher", "display": description, "id": myid };
164 164
	janus_plugin.send({"message": register});
165 165

  
166 166
	var xhttp = new XMLHttpRequest();
src/janus_instance.c
465 465
	char * uri;
466 466
	char * fmt = "{\"transaction\":\"random_str\",\"janus\":\"message\",\"body\":{\"request\":\"create\",\"type\":\"rtp\",\
467 467
				  \"audio\":true,\"audioport\":%"PRId16",\"audiopt\":111,\"audiortpmap\":\"opus/48000/2\",\
468
				  \"video\":true,\"videoport\":%"PRId16",\"videopt\":100,\"videortpmap\":\"VP8/90000\"}}";
468
				  \"video\":true,\"videoport\":%"PRId16",\"videopt\":98,\"videortpmap\":\"VP8/90000\"}}";
469 469
	char buff[280];
470 470
	void ** data;
471 471

  
......
523 523
	struct mg_connection * conn;
524 524
	int8_t res = -1;
525 525
	char * uri;
526
	char * fmt = "{\"transaction\":\"random_str\",\"janus\":\"message\",\"body\":{\"request\":\"create\",\"room\":%s,\"publishers\":1,\"bitrate\":128000,\"record\":false,\"description\":\"Room %s\",\"fir_freq\":100}}";
526
	char * fmt = "{\"transaction\":\"random_str\",\"janus\":\"message\",\"body\":{\"request\":\"create\",\"room\":%s,\"publishers\":1,\"bitrate\":128000,\"record\":false,\"description\":\"Room %s\",\"fir_freq\":100,\"audiocodec\":\"opus\",\"videocodec\":\"vp8\"}}";
527 527

  
528 528
	char buff[280];
529 529
	void ** data;
src/pstreamer.c
29 29
#include<debug.h>
30 30

  
31 31
#define MAX_PSINSTANCE_CONFIG_LENGTH 255
32
#define STREAMER_PEER_CONF "port=%d,dechunkiser=rtp,base=%d,addr=%s"
33
#define STREAMER_SOURCE_CONF "port=%d,chunkiser=rtp,base=%d,addr=%s,max_delay_ms=50"
32
#define STREAMER_PEER_CONF "port=%d,dechunkiser=rtp,audio=%d,video=%d,addr=%s"
33
#define STREAMER_SOURCE_CONF "port=%d,chunkiser=rtp,audio=%d,video=%d,addr=%s,max_delay_ms=5,chunk_size=20"
34
//#define STREAMER_SOURCE_CONF "port=%d,chunkiser=rtp,base=%d,addr=%s,max_delay_ms=5,chunk_size=200,rfc3551=1"
34 35

  
35 36
struct pstreamer {
36 37
	char source_ip[MAX_IPADDR_LENGTH];
......
61 62
	char config[MAX_PSINSTANCE_CONFIG_LENGTH];
62 63
	int count;
63 64

  
64
	count = snprintf(config, MAX_PSINSTANCE_CONFIG_LENGTH, fmt, ps->base_port, ps->base_port+1, rtp_ip);
65
	count = snprintf(config, MAX_PSINSTANCE_CONFIG_LENGTH, fmt, ps->base_port, ps->base_port+1, ps->base_port+3, rtp_ip);
65 66
	if (opts && (size_t)(MAX_PSINSTANCE_CONFIG_LENGTH - count) > strlen(opts))
66 67
		snprintf(config + count, MAX_PSINSTANCE_CONFIG_LENGTH - count, ",%s", opts);
67 68
	ps->psc = psinstance_create(ps->source_ip, ps->source_port, config);

Also available in: Unified diff