Merge pull request #19 from sergey-dryabzhinsky/fmle-onfi-command

Add onFi data command for live stream.
This commit is contained in:
Sergey 2015-07-03 02:15:55 +03:00
commit 889e6afccb

View file

@ -1179,6 +1179,21 @@ ngx_rtmp_live_on_text_data(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
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)
{
static ngx_rtmp_amf_elt_t out_elts[] = {
{ NGX_RTMP_AMF_STRING,
ngx_null_string,
"onFi", 0 }
};
return ngx_rtmp_live_data(s, h, in, out_elts,
sizeof(out_elts) / sizeof(out_elts[0]));
}
static ngx_int_t
ngx_rtmp_live_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v)
@ -1301,5 +1316,9 @@ ngx_rtmp_live_postconfiguration(ngx_conf_t *cf)
ngx_str_set(&ch->name, "onCuePoint");
ch->handler = ngx_rtmp_live_on_cue_point;
ch = ngx_array_push(&cmcf->amf);
ngx_str_set(&ch->name, "onFi");
ch->handler = ngx_rtmp_live_on_fi;
return NGX_OK;
}