mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-19 01:31:09 +02:00
fixed metadata output
This commit is contained in:
parent
bf487dba0b
commit
792f5aedc7
|
@ -272,6 +272,10 @@ ngx_rtmp_codec_update_meta(ngx_rtmp_session_t *s)
|
|||
|
||||
static ngx_rtmp_amf_elt_t out_inf[] = {
|
||||
|
||||
{ NGX_RTMP_AMF_STRING,
|
||||
ngx_string("Server"),
|
||||
"NGINX RTMP (www.github.com/arut/nginx-rtmp-module)", 0 },
|
||||
|
||||
{ NGX_RTMP_AMF_NUMBER,
|
||||
ngx_string("width"),
|
||||
&v.width, 0 },
|
||||
|
@ -280,6 +284,14 @@ ngx_rtmp_codec_update_meta(ngx_rtmp_session_t *s)
|
|||
ngx_string("height"),
|
||||
&v.height, 0 },
|
||||
|
||||
{ NGX_RTMP_AMF_NUMBER,
|
||||
ngx_string("displayWidth"),
|
||||
&v.width, 0 },
|
||||
|
||||
{ NGX_RTMP_AMF_NUMBER,
|
||||
ngx_string("displayHeight"),
|
||||
&v.height, 0 },
|
||||
|
||||
{ NGX_RTMP_AMF_NUMBER,
|
||||
ngx_string("duration"),
|
||||
&v.duration, 0 },
|
||||
|
@ -323,10 +335,6 @@ ngx_rtmp_codec_update_meta(ngx_rtmp_session_t *s)
|
|||
ngx_null_string,
|
||||
"onMetaData", 0 },
|
||||
|
||||
{ NGX_RTMP_AMF_STRING,
|
||||
ngx_null_string,
|
||||
NULL, 0 },
|
||||
|
||||
{ NGX_RTMP_AMF_OBJECT,
|
||||
ngx_null_string,
|
||||
out_inf, sizeof(out_inf) },
|
||||
|
|
|
@ -637,6 +637,21 @@ ngx_rtmp_record_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
|||
if (codec_ctx) {
|
||||
ch = *h;
|
||||
|
||||
#if 0
|
||||
/* metadata */
|
||||
if (codec_ctx->meta) {
|
||||
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
|
||||
"record: writing metadata");
|
||||
ch.type = NGX_RTMP_MSG_AMF_META;
|
||||
ch.mlen = ngx_rtmp_record_get_chain_mlen(codec_ctx->meta);
|
||||
if (ngx_rtmp_record_write_frame(s, &ch, codec_ctx->meta)
|
||||
!= NGX_OK)
|
||||
{
|
||||
return NGX_OK;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* AAC header */
|
||||
if (codec_ctx->aac_header && (racf->flags & NGX_RTMP_RECORD_AUDIO))
|
||||
{
|
||||
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
|
||||
|
@ -650,6 +665,7 @@ ngx_rtmp_record_av(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h,
|
|||
}
|
||||
}
|
||||
|
||||
/* AVC header */
|
||||
if (codec_ctx->avc_header && (racf->flags
|
||||
& (NGX_RTMP_RECORD_VIDEO|NGX_RTMP_RECORD_KEYFRAMES)))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue