mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-06-10 09:39:33 +02:00
Get changes from @arut c0bf381d10
This commit is contained in:
parent
4809496d78
commit
4bf6852a28
1
config
1
config
|
@ -14,6 +14,7 @@ RTMP_CORE_MODULES=" \
|
||||||
ngx_rtmp_relay_module \
|
ngx_rtmp_relay_module \
|
||||||
ngx_rtmp_exec_module \
|
ngx_rtmp_exec_module \
|
||||||
ngx_rtmp_auto_push_module \
|
ngx_rtmp_auto_push_module \
|
||||||
|
ngx_rtmp_auto_push_index_module \
|
||||||
ngx_rtmp_notify_module \
|
ngx_rtmp_notify_module \
|
||||||
ngx_rtmp_log_module \
|
ngx_rtmp_log_module \
|
||||||
ngx_rtmp_limit_module \
|
ngx_rtmp_limit_module \
|
||||||
|
|
|
@ -93,6 +93,34 @@ ngx_module_t ngx_rtmp_auto_push_module = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static ngx_rtmp_module_t ngx_rtmp_auto_push_index_module_ctx = {
|
||||||
|
NULL, /* preconfiguration */
|
||||||
|
NULL, /* postconfiguration */
|
||||||
|
NULL, /* create main configuration */
|
||||||
|
NULL, /* init main configuration */
|
||||||
|
NULL, /* create server configuration */
|
||||||
|
NULL, /* merge server configuration */
|
||||||
|
NULL, /* create app configuration */
|
||||||
|
NULL /* merge app configuration */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
ngx_module_t ngx_rtmp_auto_push_index_module = {
|
||||||
|
NGX_MODULE_V1,
|
||||||
|
&ngx_rtmp_auto_push_index_module_ctx, /* module context */
|
||||||
|
NULL, /* module directives */
|
||||||
|
NGX_RTMP_MODULE, /* module type */
|
||||||
|
NULL, /* init master */
|
||||||
|
NULL, /* init module */
|
||||||
|
NULL, /* init process */
|
||||||
|
NULL, /* init thread */
|
||||||
|
NULL, /* exit thread */
|
||||||
|
NULL, /* exit process */
|
||||||
|
NULL, /* exit master */
|
||||||
|
NGX_MODULE_V1_PADDING
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#define NGX_RTMP_AUTO_PUSH_SOCKNAME "nginx-rtmp"
|
#define NGX_RTMP_AUTO_PUSH_SOCKNAME "nginx-rtmp"
|
||||||
|
|
||||||
|
|
||||||
|
@ -324,7 +352,7 @@ ngx_rtmp_auto_push_reconnect(ngx_event_t *ev)
|
||||||
|
|
||||||
apcf = (ngx_rtmp_auto_push_conf_t *) ngx_get_conf(ngx_cycle->conf_ctx,
|
apcf = (ngx_rtmp_auto_push_conf_t *) ngx_get_conf(ngx_cycle->conf_ctx,
|
||||||
ngx_rtmp_auto_push_module);
|
ngx_rtmp_auto_push_module);
|
||||||
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_auto_push_module);
|
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_auto_push_index_module);
|
||||||
if (ctx == NULL) {
|
if (ctx == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -461,14 +489,14 @@ ngx_rtmp_auto_push_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v)
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_auto_push_module);
|
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_auto_push_index_module);
|
||||||
if (ctx == NULL) {
|
if (ctx == NULL) {
|
||||||
ctx = ngx_palloc(s->connection->pool,
|
ctx = ngx_palloc(s->connection->pool,
|
||||||
sizeof(ngx_rtmp_auto_push_ctx_t));
|
sizeof(ngx_rtmp_auto_push_ctx_t));
|
||||||
if (ctx == NULL) {
|
if (ctx == NULL) {
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
ngx_rtmp_set_ctx(s, ctx, ngx_rtmp_auto_push_module);
|
ngx_rtmp_set_ctx(s, ctx, ngx_rtmp_auto_push_index_module);
|
||||||
|
|
||||||
}
|
}
|
||||||
ngx_memzero(ctx, sizeof(*ctx));
|
ngx_memzero(ctx, sizeof(*ctx));
|
||||||
|
@ -508,7 +536,7 @@ ngx_rtmp_auto_push_delete_stream(ngx_rtmp_session_t *s,
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_auto_push_module);
|
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_auto_push_index_module);
|
||||||
if (ctx) {
|
if (ctx) {
|
||||||
if (ctx->push_evt.timer_set) {
|
if (ctx->push_evt.timer_set) {
|
||||||
ngx_del_timer(&ctx->push_evt);
|
ngx_del_timer(&ctx->push_evt);
|
||||||
|
@ -532,7 +560,7 @@ ngx_rtmp_auto_push_delete_stream(ngx_rtmp_session_t *s,
|
||||||
slot, &rctx->app, &rctx->name);
|
slot, &rctx->app, &rctx->name);
|
||||||
|
|
||||||
pctx = ngx_rtmp_get_module_ctx(rctx->publish->session,
|
pctx = ngx_rtmp_get_module_ctx(rctx->publish->session,
|
||||||
ngx_rtmp_auto_push_module);
|
ngx_rtmp_auto_push_index_module);
|
||||||
if (pctx == NULL) {
|
if (pctx == NULL) {
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
|
|
|
@ -458,8 +458,7 @@ ngx_rtmp_core_application(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||||
module = modules[i]->ctx;
|
module = modules[i]->ctx;
|
||||||
|
|
||||||
if (module->create_app_conf) {
|
if (module->create_app_conf) {
|
||||||
ctx->app_conf[modules[i]->ctx_index] =
|
ctx->app_conf[modules[i]->ctx_index] = module->create_app_conf(cf);
|
||||||
module->create_app_conf(cf);
|
|
||||||
if (ctx->app_conf[modules[i]->ctx_index] == NULL) {
|
if (ctx->app_conf[modules[i]->ctx_index] == NULL) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue