[-]
[+]
|
Changed |
nginx-1.2.changes
|
|
[-]
[+]
|
Changed |
nginx-1.2.spec
^
|
|
[-]
[+]
|
Added |
CVE-2013-4547.patch
^
|
@@ -0,0 +1,18 @@
+--- src/http/ngx_http_parse.c
++++ src/http/ngx_http_parse.c
+@@ -617,6 +617,7 @@ ngx_http_parse_request_line(ngx_http_req
+ default:
+ r->space_in_uri = 1;
+ state = sw_check_uri;
++ p--;
+ break;
+ }
+ break;
+@@ -670,6 +671,7 @@ ngx_http_parse_request_line(ngx_http_req
+ default:
+ r->space_in_uri = 1;
+ state = sw_uri;
++ p--;
+ break;
+ }
+ break;
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/hls/ngx_rtmp_hls_module.c
^
|
@@ -93,11 +93,13 @@
ngx_str_t path;
ngx_uint_t naming;
ngx_uint_t slicing;
+ ngx_uint_t type;
ngx_path_t *slot;
ngx_msec_t max_audio_delay;
size_t audio_buffer_size;
ngx_flag_t cleanup;
ngx_array_t *variant;
+ ngx_str_t base_url;
} ngx_rtmp_hls_app_conf_t;
@@ -110,6 +112,10 @@
#define NGX_RTMP_HLS_SLICING_ALIGNED 2
+#define NGX_RTMP_HLS_TYPE_LIVE 1
+#define NGX_RTMP_HLS_TYPE_EVENT 2
+
+
static ngx_conf_enum_t ngx_rtmp_hls_naming_slots[] = {
{ ngx_string("sequential"), NGX_RTMP_HLS_NAMING_SEQUENTIAL },
{ ngx_string("timestamp"), NGX_RTMP_HLS_NAMING_TIMESTAMP },
@@ -125,6 +131,13 @@
};
+static ngx_conf_enum_t ngx_rtmp_hls_type_slots[] = {
+ { ngx_string("live"), NGX_RTMP_HLS_TYPE_LIVE },
+ { ngx_string("event"), NGX_RTMP_HLS_TYPE_EVENT },
+ { ngx_null_string, 0 }
+};
+
+
static ngx_command_t ngx_rtmp_hls_commands[] = {
{ ngx_string("hls"),
@@ -204,6 +217,13 @@
offsetof(ngx_rtmp_hls_app_conf_t, slicing),
&ngx_rtmp_hls_slicing_slots },
+ { ngx_string("hls_type"),
+ NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_enum_slot,
+ NGX_RTMP_APP_CONF_OFFSET,
+ offsetof(ngx_rtmp_hls_app_conf_t, type),
+ &ngx_rtmp_hls_type_slots },
+
{ ngx_string("hls_max_audio_delay"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
ngx_conf_set_msec_slot,
@@ -232,6 +252,13 @@
0,
NULL },
+ { ngx_string("hls_base_url"),
+ NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_str_slot,
+ NGX_RTMP_APP_CONF_OFFSET,
+ offsetof(ngx_rtmp_hls_app_conf_t, base_url),
+ NULL },
+
ngx_null_command
};
@@ -422,7 +449,8 @@
*p++ = '\n';
}
- p = ngx_slprintf(p, last, "%*s%V",
+ p = ngx_slprintf(p, last, "%V%*s%V",
+ &hacf->base_url,
ctx->name.len - ctx->var->suffix.len, ctx->name.data,
&var->suffix);
if (hacf->nested) {
@@ -469,7 +497,8 @@
ngx_int_t nretry, rc;
ngx_rtmp_hls_frag_t *f;
ngx_uint_t i, max_frag;
- static ngx_str_t empty = ngx_null_string;
+ ngx_str_t name_part;
+ const char *sep;
hacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_hls_module);
@@ -511,8 +540,11 @@
"#EXTM3U\n"
"#EXT-X-VERSION:3\n"
"#EXT-X-MEDIA-SEQUENCE:%uL\n"
- "#EXT-X-TARGETDURATION:%ui\n",
- ctx->frag, max_frag);
+ "#EXT-X-TARGETDURATION:%ui\n"
+ "%s",
+ ctx->frag, max_frag,
+ hacf->type == NGX_RTMP_HLS_TYPE_EVENT ?
+ "#EXT-X-PLAYLIST-TYPE: EVENT\n" : "");
n = ngx_write_fd(fd, buffer, p - buffer);
if (n < 0) {
@@ -523,17 +555,22 @@
return NGX_ERROR;
}
+ sep = hacf->nested ? (hacf->base_url.len ? "/" : "") : "-";
+
+ name_part.len = 0;
+ if (!hacf->nested || hacf->base_url.len) {
+ name_part = ctx->name;
+ }
+
for (i = 0; i < ctx->nfrags; i++) {
f = ngx_rtmp_hls_get_frag(s, i);
p = ngx_snprintf(buffer, sizeof(buffer),
"%s"
"#EXTINF:%.3f,\n"
- "%V%s%uL.ts\n",
+ "%V%V%s%uL.ts\n",
f->discont ? "#EXT-X-DISCONTINUITY\n" : "",
- f->duration,
- hacf->nested ? &empty : &ctx->name,
- hacf->nested ? "" : "-", f->id);
+ f->duration, &hacf->base_url, &name_part, sep, f->id);
ngx_log_debug5(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
"hls: fragment frag=%uL, n=%ui/%ui, duration=%.3f, "
@@ -2053,6 +2090,7 @@
conf->nested = NGX_CONF_UNSET;
conf->naming = NGX_CONF_UNSET_UINT;
conf->slicing = NGX_CONF_UNSET_UINT;
+ conf->type = NGX_CONF_UNSET_UINT;
conf->max_audio_delay = NGX_CONF_UNSET_MSEC;
conf->audio_buffer_size = NGX_CONF_UNSET_SIZE;
conf->cleanup = NGX_CONF_UNSET;
@@ -2082,11 +2120,14 @@
NGX_RTMP_HLS_NAMING_SEQUENTIAL);
ngx_conf_merge_uint_value(conf->slicing, prev->slicing,
NGX_RTMP_HLS_SLICING_PLAIN);
+ ngx_conf_merge_uint_value(conf->type, prev->type,
+ NGX_RTMP_HLS_TYPE_LIVE);
ngx_conf_merge_msec_value(conf->max_audio_delay, prev->max_audio_delay,
300);
ngx_conf_merge_size_value(conf->audio_buffer_size, prev->audio_buffer_size,
NGX_RTMP_HLS_BUFSIZE);
ngx_conf_merge_value(conf->cleanup, prev->cleanup, 1);
+ ngx_conf_merge_str_value(conf->base_url, prev->base_url, "");
if (conf->fraglen) {
conf->winfrags = conf->playlen / conf->fraglen;
@@ -2094,7 +2135,9 @@
/* schedule cleanup */
- if (conf->path.len == 0 || !conf->cleanup) {
+ if (conf->path.len == 0 || !conf->cleanup ||
+ conf->type == NGX_RTMP_HLS_TYPE_EVENT)
+ {
return NGX_CONF_OK;
}
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp.h
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
@@ -220,6 +221,7 @@
ngx_msec_t epoch;
ngx_msec_t peer_epoch;
ngx_msec_t base_time;
+ uint32_t current_time;
/* ping */
ngx_event_t ping_evt;
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_access_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_amf.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_amf.h
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_auto_push_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_bandwidth.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_bandwidth.h
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_cmd_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
@@ -171,7 +172,9 @@
}
len = ngx_strlen(v.app);
- if (len && v.app[len - 1] == '/') {
+ if (len > 10 && !ngx_memcmp(v.app + len - 10, "/_definst_", 10)) {
+ v.app[len - 10] = 0;
+ } else if (len && v.app[len - 1] == '/') {
v.app[len - 1] = 0;
}
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_cmd_module.h
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_codec_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
@@ -10,7 +11,46 @@
#include "ngx_rtmp_cmd_module.h"
+#define NGX_RTMP_CODEC_META_OFF 0
+#define NGX_RTMP_CODEC_META_ON 1
+#define NGX_RTMP_CODEC_META_COPY 2
+
+
+static void * ngx_rtmp_codec_create_app_conf(ngx_conf_t *cf);
+static char * ngx_rtmp_codec_merge_app_conf(ngx_conf_t *cf,
+ void *parent, void *child);
static ngx_int_t ngx_rtmp_codec_postconfiguration(ngx_conf_t *cf);
+static ngx_int_t ngx_rtmp_codec_reconstruct_meta(ngx_rtmp_session_t *s);
+static ngx_int_t ngx_rtmp_codec_copy_meta(ngx_rtmp_session_t *s,
+ ngx_rtmp_header_t *h, ngx_chain_t *in);
+static ngx_int_t ngx_rtmp_codec_prepare_meta(ngx_rtmp_session_t *s,
+ uint32_t timestamp);
+
+
+typedef struct {
+ ngx_uint_t meta;
+} ngx_rtmp_codec_app_conf_t;
+
+
+static ngx_conf_enum_t ngx_rtmp_codec_meta_slots[] = {
+ { ngx_string("off"), NGX_RTMP_CODEC_META_OFF },
+ { ngx_string("on"), NGX_RTMP_CODEC_META_ON },
+ { ngx_string("copy"), NGX_RTMP_CODEC_META_COPY },
+ { ngx_null_string, 0 }
+};
+
+
+static ngx_command_t ngx_rtmp_codec_commands[] = {
+
+ { ngx_string("meta"),
+ NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_enum_slot,
+ NGX_RTMP_APP_CONF_OFFSET,
+ offsetof(ngx_rtmp_codec_app_conf_t, meta),
+ &ngx_rtmp_codec_meta_slots },
+
+ ngx_null_command
+};
static ngx_rtmp_module_t ngx_rtmp_codec_module_ctx = {
@@ -20,15 +60,15 @@
NULL, /* init main configuration */
NULL, /* create server configuration */
NULL, /* merge server configuration */
- NULL, /* create app configuration */
- NULL /* merge app configuration */
+ ngx_rtmp_codec_create_app_conf, /* create app configuration */
+ ngx_rtmp_codec_merge_app_conf /* merge app configuration */
};
ngx_module_t ngx_rtmp_codec_module = {
NGX_MODULE_V1,
&ngx_rtmp_codec_module_ctx, /* module context */
- NULL, /* module directives */
+ ngx_rtmp_codec_commands, /* module directives */
NGX_RTMP_MODULE, /* module type */
NULL, /* init master */
NULL, /* init module */
@@ -276,12 +316,11 @@
static ngx_int_t
-ngx_rtmp_codec_update_meta(ngx_rtmp_session_t *s)
+ngx_rtmp_codec_reconstruct_meta(ngx_rtmp_session_t *s)
{
ngx_rtmp_codec_ctx_t *ctx;
ngx_rtmp_core_srv_conf_t *cscf;
ngx_int_t rc;
- ngx_rtmp_header_t h;
static struct {
double width;
@@ -395,10 +434,48 @@
return NGX_ERROR;
}
+ return ngx_rtmp_codec_prepare_meta(s, 0);
+}
+
+
+static ngx_int_t
+ngx_rtmp_codec_copy_meta(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
+ ngx_chain_t *in)
+{
+ ngx_rtmp_codec_ctx_t *ctx;
+ ngx_rtmp_core_srv_conf_t *cscf;
+
+ ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_codec_module);
+
+ cscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_core_module);
+
+ if (ctx->meta) {
+ ngx_rtmp_free_shared_chain(cscf, ctx->meta);
+ }
+
+ ctx->meta = ngx_rtmp_append_shared_bufs(cscf, NULL, in);
+
+ if (ctx->meta == NULL) {
+ return NGX_ERROR;
+ }
+
+ return ngx_rtmp_codec_prepare_meta(s, h->timestamp);
+}
+
+
+static ngx_int_t
+ngx_rtmp_codec_prepare_meta(ngx_rtmp_session_t *s, uint32_t timestamp)
+{
+ ngx_rtmp_header_t h;
+ ngx_rtmp_codec_ctx_t *ctx;
+
+ ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_codec_module);
+
ngx_memzero(&h, sizeof(h));
h.csid = NGX_RTMP_CSID_AMF;
h.msid = NGX_RTMP_MSID;
h.type = NGX_RTMP_MSG_AMF_META;
+ h.timestamp = timestamp;
ngx_rtmp_prepare_message(s, &h, NULL, ctx->meta);
ctx->meta_version = ngx_rtmp_codec_get_next_version();
@@ -411,6 +488,7 @@
ngx_rtmp_codec_meta_data(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
ngx_chain_t *in)
{
+ ngx_rtmp_codec_app_conf_t *cacf;
ngx_rtmp_codec_ctx_t *ctx;
ngx_uint_t skip;
@@ -509,6 +587,8 @@
in_inf, sizeof(in_inf) },
};
+ cacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_codec_module);
+
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_codec_module);
if (ctx == NULL) {
ctx = ngx_pcalloc(s->connection->pool, sizeof(ngx_rtmp_codec_ctx_t));
@@ -555,12 +635,47 @@
ngx_rtmp_get_audio_codec_name(ctx->audio_codec_id),
ctx->audio_codec_id);
- ngx_rtmp_codec_update_meta(s);
+ switch (cacf->meta) {
+ case NGX_RTMP_CODEC_META_ON:
+ return ngx_rtmp_codec_reconstruct_meta(s);
+ case NGX_RTMP_CODEC_META_COPY:
+ return ngx_rtmp_codec_copy_meta(s, h, in);
+ }
+
+ /* NGX_RTMP_CODEC_META_OFF */
return NGX_OK;
}
+static void *
+ngx_rtmp_codec_create_app_conf(ngx_conf_t *cf)
+{
+ ngx_rtmp_codec_app_conf_t *cacf;
+
+ cacf = ngx_pcalloc(cf->pool, sizeof(ngx_rtmp_codec_app_conf_t));
+ if (cacf == NULL) {
+ return NULL;
+ }
+
+ cacf->meta = NGX_CONF_UNSET_UINT;
+
+ return cacf;
+}
+
+
+static char *
+ngx_rtmp_codec_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
+{
+ ngx_rtmp_codec_app_conf_t *prev = parent;
+ ngx_rtmp_codec_app_conf_t *conf = child;
+
+ ngx_conf_merge_uint_value(conf->meta, prev->meta, NGX_RTMP_CODEC_META_ON);
+
+ return NGX_CONF_OK;
+}
+
+
static ngx_int_t
ngx_rtmp_codec_postconfiguration(ngx_conf_t *cf)
{
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_codec_module.h
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_control_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_core_module.c
^
|
@@ -1,12 +1,13 @@
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_event.h>
+#include <nginx.h>
#include "ngx_rtmp.h"
@@ -599,7 +600,11 @@
ls->bind = 1;
} else {
- len = ngx_sock_ntop(sa, buf, NGX_SOCKADDR_STRLEN, 1);
+ len = ngx_sock_ntop(sa,
+#if (nginx_version >= 1005003)
+ ls->socklen,
+#endif
+ buf, NGX_SOCKADDR_STRLEN, 1);
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"ipv6only is not supported "
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_enotify_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_eval.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_eval.h
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_exec_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_flv_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
@@ -541,6 +542,8 @@
h.timestamp > end_timestamp ? h.timestamp - end_timestamp : 0,
h.timestamp, end_timestamp, (ngx_int_t) buflen);
+ s->current_time = h.timestamp;
+
/* too much data sent; schedule timeout */
if (h.timestamp > end_timestamp) {
return h.timestamp - end_timestamp;
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_handler.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
@@ -276,7 +277,7 @@
s->in_last_ack = s->in_bytes;
ngx_log_debug1(NGX_LOG_DEBUG_RTMP, c->log, 0,
- "sending RTMP ACK(%D)", s->in_bytes);
+ "sending RTMP ACK(%uD)", s->in_bytes);
if (ngx_rtmp_send_ack(s, s->in_bytes)) {
ngx_rtmp_finalize_session(s);
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_handshake.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_init.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_limit_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2013 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_live_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
@@ -37,13 +38,6 @@
offsetof(ngx_rtmp_live_app_conf_t, live),
NULL },
- { ngx_string("meta"),
- NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_flag_slot,
- NGX_RTMP_APP_CONF_OFFSET,
- offsetof(ngx_rtmp_live_app_conf_t, meta),
- NULL },
-
{ ngx_string("stream_buckets"),
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
ngx_conf_set_str_slot,
@@ -150,7 +144,6 @@
}
lacf->live = NGX_CONF_UNSET;
- lacf->meta = NGX_CONF_UNSET;
lacf->nbuckets = NGX_CONF_UNSET;
lacf->buflen = NGX_CONF_UNSET_MSEC;
lacf->sync = NGX_CONF_UNSET_MSEC;
@@ -172,7 +165,6 @@
ngx_rtmp_live_app_conf_t *conf = child;
ngx_conf_merge_value(conf->live, prev->live, 0);
- ngx_conf_merge_value(conf->meta, prev->meta, 1);
ngx_conf_merge_value(conf->nbuckets, prev->nbuckets, 1024);
ngx_conf_merge_msec_value(conf->buflen, prev->buflen, 0);
ngx_conf_merge_msec_value(conf->sync, prev->sync, 300);
@@ -592,6 +584,11 @@
ngx_rtmp_live_stop(s);
}
+ if (ctx->publishing) {
+ ngx_rtmp_send_status(s, "NetStream.Unpublish.Success",
+ "status", "Stop publishing");
+ }
+
if (ctx->stream->ctx) {
ctx->stream = NULL;
goto next;
@@ -721,6 +718,8 @@
"live: %s packet timestamp=%uD",
type_s, h->timestamp);
+ s->current_time = h->timestamp;
+
peers = 0;
apkt = NULL;
aapkt = NULL;
@@ -809,7 +808,7 @@
}
}
- if (lacf->meta && codec_ctx->meta) {
+ if (codec_ctx->meta) {
meta = codec_ctx->meta;
meta_version = codec_ctx->meta_version;
}
@@ -920,6 +919,7 @@
cs->timestamp = lh.timestamp;
cs->active = 1;
+ ss->current_time = cs->timestamp;
} else {
@@ -941,6 +941,7 @@
cs->timestamp = ch.timestamp;
cs->active = 1;
+ ss->current_time = cs->timestamp;
++peers;
@@ -974,6 +975,7 @@
cs->timestamp += delta;
++peers;
+ ss->current_time = cs->timestamp;
}
if (rpkt) {
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_live_module.h
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_log_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2013 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_mp4_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
@@ -373,7 +374,8 @@
{ ngx_rtmp_mp4_make_tag('e','s','d','s'), ngx_rtmp_mp4_parse_esds },
{ ngx_rtmp_mp4_make_tag('.','m','p','3'), ngx_rtmp_mp4_parse_mp3 },
{ ngx_rtmp_mp4_make_tag('n','m','o','s'), ngx_rtmp_mp4_parse_nmos },
- { ngx_rtmp_mp4_make_tag('s','p','e','x'), ngx_rtmp_mp4_parse_spex }
+ { ngx_rtmp_mp4_make_tag('s','p','e','x'), ngx_rtmp_mp4_parse_spex },
+ { ngx_rtmp_mp4_make_tag('w','a','v','e'), ngx_rtmp_mp4_parse }
};
@@ -640,6 +642,7 @@
{
ngx_rtmp_mp4_ctx_t *ctx;
u_char *p;
+ ngx_uint_t version;
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_mp4_module);
@@ -653,7 +656,11 @@
return NGX_ERROR;
}
- pos += 16;
+ pos += 8;
+
+ version = ngx_rtmp_r16(*(uint16_t *) pos);
+
+ pos += 8;
ctx->nchannels = ngx_rtmp_r16(*(uint16_t *) pos);
@@ -696,10 +703,24 @@
break;
}
- ngx_log_debug4(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
- "mp4: audio settings codec=%i, nchannels==%ui, "
+ ngx_log_debug5(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
+ "mp4: audio settings version=%ui, codec=%i, nchannels==%ui, "
"sample_size=%ui, sample_rate=%ui",
- codec, ctx->nchannels, ctx->sample_size, ctx->sample_rate);
+ version, codec, ctx->nchannels, ctx->sample_size,
+ ctx->sample_rate);
+
+ switch (version) {
+ case 1:
+ pos += 16;
+ break;
+
+ case 2:
+ pos += 36;
+ }
+
+ if (pos > last) {
+ return NGX_ERROR;
+ }
if (ngx_rtmp_mp4_parse(s, pos, last) != NGX_OK) {
return NGX_ERROR;
@@ -2250,6 +2271,8 @@
return NGX_AGAIN;
}
+ s->current_time = timestamp;
+
if (ngx_rtmp_mp4_next(s, t) != NGX_OK) {
continue;
}
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_netcall_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_netcall_module.h
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_notify_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
@@ -694,6 +695,7 @@
b = ngx_create_temp_buf(pool,
sizeof("&call=update") + sfx.len +
sizeof("&time=") + NGX_TIME_T_LEN +
+ sizeof("×tamp=") + NGX_INT32_LEN +
sizeof("&name=") + name_len * 3 +
1 + args_len);
if (b == NULL) {
@@ -711,6 +713,10 @@
sizeof("&time=") - 1);
b->last = ngx_sprintf(b->last, "%T", ngx_cached_time->sec - ctx->start);
+ b->last = ngx_cpymem(b->last, (u_char *) "×tamp=",
+ sizeof("×tamp=") - 1);
+ b->last = ngx_sprintf(b->last, "%D", s->current_time);
+
if (name_len) {
b->last = ngx_cpymem(b->last, (u_char*) "&name=", sizeof("&name=") - 1);
b->last = (u_char*) ngx_escape_uri(b->last, ctx->name, name_len,
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_play_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_play_module.h
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_receive.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_record_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_record_module.h
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_relay_module.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_relay_module.h
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_send.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_shared.c
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_stat_module.c
^
|
@@ -1,12 +1,15 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
+#include <nginx.h>
#include "ngx_rtmp.h"
+#include "ngx_rtmp_version.h"
#include "ngx_rtmp_live_module.h"
#include "ngx_rtmp_play_module.h"
#include "ngx_rtmp_codec_module.h"
@@ -331,7 +334,7 @@
NGX_RTMP_STAT_L("</id>");
NGX_RTMP_STAT_L("<address>");
- NGX_RTMP_STAT_S(&s->connection->addr_text);
+ NGX_RTMP_STAT_ES(&s->connection->addr_text);
NGX_RTMP_STAT_L("</address>");
NGX_RTMP_STAT_L("<time>");
@@ -421,6 +424,11 @@
}
NGX_RTMP_STAT_L("</avsync>");
+ NGX_RTMP_STAT_L("<timestamp>");
+ NGX_RTMP_STAT(bbuf, ngx_snprintf(bbuf, sizeof(bbuf),
+ "%D", s->current_time) - bbuf);
+ NGX_RTMP_STAT_L("</timestamp>");
+
if (ctx->publishing) {
NGX_RTMP_STAT_L("<publishing/>");
}
@@ -507,6 +515,7 @@
ngx_rtmp_session_t *s;
ngx_uint_t n, nclients, total_nclients;
u_char buf[NGX_INT_T_LEN];
+ u_char bbuf[NGX_INT32_LEN];
ngx_rtmp_stat_loc_conf_t *slcf;
if (pacf->entries.nelts == 0) {
@@ -541,6 +550,11 @@
ngx_rtmp_stat_client(r, lll, s);
+ NGX_RTMP_STAT_L("<timestamp>");
+ NGX_RTMP_STAT(bbuf, ngx_snprintf(bbuf, sizeof(bbuf),
+ "%D", s->current_time) - bbuf);
+ NGX_RTMP_STAT_L("</timestamp>");
+
NGX_RTMP_STAT_L("</client>\r\n");
}
}
@@ -650,7 +664,11 @@
NGX_RTMP_STAT_L("<rtmp>\r\n");
#ifdef NGINX_VERSION
- NGX_RTMP_STAT_L("<version>" NGINX_VERSION "</version>\r\n");
+ NGX_RTMP_STAT_L("<nginx_version>" NGINX_VERSION "</nginx_version>\r\n");
+#endif
+
+#ifdef NGINX_RTMP_VERSION
+ NGX_RTMP_STAT_L("<nginx_rtmp_version>" NGINX_RTMP_VERSION "</nginx_rtmp_version>\r\n");
#endif
#ifdef NGX_COMPILER
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_streams.h
^
|
@@ -1,5 +1,6 @@
+
/*
- * Copyright (c) 2012 Roman Arutyunyan
+ * Copyright (C) Roman Arutyunyan
*/
|
[-]
[+]
|
Added |
nginx-rtmp-module-1.0.6.tar.bz2/ngx_rtmp_version.h
^
|
@@ -0,0 +1,15 @@
+
+/*
+ * Copyright (C) Roman Arutyunyan
+ */
+
+
+#ifndef _NGX_RTMP_VERSION_H_INCLUDED_
+#define _NGX_RTMP_VERSION_H_INCLUDED_
+
+
+#define nginx_rtmp_version 1000006
+#define NGINX_RTMP_VERSION "1.0.6"
+
+
+#endif /* _NGX_RTMP_VERSION_H_INCLUDED_ */
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/stat.xsl
^
|
@@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
+
+<!--
+ Copyright (C) Roman Arutyunyan
+-->
+
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
@@ -11,8 +17,9 @@
<body>
<xsl:apply-templates select="rtmp"/>
<hr/>
- Generated by <a href='https://github.com/arut/nginx-rtmp-module'>NGINX RTMP module</a>,
- <a href="http://nginx.com">NGINX</a> <xsl:value-of select="/rtmp/version"/>,
+ Generated by <a href='https://github.com/arut/nginx-rtmp-module'>
+ nginx-rtmp-module</a> <xsl:value-of select="/rtmp/nginx_rtmp_version"/>,
+ <a href="http://nginx.org">nginx</a> <xsl:value-of select="/rtmp/nginx_version"/>,
pid <xsl:value-of select="/rtmp/pid"/>,
built <xsl:value-of select="/rtmp/built"/> <xsl:value-of select="/rtmp/compiler"/>
</body>
@@ -189,6 +196,7 @@
<th>Page URL</th>
<th>SWF URL</th>
<th>Dropped</th>
+ <th>Timestamp</th>
<th>A-V</th>
<th>Time</th>
</tr>
@@ -288,6 +296,7 @@
</td>
<td><xsl:value-of select="swfurl"/></td>
<td><xsl:value-of select="dropped"/></td>
+ <td><xsl:value-of select="timestamp"/></td>
<td><xsl:value-of select="avsync"/></td>
<td>
<xsl:call-template name="showtime">
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/test/rtmp-publisher/RtmpPlayer.mxml
^
|
@@ -1,70 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:s="library://ns.adobe.com/flex/spark"
- xmlns:mx="library://ns.adobe.com/flex/mx"
- minWidth="500" minHeight="350" creationComplete="init()">
-
- <fx:Declarations>
- <!-- Place non-visual elements (e.g., services, value objects) here -->
- </fx:Declarations>
-
- <fx:Script>
- <![CDATA[
- import mx.controls.Alert;
- import mx.core.FlexGlobals;
- private var streamer:String;
- private var file:String;
-
- private function toggleFeedListener(event:MouseEvent):void {
- if(toggleFeed.label == 'Start Feed') {
- toggleFeed.label = 'Stop Feed';
- toggleAudio.enabled = true;
- videoDisplay.play();
- } else {
- toggleFeed.label = 'Start Feed';
- toggleAudio.enabled = false;
- videoDisplay.close();
- }
- }
-
- private function toggleAudioHandler(event:MouseEvent):void {
- if(toggleAudio.label == 'Unmute') {
- toggleAudio.label = 'Mute';
- videoDisplay.volume = 1;
- } else {
- toggleAudio.label = 'Unmute';
- videoDisplay.volume = 0;
- }
- }
-
- private function initListeners():void {
- toggleFeed.addEventListener(MouseEvent.CLICK, toggleFeedListener);
- toggleAudio.addEventListener(MouseEvent.CLICK, toggleAudioHandler);
- }
-
- private function init():void {
- streamer = FlexGlobals.topLevelApplication.parameters.streamer;
- file = FlexGlobals.topLevelApplication.parameters.file;
- if(file == null) {
- Alert.show('Missing flashvars: file');
- return;
- }
- if(streamer == null) {
- Alert.show('Missing flashvars: streamer');
- return;
- }
- videoDisplay.source = streamer + "/" + file;
- initListeners();
- }
- ]]>
- </fx:Script>
- <s:Panel x="0" y="0" width="100%" height="100%" title="RTMP Player">
- <mx:VideoDisplay width="100%" height="100%" id="videoDisplay" autoPlay="false">
- </mx:VideoDisplay>
- <s:controlBarContent>
- <s:Button label="Start Feed" id="toggleFeed"></s:Button>
- <s:Spacer width="100%" height="100%"/>
- <s:Button label="Mute" id="toggleAudio" enabled="false"></s:Button>
- </s:controlBarContent>
- </s:Panel>
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ minWidth="500" minHeight="350" creationComplete="init()">
+
+ <fx:Script>
+ <![CDATA[
+ import mx.controls.Alert;
+ import mx.core.FlexGlobals;
+ import flash.display.StageDisplayState;
+ import mx.managers.SystemManager;
+
+ private var streamer:String;
+ private var file:String;
+
+ private function playButtonListener(event:MouseEvent):void {
+ if(playButton.label == 'Play') {
+ playButton.label = 'Stop';
+ videoDisplay.source = streamer + "/" + file;
+ videoDisplay.play();
+ } else {
+ playButton.label = 'Play';
+ videoDisplay.source = "";
+ //videoDisplay.close();
+ }
+ }
+
+ private function fullscreenButtonListener(event:MouseEvent):void {
+ try {
+ switch (systemManager.stage.displayState) {
+ case StageDisplayState.FULL_SCREEN:
+ stage.displayState = StageDisplayState.NORMAL;
+ break;
+ default:
+ stage.displayState = StageDisplayState.FULL_SCREEN;
+ break;
+ }
+ } catch (err:SecurityError) {
+ // ignore
+ }
+ }
+
+ private function init():void {
+ videoDisplay.mx_internal::videoPlayer.bufferTime = 1;
+
+ streamer = FlexGlobals.topLevelApplication.parameters.streamer;
+ if(streamer == null) {
+ Alert.show('Missing flashvars: streamer');
+ return;
+ }
+
+ file = FlexGlobals.topLevelApplication.parameters.file;
+ if(file == null) {
+ Alert.show('Missing flashvars: file');
+ return;
+ }
+
+ playButton.addEventListener(MouseEvent.CLICK, playButtonListener);
+ fullscreenButton.addEventListener(MouseEvent.CLICK, fullscreenButtonListener);
+ }
+ ]]>
+ </fx:Script>
+ <s:BorderContainer x="0" y="0" width="100%" height="100%">
+ <s:VideoDisplay width="100%" height="100%" id="videoDisplay"></s:VideoDisplay>
+ <s:Button label="Play" id="playButton" horizontalCenter="0" bottom="10"></s:Button>
+ <s:Button label="[ ]" id="fullscreenButton" right="10" bottom="10"></s:Button>
+ </s:BorderContainer>
</s:Application>
|
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/test/rtmp-publisher/RtmpPlayer.swf
^
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/test/rtmp-publisher/RtmpPublisher.mxml
^
|
@@ -4,14 +4,13 @@
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="500" minHeight="350" creationComplete="init()">
- <fx:Declarations>
- <!-- Place non-visual elements (e.g., services, value objects) here -->
- </fx:Declarations>
-
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.core.FlexGlobals;
+ import mx.events.FlexEvent;
+ import spark.skins.spark.PanelSkin;
+
private var streamer:String;
private var file:String;
private var camera:Camera;
@@ -20,50 +19,21 @@
private var stream:NetStream;
private var h264Settings:H264VideoStreamSettings;
- private function toggleFeedListener(event:MouseEvent):void {
- if(toggleFeed.label == 'Start Feed') {
- toggleFeed.label = 'Stop Feed';
- stream.publish(file, 'live');
- videoDisplay.attachCamera(camera);
- toggleVideo.enabled = true;
- toggleAudio.enabled = true;
+ private function publishButtonListener(event:MouseEvent):void {
+ if(publishButton.label == 'Publish') {
+ publishButton.label = 'Stop';
+ connection = new NetConnection();
+ connection.connect(streamer);
+ connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHander);
} else {
- toggleFeed.label = 'Start Feed';
+ publishButton.label = 'Publish';
stream.close();
- videoDisplay.attachCamera(null);
- toggleVideo.enabled = false;
- toggleAudio.enabled = false;
- }
- }
-
- private function toggleVideoListener(event:MouseEvent):void {
- if(toggleVideo.label == 'Start Video') {
- toggleVideo.label = 'Stop Video';
- videoDisplay.attachCamera(camera);
- stream.attachCamera(camera);
- } else {
- toggleVideo.label = 'Start Video';
- videoDisplay.attachCamera(null);
- stream.attachCamera(null);
- }
- }
-
- private function toggleAudioListener(event:MouseEvent):void {
- if(toggleAudio.label == 'Start Audio') {
- toggleAudio.label = 'Stop Audio';
- stream.attachAudio(microphone);
- } else {
- toggleAudio.label = 'Start Audio';
- stream.attachAudio(null);
+ connection.close();
+ stream = null;
+ connection = null;
}
}
- private function initListeners():void {
- toggleFeed.addEventListener(MouseEvent.CLICK, toggleFeedListener);
- toggleVideo.addEventListener(MouseEvent.CLICK, toggleVideoListener);
- toggleAudio.addEventListener(MouseEvent.CLICK, toggleAudioListener);
- }
-
private function netStatusHander(event:NetStatusEvent):void {
switch(event.info.code) {
case 'NetConnection.Connect.Success':
@@ -71,47 +41,46 @@
stream.attachCamera(camera);
stream.attachAudio(microphone);
h264Settings = new H264VideoStreamSettings();
- h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_1_2);
+ h264Settings.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_3_1);
stream.videoStreamSettings = h264Settings;
+ stream.publish(file, 'live');
break;
}
}
private function init():void {
streamer = FlexGlobals.topLevelApplication.parameters.streamer;
+ if(streamer == null) {
+ Alert.show('Missing flashvars: streamer');
+ return;
+ }
+
file = FlexGlobals.topLevelApplication.parameters.file;
if(file == null) {
Alert.show('Missing flashvars: file');
return;
}
- if(streamer == null) {
- Alert.show('Missing flashvars: streamer');
- return;
- }
- initListeners();
+
+ publishButton.addEventListener(MouseEvent.CLICK, publishButtonListener);
camera = Camera.getCamera();
+ camera.setMode(640, 480, 30);
+ camera.setQuality(131072, 70);
+
+ //videoDisplay.attachCamera(camera);
+ var localCam:Video = new Video(640,480);
+ localCam.attachCamera(camera);
+ videoDisplay.addChild(localCam);
+
microphone = Microphone.getMicrophone();
microphone.setSilenceLevel(0);
microphone.codec = "Speex";
microphone.encodeQuality = 6;
- camera.setMode(704, 576, 25);
- camera.setQuality(131072, 70);
- connection = new NetConnection();
- connection.connect(streamer);
- connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHander);
-
}
]]>
</fx:Script>
- <s:Panel x="0" y="0" width="100%" height="100%" title="RTMP Publisher">
- <mx:VideoDisplay width="100%" height="100%" id="videoDisplay">
- </mx:VideoDisplay>
- <s:controlBarContent>
- <s:Button label="Start Feed" id="toggleFeed"></s:Button>
- <s:Spacer width="100%" height="100%"/>
- <s:Button label="Stop Video" id="toggleVideo" enabled="false"></s:Button>
- <s:Button label="Stop Audio" id="toggleAudio" enabled="false"></s:Button>
- </s:controlBarContent>
- </s:Panel>
+ <s:BorderContainer x="0" y="0" width="100%" height="100%">
+ <s:VideoDisplay width="100%" height="100%" id="videoDisplay"></s:VideoDisplay>
+ <s:Button label="Publish" id="publishButton" horizontalCenter="0" bottom="10"></s:Button>
+ </s:BorderContainer>
</s:Application>
|
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/test/rtmp-publisher/RtmpPublisher.swf
^
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/test/rtmp-publisher/player.html
^
|
@@ -8,7 +8,10 @@
streamer: 'rtmp://localhost/myapp',
file:'mystream'
};
- swfobject.embedSWF("RtmpPlayer.swf", "rtmp-publisher", "500", "400", "9.0.0", null, flashVars);
+ var params = {};
+ params.allowfullscreen = "true";
+ var attributes = {};
+ swfobject.embedSWF("RtmpPlayer.swf", "rtmp-publisher", "640", "480", "9.0.0", null, flashVars, params, attributes);
</script>
</head>
<body>
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.6.tar.bz2/test/rtmp-publisher/publisher.html
^
|
@@ -8,7 +8,7 @@
streamer: 'rtmp://localhost/myapp',
file:'mystream'
};
- swfobject.embedSWF("RtmpPublisher.swf", "rtmp-publisher", "500", "400", "9.0.0", null, flashVars);
+ swfobject.embedSWF("RtmpPublisher.swf", "rtmp-publisher", "640", "480", "9.0.0", null, flashVars);
</script>
</head>
<body>
|