[-]
[+]
|
Changed |
nginx-1.4.changes
|
|
[-]
[+]
|
Changed |
nginx-1.4.spec
^
|
|
[-]
[+]
|
Changed |
nginx-1.4.3.tar.gz/CHANGES
^
|
@@ -1,4 +1,25 @@
+Changes with nginx 1.4.3 08 Oct 2013
+
+ *) Bugfix: a segmentation fault might occur in a worker process if the
+ ngx_http_spdy_module was used with the "client_body_in_file_only"
+ directive.
+
+ *) Bugfix: a segmentation fault might occur on start or during
+ reconfiguration if the "try_files" directive was used with an empty
+ parameter.
+
+ *) Bugfix: the $request_time variable did not work in nginx/Windows.
+
+ *) Bugfix: in the ngx_http_auth_basic_module when using "$apr1$"
+ password encryption method.
+ Thanks to Markus Linnala.
+
+ *) Bugfix: in the ngx_http_autoindex_module.
+
+ *) Bugfix: in the mail proxy server.
+
+
Changes with nginx 1.4.2 17 Jul 2013
*) Bugfix: the $r->header_in() embedded perl method did not return value
|
[-]
[+]
|
Changed |
nginx-1.4.3.tar.gz/CHANGES.ru
^
|
@@ -1,4 +1,25 @@
+Изменения в nginx 1.4.3 08.10.2013
+
+ *) Исправление: в рабочем процессе мог произойти segmentation fault,
+ если использовался модуль ngx_http_spdy_module и директива
+ client_body_in_file_only.
+
+ *) Исправление: на старте или во время переконфигурации мог произойти
+ segmentation fault, если использовалась директива try_files с пустым
+ параметром.
+
+ *) Исправление: переменная $request_time не работала в nginx/Windows.
+
+ *) Исправление: в модуле ngx_http_auth_basic_module при использовании
+ метода шифрования паролей "$apr1$".
+ Спасибо Markus Linnala.
+
+ *) Исправление: в модуле ngx_http_autoindex_module.
+
+ *) Исправление: в почтовом прокси-сервере.
+
+
Изменения в nginx 1.4.2 17.07.2013
*) Исправление: метод $r->header_in() встроенного перла не возвращал
|
[-]
[+]
|
Changed |
nginx-1.4.3.tar.gz/src/core/nginx.h
^
|
@@ -9,8 +9,8 @@
#define _NGINX_H_INCLUDED_
-#define nginx_version 1004002
-#define NGINX_VERSION "1.4.2"
+#define nginx_version 1004003
+#define NGINX_VERSION "1.4.3"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
|
[-]
[+]
|
Changed |
nginx-1.4.3.tar.gz/src/core/ngx_crypt.c
^
|
@@ -137,7 +137,7 @@
/* output */
- *encrypted = ngx_pnalloc(pool, sizeof("$apr1$") - 1 + saltlen + 16 + 1);
+ *encrypted = ngx_pnalloc(pool, sizeof("$apr1$") - 1 + saltlen + 1 + 22 + 1);
if (*encrypted == NULL) {
return NGX_ERROR;
}
|
[-]
[+]
|
Changed |
nginx-1.4.3.tar.gz/src/http/modules/ngx_http_autoindex_module.c
^
|
@@ -304,7 +304,7 @@
if (ngx_de_info(filename, &dir) == NGX_FILE_ERROR) {
err = ngx_errno;
- if (err != NGX_ENOENT) {
+ if (err != NGX_ENOENT && err != NGX_ELOOP) {
ngx_log_error(NGX_LOG_CRIT, r->connection->log, err,
ngx_de_info_n " \"%s\" failed", filename);
@@ -388,7 +388,7 @@
b = ngx_create_temp_buf(r->pool, len);
if (b == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ return NGX_ERROR;
}
if (entries.nelts > 1) {
@@ -649,7 +649,7 @@
ngx_close_dir_n " \"%V\" failed", name);
}
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ return r->header_sent ? NGX_ERROR : NGX_HTTP_INTERNAL_SERVER_ERROR;
}
|
[-]
[+]
|
Changed |
nginx-1.4.3.tar.gz/src/http/modules/ngx_http_log_module.c
^
|
@@ -780,7 +780,7 @@
((tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec));
ms = ngx_max(ms, 0);
- return ngx_sprintf(buf, "%T.%03M", ms / 1000, ms % 1000);
+ return ngx_sprintf(buf, "%T.%03M", (time_t) ms / 1000, ms % 1000);
}
|
[-]
[+]
|
Changed |
nginx-1.4.3.tar.gz/src/http/ngx_http_core_module.c
^
|
@@ -4758,7 +4758,9 @@
tf[i].name = value[i + 1];
- if (tf[i].name.data[tf[i].name.len - 1] == '/') {
+ if (tf[i].name.len > 0
+ && tf[i].name.data[tf[i].name.len - 1] == '/')
+ {
tf[i].test_dir = 1;
tf[i].name.len--;
tf[i].name.data[tf[i].name.len] = '\0';
|
[-]
[+]
|
Changed |
nginx-1.4.3.tar.gz/src/http/ngx_http_spdy.c
^
|
@@ -2529,13 +2529,6 @@
return NGX_ERROR;
}
- if (rb->rest == 0) {
- buf->in_file = 1;
- buf->file = &tf->file;
- } else {
- rb->buf = buf;
- }
-
} else {
if (rb->rest == 0) {
@@ -2546,10 +2539,10 @@
if (buf == NULL) {
return NGX_ERROR;
}
-
- rb->buf = buf;
}
+ rb->buf = buf;
+
rb->bufs = ngx_alloc_chain_link(r->pool);
if (rb->bufs == NULL) {
return NGX_ERROR;
|
[-]
[+]
|
Changed |
nginx-1.4.3.tar.gz/src/http/ngx_http_variables.c
^
|
@@ -1988,7 +1988,7 @@
((tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec));
ms = ngx_max(ms, 0);
- v->len = ngx_sprintf(p, "%T.%03M", ms / 1000, ms % 1000) - p;
+ v->len = ngx_sprintf(p, "%T.%03M", (time_t) ms / 1000, ms % 1000) - p;
v->valid = 1;
v->no_cacheable = 0;
v->not_found = 0;
|
[-]
[+]
|
Changed |
nginx-1.4.3.tar.gz/src/mail/ngx_mail_smtp_module.c
^
|
@@ -277,7 +277,6 @@
p = ngx_cpymem(p, conf->capability.data, conf->capability.len);
p = ngx_cpymem(p, "250 STARTTLS" CRLF, sizeof("250 STARTTLS" CRLF) - 1);
- *p++ = CR; *p = LF;
p = conf->starttls_capability.data
+ (last - conf->capability.data) + 3;
|
[-]
[+]
|
Changed |
nginx-1.4.3.tar.gz/src/mail/ngx_mail_ssl_module.c
^
|
@@ -235,6 +235,11 @@
mode = "";
}
+ if (conf->file == NULL) {
+ conf->file = prev->file;
+ conf->line = prev->line;
+ }
+
if (*mode) {
if (conf->certificate.len == 0) {
|
[-]
[+]
|
Changed |
nginx-1.4.3.tar.gz/src/os/unix/ngx_errno.h
^
|
@@ -49,10 +49,10 @@
#define NGX_ECANCELED ECANCELED
#define NGX_EILSEQ EILSEQ
#define NGX_ENOMOREFILES 0
+#define NGX_ELOOP ELOOP
#if (NGX_HAVE_OPENAT)
#define NGX_EMLINK EMLINK
-#define NGX_ELOOP ELOOP
#endif
#if (__hpux__)
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.5.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.5.tar.bz2/ngx_rtmp_cmd_module.c
^
|
@@ -171,7 +171,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.5.tar.bz2/ngx_rtmp_codec_module.c
^
|
@@ -10,7 +10,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 +59,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 +315,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 +433,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 +487,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 +586,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 +634,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.5.tar.bz2/ngx_rtmp_core_module.c
^
|
@@ -7,6 +7,7 @@
#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.5.tar.bz2/ngx_rtmp_handler.c
^
|
@@ -276,7 +276,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.5.tar.bz2/ngx_rtmp_live_module.c
^
|
@@ -37,13 +37,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 +143,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 +164,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 +583,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;
@@ -809,7 +805,7 @@
}
}
- if (lacf->meta && codec_ctx->meta) {
+ if (codec_ctx->meta) {
meta = codec_ctx->meta;
meta_version = codec_ctx->meta_version;
}
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.5.tar.bz2/ngx_rtmp_stat_module.c
^
|
@@ -331,7 +331,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>");
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.5.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.5.tar.bz2/test/rtmp-publisher/RtmpPlayer.swf
^
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.5.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.5.tar.bz2/test/rtmp-publisher/RtmpPublisher.swf
^
|
[-]
[+]
|
Changed |
nginx-rtmp-module-1.0.5.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.5.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>
|