- add more debug output for 'play' handler to view all chained calls
- fix gcc compilation fail or live module with ```-Werror``` option
  - wrap var definition with debug enabled check
This commit is contained in:
Sergey Dryabzhinsky 2015-11-30 13:02:57 +03:00
parent c80342e0ab
commit 4c7dd6ed00
8 changed files with 81 additions and 2 deletions

View file

@ -449,10 +449,17 @@ next:
static ngx_int_t
ngx_rtmp_access_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
{
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"access: ngx_rtmp_access_play");
if (ngx_rtmp_access(s, NGX_RTMP_ACCESS_PLAY) != NGX_OK) {
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"access: ngx_rtmp_access_play: error");
return NGX_ERROR;
}
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"access: ngx_rtmp_access_play: next");
return next_play(s, v);
}

View file

@ -574,6 +574,8 @@ ngx_rtmp_cmd_play_init(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
static ngx_int_t
ngx_rtmp_cmd_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
{
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"cmd: ngx_rtmp_cmd_play");
return NGX_OK;
}

View file

@ -1194,6 +1194,9 @@ next:
static ngx_int_t
ngx_rtmp_exec_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
{
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"exec: ngx_rtmp_exec_play");
ngx_rtmp_exec_ctx_t *ctx;
ngx_rtmp_exec_pull_ctx_t *pctx;
ngx_rtmp_exec_app_conf_t *eacf;
@ -1224,6 +1227,8 @@ ngx_rtmp_exec_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
}
next:
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"exec: ngx_rtmp_exec_play: next");
return next_play(s, v);
}

View file

@ -1056,9 +1056,11 @@ ngx_rtmp_live_data(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
uint32_t delta;
ngx_rtmp_live_chunk_stream_t *cs;
#ifdef NGX_DEBUG
u_char *msg_type;
msg_type = (u_char *)out_elts[0].data;
#endif
lacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_live_module);
if (lacf == NULL) {
@ -1099,6 +1101,8 @@ ngx_rtmp_live_data(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
data = NULL;
rc = ngx_rtmp_append_amf(s, &data, NULL, out_elts, out_elts_size);
if (rc != NGX_OK) {
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"live: data - can't append amf!");
if (data) {
ngx_rtmp_free_shared_chain(cscf, data);
}
@ -1148,7 +1152,7 @@ ngx_rtmp_live_data(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
return NGX_OK;
}
/*
static ngx_int_t
ngx_rtmp_live_on_cue_point(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
ngx_chain_t *in)
@ -1178,7 +1182,7 @@ ngx_rtmp_live_on_text_data(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
return ngx_rtmp_live_data(s, h, in, out_elts,
sizeof(out_elts) / sizeof(out_elts[0]));
}
*/
static ngx_int_t
ngx_rtmp_live_on_fi(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
ngx_chain_t *in)
@ -1426,6 +1430,9 @@ next:
static ngx_int_t
ngx_rtmp_live_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
{
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"live: ngx_rtmp_live_play");
ngx_rtmp_live_app_conf_t *lacf;
ngx_rtmp_live_ctx_t *ctx;
@ -1458,6 +1465,8 @@ ngx_rtmp_live_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
}
next:
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"live: ngx_rtmp_live_play: next");
return next_play(s, v);
}

View file

@ -853,6 +853,9 @@ next:
static ngx_int_t
ngx_rtmp_log_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
{
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"log: ngx_rtmp_log_play");
ngx_rtmp_log_ctx_t *ctx;
if (s->auto_pushed || s->relay) {
@ -867,6 +870,8 @@ ngx_rtmp_log_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
ctx->play = 1;
next:
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"log: ngx_rtmp_log_play: next");
return next_play(s, v);
}

View file

