Skip to content

Commit

Permalink
LIV-564: Add program number to API.
Browse files Browse the repository at this point in the history
  • Loading branch information
shamamayair committed Mar 6, 2024
1 parent 909ea7d commit ba69493
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions nginx-kmp-out-module/src/ngx_kmp_out_track_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct ngx_kmp_out_track_s {
size_t mem_limit;
size_t mem_high_watermark;
size_t mem_low_watermark;
uint32_t prog_num;
ngx_http_call_ctx_t *publish_call;

kmp_connect_packet_t connect;
Expand Down
3 changes: 3 additions & 0 deletions nginx-kmp-out-module/src/ngx_kmp_out_track_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ ngx_kmp_out_track_fields_json_get_size(ngx_kmp_out_track_t *obj)
ngx_json_str_get_size(&obj->track_id) +
sizeof("\",\"mem_left\":") - 1 + NGX_SIZE_T_LEN +
sizeof(",\"mem_limit\":") - 1 + NGX_SIZE_T_LEN +
sizeof(",\"prog_num\":") - 1 + NGX_INT32_LEN +
sizeof(",\"last_timestamp\":") - 1 + NGX_INT64_LEN +
sizeof(",\"last_created\":") - 1 + NGX_INT64_LEN +
sizeof(",\"sent_frames\":") - 1 + NGX_INT_T_LEN +
Expand Down Expand Up @@ -403,6 +404,8 @@ ngx_kmp_out_track_fields_json_write(u_char *p, ngx_kmp_out_track_t *obj)
p = ngx_sprintf(p, "%uz", (size_t) obj->mem_left);
p = ngx_copy_fix(p, ",\"mem_limit\":");
p = ngx_sprintf(p, "%uz", (size_t) obj->mem_limit);
p = ngx_copy_fix(p, ",\"prog_num\":");
p = ngx_sprintf(p, "%uD", (uint32_t) obj->prog_num);
p = ngx_copy_fix(p, ",\"last_timestamp\":");
p = ngx_sprintf(p, "%L", (int64_t) obj->stats.last_timestamp);
p = ngx_copy_fix(p, ",\"last_created\":");
Expand Down
1 change: 1 addition & 0 deletions nginx-kmp-out-module/src/ngx_kmp_out_track_json.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ out noobject ngx_kmp_out_track_fields_json ngx_kmp_out_track_t
track_id %jV
mem_left %uz
mem_limit %uz
prog_num %uD

last_timestamp %L obj->stats.
last_created %L obj->stats.
Expand Down
1 change: 1 addition & 0 deletions nginx-mpegts-kmp-module/src/ngx_ts_kmp_track.c
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,7 @@ ngx_ts_kmp_track_create(ngx_ts_handler_data_t *hd)

track->ctx = ctx;
track->handler = ngx_ts_kmp_track_error;
track->prog_num = prog->number;

track->log.connection = ctx->connection->number;
ctx->track_index[media_type]++;
Expand Down

0 comments on commit ba69493

Please sign in to comment.