diff --git a/ngx_rtmp_cmd_module.c b/ngx_rtmp_cmd_module.c index 1995092..af63ed1 100644 --- a/ngx_rtmp_cmd_module.c +++ b/ngx_rtmp_cmd_module.c @@ -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; diff --git a/ngx_rtmp_enotify_module.c b/ngx_rtmp_enotify_module.c index 86e4216..b7147ad 100644 --- a/ngx_rtmp_enotify_module.c +++ b/ngx_rtmp_enotify_module.c @@ -62,7 +62,6 @@ typedef struct { u_char name[NGX_RTMP_MAX_NAME]; u_char args[NGX_RTMP_MAX_ARGS]; ngx_str_t path; - ngx_str_t filename; ngx_str_t recorder; } ngx_rtmp_enotify_ctx_t; @@ -184,10 +183,6 @@ static ngx_rtmp_eval_t ngx_rtmp_enotify_eval[] = { ngx_rtmp_enotify_eval_str, offsetof(ngx_rtmp_enotify_ctx_t, path) }, - { ngx_string("filename"), - ngx_rtmp_enotify_eval_str, - offsetof(ngx_rtmp_enotify_ctx_t, filename) }, - { ngx_string("recorder"), ngx_rtmp_enotify_eval_str, offsetof(ngx_rtmp_enotify_ctx_t, recorder) }, @@ -344,8 +339,8 @@ ngx_rtmp_enotify_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v) goto next; } - ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, - "enotify: publish '%V'", &ec->cmd); + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, + "enotify: publish '%V'", &ec->cmd); ngx_rtmp_enotify_exec(s, ec); @@ -378,8 +373,8 @@ ngx_rtmp_enotify_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v) goto next; } - ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, - "enotify: play '%V'", &ec->cmd); + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, + "enotify: play '%V'", &ec->cmd); ngx_rtmp_enotify_exec(s, ec); @@ -411,17 +406,14 @@ ngx_rtmp_enotify_delete_stream(ngx_rtmp_session_t *s, ngx_rtmp_delete_stream_t if (enacf == NULL) { goto next; } - ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, - "enotify: delete_stream %ui", - ctx->flags); if (enacf->event[NGX_RTMP_ENOTIFY_PUBLISH_DONE] && (ctx->flags & NGX_RTMP_ENOTIFY_PUBLISHING)) { ec = enacf->event[NGX_RTMP_ENOTIFY_PUBLISH_DONE]; - ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, - "enotify: publish_done '%V'", &ec->cmd); + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, + "enotify: publish_done '%V'", &ec->cmd); ngx_rtmp_enotify_exec(s, ec); } @@ -431,8 +423,8 @@ ngx_rtmp_enotify_delete_stream(ngx_rtmp_session_t *s, ngx_rtmp_delete_stream_t { ec = enacf->event[NGX_RTMP_ENOTIFY_PLAY_DONE]; - ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, - "enotify: play_done '%V'", &ec->cmd); + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, + "enotify: play_done '%V'", &ec->cmd); ngx_rtmp_enotify_exec(s, ec); } @@ -450,7 +442,6 @@ ngx_rtmp_enotify_record_done(ngx_rtmp_session_t *s, ngx_rtmp_record_done_t *v) ngx_rtmp_enotify_app_conf_t *enacf; ngx_rtmp_enotify_conf_t *ec; ngx_rtmp_enotify_ctx_t *ctx; - ngx_int_t n; if (s->auto_pushed) { goto next; @@ -463,9 +454,9 @@ ngx_rtmp_enotify_record_done(ngx_rtmp_session_t *s, ngx_rtmp_record_done_t *v) ec = enacf->event[NGX_RTMP_ENOTIFY_RECORD_DONE]; - ngx_log_debug3(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, - "enotify: record_done %V recorder=%V path='%V'", - &ec->cmd, &v->recorder, &v->path); + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, + "enotify: record_done %V recorder=%V path='%V'", + &ec->cmd, &v->recorder, &v->path); ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_enotify_module); if (ctx == NULL) { @@ -474,14 +465,6 @@ ngx_rtmp_enotify_record_done(ngx_rtmp_session_t *s, ngx_rtmp_record_done_t *v) ctx->recorder = v->recorder; ctx->path = v->path; - ctx->filename = v->path; - - for (n = ctx->filename.len; - n > 0 && !ngx_path_separator(ctx->filename.data[n - 1]); - --n); - - ctx->filename.data += n; - ctx->filename.len -= n; ngx_rtmp_enotify_exec(s, ec); diff --git a/ngx_rtmp_notify_module.c b/ngx_rtmp_notify_module.c index 71ca05e..2022fb3 100644 --- a/ngx_rtmp_notify_module.c +++ b/ngx_rtmp_notify_module.c @@ -615,9 +615,9 @@ ngx_rtmp_notify_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v) goto next; } - ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, - "notify: publish '%V'", - &nacf->url[NGX_RTMP_NOTIFY_PUBLISH]); + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, + "notify: publish '%V'", + &nacf->url[NGX_RTMP_NOTIFY_PUBLISH]); ngx_memzero(&ci, sizeof(ci)); @@ -656,9 +656,9 @@ ngx_rtmp_notify_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v) goto next; } - ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, - "notify: play '%V'", - &nacf->url[NGX_RTMP_NOTIFY_PLAY]); + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, + "notify: play '%V'", + &nacf->url[NGX_RTMP_NOTIFY_PLAY]); ngx_memzero(&ci, sizeof(ci)); @@ -738,10 +738,10 @@ ngx_rtmp_notify_record_done(ngx_rtmp_session_t *s, ngx_rtmp_record_done_t *v) goto next; } - ngx_log_debug3(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, - "notify: record_done recorder=%V path='%V' url='%V'", - &v->recorder, &v->path, - &nacf->url[NGX_RTMP_NOTIFY_RECORD_DONE]); + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, + "notify: record_done recorder=%V path='%V' url='%V'", + &v->recorder, &v->path, + &nacf->url[NGX_RTMP_NOTIFY_RECORD_DONE]); ngx_memzero(&ci, sizeof(ci)); @@ -762,8 +762,8 @@ ngx_rtmp_notify_done(ngx_rtmp_session_t *s, char *cbname, ngx_url_t *url) ngx_rtmp_netcall_init_t ci; ngx_rtmp_notify_done_t ds; - ngx_log_debug2(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, - "notify: %s '%V'", cbname, &url->url); + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, + "notify: %s '%V'", cbname, &url->url); ds.cbname = (u_char *) cbname; ds.url = url; diff --git a/ngx_rtmp_play_module.c b/ngx_rtmp_play_module.c index 960b19d..5c0315a 100644 --- a/ngx_rtmp_play_module.c +++ b/ngx_rtmp_play_module.c @@ -440,8 +440,8 @@ ngx_rtmp_play_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v) goto next; } - ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, - "play: fmt found: '%V'", &ctx->fmt->name); + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, + "play: %V", &ctx->fmt->name); sfx = &ctx->fmt->sfx; diff --git a/ngx_rtmp_relay_module.c b/ngx_rtmp_relay_module.c index fc008be..a6b50fc 100644 --- a/ngx_rtmp_relay_module.c +++ b/ngx_rtmp_relay_module.c @@ -503,7 +503,7 @@ ngx_int_t ngx_rtmp_relay_pull(ngx_rtmp_session_t *s, ngx_str_t *name, ngx_rtmp_relay_target_t *target) { - ngx_log_debug4(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, "relay: create pull name='%V' app='%V' playpath='%V' url='%V'", name, &target->app, &target->play_path, &target->url.url); @@ -517,7 +517,7 @@ ngx_int_t ngx_rtmp_relay_push(ngx_rtmp_session_t *s, ngx_str_t *name, ngx_rtmp_relay_target_t *target) { - ngx_log_debug4(NGX_LOG_DEBUG_RTMP, s->connection->log, 0, + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, "relay: create push name='%V' app='%V' playpath='%V' url='%V'", name, &target->app, &target->play_path, &target->url.url);