Permalink
Browse files

merged master into sync

o sync

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
  • Loading branch information...
arut committed Sep 28, 2012
2 parents 9652689 + 17886de commit ac13bbf1af345532a009a88d93ac4b7869ffe456
View
@@ -2,13 +2,13 @@
## nginx-rtmp-module
-### Project page:
+### Project blog:
- http://arut.github.com/nginx-rtmp-module
+ http://rarut.wordpress.com
### Wiki manual:
- https://github.com/arut/nginx-rtmp-module/wiki
+ https://github.com/arut/nginx-rtmp-module/wiki/Directives
### Features:
@@ -19,17 +19,19 @@
* Stream relay support for distributed
streaming: push & pull models
-* Recording published streams in FLV file
+* Recording streams in multiple FLVs
* H264/AAC support
* Online transcoding with FFmpeg
* HLS (HTTP Live Streaming) support;
- experimental; requires recent libavformat
+ requires recent libavformat
(>= 53.31.100) from ffmpeg (ffmpeg.org)
-* HTTP callbacks on publish/play/record
+* HTTP callbacks (publish/play/record etc)
+
+* Running external programs on certain events (exec)
* Advanced buffering techniques
to keep memory allocations at a minimum
@@ -44,6 +46,8 @@
* Statistics in XML/XSL in machine- & human-
readable form
+* Linux/FreeBSD/MacOS
+
### Build:
@@ -197,7 +201,7 @@ rtmp_auto_push directive.
}
- # HLS (experimental)
+ # HLS
# HLS requires libavformat & should be configured as a separate
# NGINX module in addition to nginx-rtmp-module:
View
12 config
@@ -5,16 +5,18 @@ CORE_MODULES="$CORE_MODULES
ngx_rtmp_core_module \
ngx_rtmp_cmd_module \
ngx_rtmp_access_module \
+ ngx_rtmp_record_module \
ngx_rtmp_live_module \
ngx_rtmp_play_module \
ngx_rtmp_flv_module \
ngx_rtmp_mp4_module \
- ngx_rtmp_record_module \
ngx_rtmp_netcall_module \
- ngx_rtmp_notify_module \
ngx_rtmp_relay_module \
ngx_rtmp_exec_module \
ngx_rtmp_codec_module \
+ ngx_rtmp_auto_push_module \
+ ngx_rtmp_enotify_module \
+ ngx_rtmp_notify_module \
"
@@ -31,23 +33,25 @@ NGX_ADDON_SRCS="$NGX_ADDON_SRCS \
$ngx_addon_dir/ngx_rtmp_amf.c \
$ngx_addon_dir/ngx_rtmp_send.c \
$ngx_addon_dir/ngx_rtmp_shared.c \
+ $ngx_addon_dir/ngx_rtmp_eval.c \
$ngx_addon_dir/ngx_rtmp_receive.c \
$ngx_addon_dir/ngx_rtmp_core_module.c \
$ngx_addon_dir/ngx_rtmp_cmd_module.c \
$ngx_addon_dir/ngx_rtmp_access_module.c \
+ $ngx_addon_dir/ngx_rtmp_record_module.c \
$ngx_addon_dir/ngx_rtmp_live_module.c \
$ngx_addon_dir/ngx_rtmp_play_module.c \
$ngx_addon_dir/ngx_rtmp_flv_module.c \
$ngx_addon_dir/ngx_rtmp_mp4_module.c \
- $ngx_addon_dir/ngx_rtmp_record_module.c \
$ngx_addon_dir/ngx_rtmp_netcall_module.c \
- $ngx_addon_dir/ngx_rtmp_notify_module.c \
$ngx_addon_dir/ngx_rtmp_stat_module.c \
$ngx_addon_dir/ngx_rtmp_relay_module.c \
$ngx_addon_dir/ngx_rtmp_bandwidth.c \
$ngx_addon_dir/ngx_rtmp_exec_module.c \
$ngx_addon_dir/ngx_rtmp_codec_module.c \
$ngx_addon_dir/ngx_rtmp_auto_push_module.c \
+ $ngx_addon_dir/ngx_rtmp_enotify_module.c \
+ $ngx_addon_dir/ngx_rtmp_notify_module.c \
"
CFLAGS="$CFLAGS -I$ngx_addon_dir"
View
@@ -317,6 +317,7 @@ ngx_rtmp_merge_applications(ngx_conf_t *cf, ngx_array_t *applications,
ngx_rtmp_conf_ctx_t *ctx, saved;
ngx_rtmp_core_app_conf_t **cacfp;
ngx_uint_t n;
+ ngx_rtmp_core_app_conf_t *cacf;
if (applications == NULL) {
return NGX_CONF_OK;
@@ -335,6 +336,14 @@ ngx_rtmp_merge_applications(ngx_conf_t *cf, ngx_array_t *applications,
if (rv != NGX_CONF_OK) {
return rv;
}
+
+ cacf = (*cacfp)->app_conf[ngx_rtmp_core_module.ctx_index];
+ rv = ngx_rtmp_merge_applications(cf, &cacf->applications,
+ (*cacfp)->app_conf,
+ module, ctx_index);
+ if (rv != NGX_CONF_OK) {
+ return rv;
+ }
}
*ctx = saved;
View
@@ -209,6 +209,7 @@ typedef struct {
/* auto-pushed? */
unsigned auto_pushed:1;
+ unsigned relay:1;
/* input stream 0 (reserved by RTMP spec)
* is used as free chain link */
@@ -294,6 +295,7 @@ typedef struct ngx_rtmp_core_srv_conf_s {
typedef struct {
+ ngx_array_t applications; /* ngx_rtmp_core_app_conf_t */
ngx_str_t name;
void **app_conf;
} ngx_rtmp_core_app_conf_t;
@@ -326,6 +328,7 @@ typedef struct {
#define NGX_RTMP_MAIN_CONF 0x02000000
#define NGX_RTMP_SRV_CONF 0x04000000
#define NGX_RTMP_APP_CONF 0x08000000
+#define NGX_RTMP_REC_CONF 0x10000000
#define NGX_RTMP_MAIN_CONF_OFFSET offsetof(ngx_rtmp_conf_ctx_t, main_conf)
@@ -400,7 +400,7 @@ ngx_rtmp_auto_push_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v)
ngx_rtmp_auto_push_conf_t *apcf;
ngx_rtmp_auto_push_ctx_t *ctx;
- if (s->auto_pushed) {
+ if (s->auto_pushed || s->relay) {
goto next;
}
View
@@ -200,7 +200,7 @@ ngx_rtmp_cmd_connect(ngx_rtmp_session_t *s, ngx_rtmp_connect_t *v)
cscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_core_module);
- ngx_log_debug8(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
+ ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"connect: app='%s' flashver='%s' swf_url='%s' "
"tc_url='%s' page_url='%s' acodecs=%uD vcodecs=%uD "
"object_encoding=%ui",
@@ -327,7 +327,7 @@ ngx_rtmp_cmd_create_stream(ngx_rtmp_session_t *s, ngx_rtmp_create_stream_t *v)
h.csid = NGX_RTMP_CMD_CSID_AMF_INI;
h.type = NGX_RTMP_MSG_AMF_CMD;
- ngx_log_debug0(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
+ ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"createStream");
/* send result with standard stream */
@@ -415,6 +415,9 @@ ngx_rtmp_cmd_delete_stream(ngx_rtmp_session_t *s, ngx_rtmp_delete_stream_t *v)
{
ngx_rtmp_close_stream_t cv;
+ ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
+ "deleteStream");
+
/* chain close_stream */
cv.stream = 0;
return ngx_rtmp_close_stream
@@ -523,7 +526,7 @@ ngx_rtmp_cmd_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v)
out_inf, sizeof(out_inf) },
};
- ngx_log_debug4(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
+ ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"publish: name='%s' args='%s' type=%s silent=%d",
v->name, v->args, v->type, v->silent);
@@ -621,7 +624,7 @@ ngx_rtmp_cmd_fcpublish(ngx_rtmp_session_t *s, ngx_rtmp_fcpublish_t *v)
out_inf, sizeof(out_inf) },
};
- ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
+ ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"fcpublish: name='%s'", v->name);
/* send onFCPublish reply */
@@ -801,8 +804,8 @@ ngx_rtmp_cmd_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
out4_inf, sizeof(out4_inf) },
};
- ngx_log_debug6(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
- "cmd: play name='%s' args='%s' start=%i duration=%i "
+ ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
+ "play name='%s' args='%s' start=%i duration=%i "
"reset=%i silent=%i",
v->name, v->args, (ngx_int_t) v->start,
(ngx_int_t) v->duration, (ngx_int_t) v->reset,
@@ -934,7 +937,7 @@ ngx_rtmp_cmd_fcsubscribe(ngx_rtmp_session_t *s, ngx_rtmp_fcsubscribe_t *v)
sizeof(out_inf) },
};
- ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
+ ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
"fcsubscribe: name='%s'", v->name);
/* send onFCSubscribe reply */
@@ -1038,6 +1041,10 @@ ngx_rtmp_cmd_pause(ngx_rtmp_session_t *s, ngx_rtmp_pause_t *v)
out_inf, sizeof(out_inf) },
};
+ ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
+ "pause: state='%i' position=%i",
+ v->pause, (ngx_int_t) v->position);
+
/* send onStatus reply */
ngx_memzero(&h, sizeof(h));
h.type = NGX_RTMP_MSG_AMF_CMD;
@@ -1068,6 +1075,9 @@ static ngx_int_t
ngx_rtmp_cmd_disconnect(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
ngx_chain_t *in)
{
+ ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
+ "disconnect");
+
return ngx_rtmp_delete_stream
? ngx_rtmp_delete_stream(s, NULL)
: NGX_OK;
@@ -1152,6 +1162,9 @@ ngx_rtmp_cmd_seek(ngx_rtmp_session_t *s, ngx_rtmp_seek_t *v)
out_inf, sizeof(out_inf) },
};
+ ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
+ "seek: offset=%i", (ngx_int_t) v->offset);
+
/* send onStatus reply */
ngx_memzero(&h, sizeof(h));
h.type = NGX_RTMP_MSG_AMF_CMD;
View
@@ -282,6 +282,13 @@ ngx_rtmp_core_create_app_conf(ngx_conf_t *cf)
return NULL;
}
+ if (ngx_array_init(&conf->applications, cf->pool, 1,
+ sizeof(ngx_rtmp_core_app_conf_t *))
+ != NGX_OK)
+ {
+ return NULL;
+ }
+
return conf;
}
Oops, something went wrong.

0 comments on commit ac13bbf

Please sign in to comment.