Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: fix the enforced (hardcoded) payload types in RTP mode for ST41 and ST40 #995

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/src/app_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ struct st_app_tx_anc_session {
pcap_t* st40_pcap;
bool st40_pcap_input;
bool st40_rtp_input;
uint8_t st40_payload_type;
uint8_t* st40_source_begin;
uint8_t* st40_source_end;
uint8_t* st40_frame_cursor; /* cursor to current frame */
Expand Down Expand Up @@ -248,9 +249,10 @@ struct st_app_tx_fmd_session {
int st41_source_fd;
pcap_t* st41_pcap;
bool st41_pcap_input;
bool st41_rtp_input;
uint8_t st41_payload_type;
uint32_t st41_dit;
uint32_t st41_k_bit;
bool st41_rtp_input;
uint8_t* st41_source_begin;
uint8_t* st41_source_end;
uint8_t* st41_frame_cursor; /* cursor to current frame */
Expand Down
3 changes: 2 additions & 1 deletion app/src/tx_ancillary_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static void app_tx_anc_build_rtp(struct st_app_tx_anc_session* s, void* usrptr,
uint16_t check_sum, total_size, payload_len;
hdr->base.marker = 1;
hdr->anc_count = 1;
hdr->base.payload_type = ST_APP_PAYLOAD_TYPE_ANCILLARY;
hdr->base.payload_type = s->st40_payload_type;
hdr->base.version = 2;
hdr->base.extension = 0;
hdr->base.padding = 0;
Expand Down Expand Up @@ -461,6 +461,7 @@ static int app_tx_anc_init(struct st_app_context* ctx, st_json_ancillary_session
ops.type = anc ? anc->info.type : ST40_TYPE_FRAME_LEVEL;
ops.interlaced = anc ? anc->info.interlaced : false;
ops.payload_type = anc ? anc->base.payload_type : ST_APP_PAYLOAD_TYPE_ANCILLARY;
s->st40_payload_type = ops.payload_type;
/* select rtp type for pcap file or tx_video_rtp_ring_size */
if (strstr(s->st40_source_url, ".pcap")) {
ops.type = ST40_TYPE_RTP_LEVEL;
Expand Down
3 changes: 2 additions & 1 deletion app/src/tx_fastmetadata_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ static void app_tx_fmd_build_rtp(struct st_app_tx_fmd_session* s, void* usrptr,
data_item_length =
(data_item_length_bytes + 3) / 4; /* expressed in number of 4-byte words */
hdr->base.marker = 1;
hdr->base.payload_type = ST_APP_PAYLOAD_TYPE_FASTMETADATA;
hdr->base.payload_type = s->st41_payload_type;
hdr->base.version = 2;
hdr->base.extension = 0;
hdr->base.padding = 0;
Expand Down Expand Up @@ -482,6 +482,7 @@ static int app_tx_fmd_init(struct st_app_context* ctx,
/* copying frame fields for RTP mode to function*/
s->st41_dit = ops.fmd_dit;
s->st41_k_bit = ops.fmd_k_bit;
s->st41_payload_type = ops.payload_type;

s->handle = handle;
snprintf(s->st41_source_url, sizeof(s->st41_source_url), "%s",
Expand Down