@ -1300,6 +1300,9 @@ static ngx_int_t
ngx_rtmp_notify_play_handle(ngx_rtmp_session_t *s,
void *arg, ngx_chain_t *in)
{
ngx_log_debug(NGX_LOG_DEBUG, s->connection->log, 0,
"notify: ngx_rtmp_notify_play_handle");
ngx_rtmp_play_t *v = arg;
ngx_int_t rc, send;
ngx_str_t local_name;
@ -1393,6 +1396,8 @@ ngx_rtmp_notify_play_handle(ngx_rtmp_session_t *s,
ngx_rtmp_relay_pull(s, &local_name, &target);
next:
ngx_log_debug(NGX_LOG_DEBUG, s->connection->log, 0,
"notify: ngx_rtmp_notify_play_handle: next");
return next_play(s, v);
}
@ -1636,6 +1641,9 @@ next:
static ngx_int_t
ngx_rtmp_notify_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
{
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"notify: ngx_rtmp_notify_play");
ngx_rtmp_notify_app_conf_t *nacf;
ngx_rtmp_netcall_init_t ci;
ngx_url_t *url;
@ -1671,6 +1679,9 @@ ngx_rtmp_notify_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
return ngx_rtmp_netcall_create(s, &ci);
next:
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"notify: ngx_rtmp_notify_play: next");
return next_play(s, v);
}

View file

@ -716,6 +716,9 @@ ngx_rtmp_play_parse_index(char type, u_char *args)
static ngx_int_t
ngx_rtmp_play_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
{
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"play: ngx_rtmp_play_play");
ngx_rtmp_play_main_conf_t *pmcf;
ngx_rtmp_play_app_conf_t *pacf;
ngx_rtmp_play_ctx_t *ctx;
@ -827,9 +830,15 @@ ngx_rtmp_play_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
"play: fmt=%V", &ctx->fmt->name);
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"play: ngx_rtmp_play_play: next_entry");
return ngx_rtmp_play_next_entry(s, v);
next:
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"play: ngx_rtmp_play_play: next");
return next_play(s, v);
}
@ -837,6 +846,9 @@ next:
static ngx_int_t
ngx_rtmp_play_next_entry(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
{
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"play: ngx_rtmp_play_next_entry");
ngx_rtmp_play_app_conf_t *pacf;
ngx_rtmp_play_ctx_t *ctx;
ngx_rtmp_play_entry_t *pe;
@ -881,6 +893,9 @@ ngx_rtmp_play_next_entry(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
/* open remote */
if (pe->url) {
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"play: ngx_rtmp_play_next_entry: open remote");
return ngx_rtmp_play_open_remote(s, v);
}
@ -917,12 +932,19 @@ ngx_rtmp_play_next_entry(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
"play: open local file '%s'", path);
if (ngx_rtmp_play_open(s, v->start) != NGX_OK) {
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"play: ngx_rtmp_play_next_entry: error open");
return NGX_ERROR;
}
break;
}
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"play: ngx_rtmp_play_next_entry: next");
return next_play(s, v);
}
@ -1048,6 +1070,9 @@ ngx_rtmp_play_remote_create(ngx_rtmp_session_t *s, void *arg, ngx_pool_t *pool)
static ngx_int_t
ngx_rtmp_play_remote_handle(ngx_rtmp_session_t *s, void *arg, ngx_chain_t *in)
{
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"play: ngx_rtmp_play_remote_handle");
ngx_rtmp_play_t *v = arg;
ngx_rtmp_play_ctx_t *ctx;
@ -1055,6 +1080,8 @@ ngx_rtmp_play_remote_handle(ngx_rtmp_session_t *s, void *arg, ngx_chain_t *in)
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_play_module);
if (ctx->nbody == 0) {
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"play: ngx_rtmp_play_remote_handle: next_entry");
return ngx_rtmp_play_next_entry(s, v);
}
@ -1066,9 +1093,16 @@ ngx_rtmp_play_remote_handle(ngx_rtmp_session_t *s, void *arg, ngx_chain_t *in)
"play: open remote file");
if (ngx_rtmp_play_open(s, v->start) != NGX_OK) {
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"play: ngx_rtmp_play_remote_handle: error open");
return NGX_ERROR;
}
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"play: ngx_rtmp_play_remote_handle: next");
return next_play(s, (ngx_rtmp_play_t *)arg);
}

View file

@ -710,6 +710,9 @@ next:
static ngx_int_t
ngx_rtmp_relay_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
{
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"relay: ngx_rtmp_relay_play");
ngx_rtmp_relay_app_conf_t *racf;
ngx_rtmp_relay_target_t *target, **t;
ngx_str_t name;
@ -751,6 +754,9 @@ ngx_rtmp_relay_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
}
next:
ngx_log_error(NGX_LOG_DEBUG, s->connection->log, 0,
"relay: ngx_rtmp_relay_play: next");
return next_play(s, v);
}