Skip to content
Open
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
6 changes: 4 additions & 2 deletions config/redundant_rx_1v_1a_1anc.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@
"audio_ptime": "1"
}
],
"ancillary": [
"st40p": [
{
"replicas": 1,
"start_port": 40000,
"payload_type": 113,
"start_port": 40000
"fps": "p59",
"st40p_url": ""
}
]
}
Expand Down
6 changes: 4 additions & 2 deletions config/redundant_rx_2v_1a_1anc.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@
"audio_ptime": "1"
}
],
"ancillary": [
"st40p": [
{
"replicas": 1,
"start_port": 40000,
"payload_type": 113,
"start_port": 40000
"fps": "p59",
"st40p_url": ""
}
]
},
Expand Down
8 changes: 3 additions & 5 deletions config/redundant_tx_1v_1a_1anc.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@
"audio_url": "./test.pcm"
}
],
"ancillary": [
"st40p": [
{
"replicas": 1,
"start_port": 40000,
"payload_type": 113,
"type": "frame",
"ancillary_format": "closed_caption",
"ancillary_url": "./test.txt",
"ancillary_fps": "p59"
"fps": "p59",
"st40p_url": "./test.txt"
}
]
}
Expand Down
8 changes: 3 additions & 5 deletions config/redundant_tx_2v_1a_1anc.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@
"audio_url": "./test.pcm"
}
],
"ancillary": [
"st40p": [
{
"replicas": 1,
"start_port": 40000,
"payload_type": 113,
"type": "frame",
"ancillary_format": "closed_caption",
"ancillary_url": "./test.txt",
"ancillary_fps": "p59"
"fps": "p59",
"st40p_url": "./test.txt"
}
]
},
Expand Down
6 changes: 4 additions & 2 deletions config/rx_1v_1a_1anc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@
"audio_ptime": "1"
}
],
"ancillary": [
"st40p": [
{
"replicas": 1,
"start_port": 40000,
"payload_type": 113,
"start_port": 40000
"fps": "p59",
"st40p_url": ""
}
]
}
Expand Down
6 changes: 4 additions & 2 deletions config/rx_2v2dest_1a_1anc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@
"audio_ptime": "1"
}
],
"ancillary": [
"st40p": [
{
"replicas": 1,
"start_port": 40000,
"payload_type": 113,
"start_port": 40000
"fps": "p59",
"st40p_url": ""
}
]
},
Expand Down
8 changes: 3 additions & 5 deletions config/tx_1v_1a_1anc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@
"audio_url": "./test.pcm"
}
],
"ancillary": [
"st40p": [
{
"replicas": 1,
"start_port": 40000,
"payload_type": 113,
"type": "frame",
"ancillary_format": "closed_caption",
"ancillary_url": "./test.txt",
"ancillary_fps": "p59"
"fps": "p59",
"st40p_url": "./test.txt"
}
]
}
Expand Down
8 changes: 3 additions & 5 deletions config/tx_2v2dest_1a_1anc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@
"audio_url": "./test.pcm"
}
],
"ancillary": [
"st40p": [
{
"replicas": 1,
"start_port": 40000,
"payload_type": 113,
"type": "frame",
"ancillary_format": "closed_caption",
"ancillary_url": "./test.txt",
"ancillary_fps": "p59"
"fps": "p59",
"st40p_url": "./test.txt"
}
]
},
Expand Down
3 changes: 3 additions & 0 deletions tests/tools/RxTxApp/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ endif
# simd build option, enable sse4.2 default, todo: do we need AVX2/AVX512 for app ?
app_c_args += ['-msse4.2']

# Keep column tracking enabled on large translation units to avoid misleading-indentation noise.
app_c_args += ['-flarge-source-files']

if is_windows
ws2_32_dep = cc.find_library('ws2_32', required: true)
mman_dep = cc.find_library('mman', required: true)
Expand Down
42 changes: 42 additions & 0 deletions tests/tools/RxTxApp/src/app_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <mtl/st30_api.h>
#include <mtl/st30_pipeline_api.h>
#include <mtl/st40_api.h>
#include <mtl/st40_pipeline_api.h>
#include <mtl/st41_api.h>
#include <mtl/st_pipeline_api.h>
#include <pcap.h>
Expand Down Expand Up @@ -209,11 +210,18 @@ struct st_app_tx_audio_session {
};

struct st_app_tx_anc_session {
struct st_app_context* ctx;

int idx;
st40_tx_handle handle;

uint16_t framebuff_cnt;

uint64_t frame_num;
double frame_time;
uint64_t local_tai_base_time;
struct st_user_time* user_time;

uint16_t framebuff_producer_idx;
uint16_t framebuff_consumer_idx;
struct st_tx_frame* framebuffs;
Expand Down Expand Up @@ -480,6 +488,36 @@ struct st_app_tx_st22p_session {
bool st22p_app_thread_stop;
};

struct st_app_tx_st40p_session {
struct st_app_context* ctx;

int idx;
st40p_tx_handle handle;
mtl_handle st;
int framebuff_cnt;

st_json_st40p_session_t* st40p;

char st40p_source_url[ST_APP_URL_MAX_LEN];
uint8_t* st40p_source_begin;
uint8_t* st40p_source_end;
uint8_t* st40p_frame_cursor;

double expect_fps;
double frame_time;
uint64_t frame_num;
uint64_t local_tai_base_time;
struct st_user_time* user_time;

size_t udw_payload_limit;

pthread_t st40p_app_thread;
bool st40p_app_thread_stop;

int fb_send;
int fb_send_done;
};

struct st_app_rx_st22p_session {
int idx;
mtl_handle st;
Expand Down Expand Up @@ -704,6 +742,10 @@ struct st_app_context {
struct st_app_tx_st22p_session* tx_st22p_sessions;
int tx_st22p_session_cnt;

char tx_st40p_url[ST_APP_URL_MAX_LEN];
struct st_app_tx_st40p_session* tx_st40p_sessions;
int tx_st40p_session_cnt;

char tx_st20p_url[ST_APP_URL_MAX_LEN]; /* send st20p content url*/
struct st_app_tx_st20p_session* tx_st20p_sessions;
int tx_st20p_session_cnt;
Expand Down
11 changes: 11 additions & 0 deletions tests/tools/RxTxApp/src/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ enum st_args_cmd {
ST_ARG_TX_FMD_URL,
ST_ARG_TX_FMD_SESSIONS_CNT,
ST_ARG_TX_FMD_RTP_RING_SIZE,
ST_ARG_TX_ST40P_URL,
ST_ARG_TX_ST40P_SESSIONS_CNT,
ST22_ARG_TX_SESSIONS_CNT,
ST22_ARG_TX_URL,
ST_ARG_RX_VIDEO_SESSIONS_CNT,
Expand Down Expand Up @@ -192,6 +194,8 @@ static struct option st_app_args_options[] = {
{"tx_fmd_url", required_argument, 0, ST_ARG_TX_FMD_URL},
{"tx_fmd_sessions_count", required_argument, 0, ST_ARG_TX_FMD_SESSIONS_CNT},
{"tx_fmd_rtp_ring_size", required_argument, 0, ST_ARG_TX_FMD_RTP_RING_SIZE},
{"tx_st40p_url", required_argument, 0, ST_ARG_TX_ST40P_URL},
{"tx_st40p_sessions_count", required_argument, 0, ST_ARG_TX_ST40P_SESSIONS_CNT},
{"tx_st22_sessions_count", required_argument, 0, ST22_ARG_TX_SESSIONS_CNT},
{"tx_st22_url", required_argument, 0, ST22_ARG_TX_URL},

Expand Down Expand Up @@ -366,6 +370,7 @@ static int app_args_json(struct st_app_context* ctx, struct mtl_init_params* p,
ctx->tx_anc_session_cnt = ctx->json_ctx->tx_anc_session_cnt;
ctx->tx_fmd_session_cnt = ctx->json_ctx->tx_fmd_session_cnt;
ctx->tx_st22p_session_cnt = ctx->json_ctx->tx_st22p_session_cnt;
ctx->tx_st40p_session_cnt = ctx->json_ctx->tx_st40p_session_cnt;
ctx->tx_st20p_session_cnt = ctx->json_ctx->tx_st20p_session_cnt;
ctx->tx_st30p_session_cnt = ctx->json_ctx->tx_st30p_session_cnt;
ctx->rx_video_session_cnt = ctx->json_ctx->rx_video_session_cnt;
Expand Down Expand Up @@ -519,6 +524,12 @@ int st_app_parse_args(struct st_app_context* ctx, struct mtl_init_params* p, int
case ST_ARG_TX_AUDIO_RTP_RING_SIZE:
ctx->tx_audio_rtp_ring_size = atoi(optarg);
break;
case ST_ARG_TX_ST40P_URL:
snprintf(ctx->tx_st40p_url, sizeof(ctx->tx_st40p_url), "%s", optarg);
break;
case ST_ARG_TX_ST40P_SESSIONS_CNT:
ctx->tx_st40p_session_cnt = atoi(optarg);
break;
case ST_ARG_TX_ANC_URL:
snprintf(ctx->tx_anc_url, sizeof(ctx->tx_anc_url), "%s", optarg);
break;
Expand Down
9 changes: 5 additions & 4 deletions tests/tools/RxTxApp/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

sources = files('rxtx_app.c', 'args.c', 'parse_json.c', 'fmt.c',
'tx_st20p_app.c', 'rx_st20p_app.c',
'tx_st22p_app.c', 'rx_st22p_app.c',
'tx_ancillary_app.c', 'rx_ancillary_app.c',
'tx_fastmetadata_app.c', 'rx_fastmetadata_app.c',
'tx_st30p_app.c', 'rx_st30p_app.c',
'tx_st22p_app.c', 'rx_st22p_app.c',
'tx_ancillary_app.c', 'rx_ancillary_app.c',
'tx_fastmetadata_app.c', 'rx_fastmetadata_app.c',
'tx_st40p_app.c',
'tx_st30p_app.c', 'rx_st30p_app.c',
)

if app_has_sdl2
Expand Down
Loading
Loading