From efea759087ecac1a3fe56fdd72f4d9f1c9c2da4c Mon Sep 17 00:00:00 2001 From: Executor Date: Mon, 16 Dec 2024 10:15:21 +0800 Subject: [PATCH] rename config keys to server_name, encoder_name and pass_args --- ngx_rtmp_codec_module.c | 22 +++++++++++----------- ngx_rtmp_relay_module.c | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ngx_rtmp_codec_module.c b/ngx_rtmp_codec_module.c index baeee3b..7ace65c 100644 --- a/ngx_rtmp_codec_module.c +++ b/ngx_rtmp_codec_module.c @@ -40,8 +40,8 @@ static void ngx_rtmp_codec_dump_header(ngx_rtmp_session_t *s, const char *type, typedef struct { ngx_uint_t meta; - ngx_str_t serverName; - ngx_str_t encoderName; + ngx_str_t server_name; + ngx_str_t encoder_name; } ngx_rtmp_codec_app_conf_t; @@ -62,18 +62,18 @@ static ngx_command_t ngx_rtmp_codec_commands[] = { offsetof(ngx_rtmp_codec_app_conf_t, meta), &ngx_rtmp_codec_meta_slots }, - { ngx_string("serverName"), + { ngx_string("server_name"), NGX_RTMP_MAIN_CONF | NGX_RTMP_SRV_CONF | NGX_RTMP_APP_CONF | NGX_CONF_TAKE1, ngx_conf_set_str_slot, NGX_RTMP_APP_CONF_OFFSET, - offsetof(ngx_rtmp_codec_app_conf_t, serverName), + offsetof(ngx_rtmp_codec_app_conf_t, server_name), NULL }, - { ngx_string("encoderName"), + { ngx_string("encoder_name"), NGX_RTMP_MAIN_CONF | NGX_RTMP_SRV_CONF | NGX_RTMP_APP_CONF | NGX_CONF_TAKE1, ngx_conf_set_str_slot, NGX_RTMP_APP_CONF_OFFSET, - offsetof(ngx_rtmp_codec_app_conf_t, encoderName), + offsetof(ngx_rtmp_codec_app_conf_t, encoder_name), NULL }, ngx_null_command @@ -727,11 +727,11 @@ ngx_rtmp_codec_reconstruct_meta(ngx_rtmp_session_t *s) ctx->meta = NULL; } - if (cacf->serverName.len) { - out_inf[0].data = cacf->serverName.data; + if (cacf->server_name.len) { + out_inf[0].data = cacf->server_name.data; } - if (cacf->encoderName.len) { - out_inf[14].data = cacf->encoderName.data; + if (cacf->encoder_name.len) { + out_inf[14].data = cacf->encoder_name.data; out_elts[1].len++; } @@ -1007,7 +1007,7 @@ ngx_rtmp_codec_merge_app_conf(ngx_conf_t *cf, void *parent, void *child) ngx_rtmp_codec_app_conf_t *conf = child; ngx_conf_merge_uint_value(conf->meta, prev->meta, NGX_RTMP_CODEC_META_ON); - ngx_conf_merge_str_value(conf->serverName, prev->serverName, NGX_RTMP_CODEC_META_SERVER_NAME); + ngx_conf_merge_str_value(conf->server_name, prev->server_name, NGX_RTMP_CODEC_META_SERVER_NAME); return NGX_CONF_OK; } diff --git a/ngx_rtmp_relay_module.c b/ngx_rtmp_relay_module.c index dcbc2b6..12a06a1 100644 --- a/ngx_rtmp_relay_module.c +++ b/ngx_rtmp_relay_module.c @@ -1794,7 +1794,7 @@ ngx_rtmp_relay_push_pull(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) NGX_RTMP_RELAY_NUM_PAR("live", live); NGX_RTMP_RELAY_NUM_PAR("start", start); NGX_RTMP_RELAY_NUM_PAR("stop", stop); - NGX_RTMP_RELAY_NUM_PAR("passArgs", pass_args); + NGX_RTMP_RELAY_NUM_PAR("pass_args", pass_args); #undef NGX_RTMP_RELAY_STR_PAR