mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-20 01:51:07 +02:00
Merge pull request #19 from sergey-dryabzhinsky/fmle-onfi-command
Add onFi data command for live stream.
This commit is contained in:
commit
889e6afccb
|
@ -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]));
|
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
|
static ngx_int_t
|
||||||
ngx_rtmp_live_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v)
|
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");
|
ngx_str_set(&ch->name, "onCuePoint");
|
||||||
ch->handler = ngx_rtmp_live_on_cue_point;
|
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;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue