Skip to content

Commit 888e1c6

Browse files
committed
Add: St40p support in RxTxApp
Change configs in config/ for them to use pipeline mode Signed-off-by: Kasiewicz, Marek <[email protected]>
1 parent dff81a4 commit 888e1c6

17 files changed

+620
-34
lines changed

config/redundant_rx_1v_1a_1anc.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@
4545
"audio_ptime": "1"
4646
}
4747
],
48-
"ancillary": [
48+
"st40p": [
4949
{
5050
"replicas": 1,
51+
"start_port": 40000,
5152
"payload_type": 113,
52-
"start_port": 40000
53+
"fps": "p59",
54+
"st40p_url": ""
5355
}
5456
]
5557
}

config/redundant_rx_2v_1a_1anc.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@
4545
"audio_ptime": "1"
4646
}
4747
],
48-
"ancillary": [
48+
"st40p": [
4949
{
5050
"replicas": 1,
51+
"start_port": 40000,
5152
"payload_type": 113,
52-
"start_port": 40000
53+
"fps": "p59",
54+
"st40p_url": ""
5355
}
5456
]
5557
},

config/redundant_tx_1v_1a_1anc.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,13 @@
4747
"audio_url": "./test.pcm"
4848
}
4949
],
50-
"ancillary": [
50+
"st40p": [
5151
{
5252
"replicas": 1,
5353
"start_port": 40000,
5454
"payload_type": 113,
55-
"type": "frame",
56-
"ancillary_format": "closed_caption",
57-
"ancillary_url": "./test.txt",
58-
"ancillary_fps": "p59"
55+
"fps": "p59",
56+
"st40p_url": "./test.txt"
5957
}
6058
]
6159
}

config/redundant_tx_2v_1a_1anc.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,13 @@
4747
"audio_url": "./test.pcm"
4848
}
4949
],
50-
"ancillary": [
50+
"st40p": [
5151
{
5252
"replicas": 1,
5353
"start_port": 40000,
5454
"payload_type": 113,
55-
"type": "frame",
56-
"ancillary_format": "closed_caption",
57-
"ancillary_url": "./test.txt",
58-
"ancillary_fps": "p59"
55+
"fps": "p59",
56+
"st40p_url": "./test.txt"
5957
}
6058
]
6159
},

config/rx_1v_1a_1anc.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@
3939
"audio_ptime": "1"
4040
}
4141
],
42-
"ancillary": [
42+
"st40p": [
4343
{
4444
"replicas": 1,
45+
"start_port": 40000,
4546
"payload_type": 113,
46-
"start_port": 40000
47+
"fps": "p59",
48+
"st40p_url": ""
4749
}
4850
]
4951
}

config/rx_2v2dest_1a_1anc.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@
3939
"audio_ptime": "1"
4040
}
4141
],
42-
"ancillary": [
42+
"st40p": [
4343
{
4444
"replicas": 1,
45+
"start_port": 40000,
4546
"payload_type": 113,
46-
"start_port": 40000
47+
"fps": "p59",
48+
"st40p_url": ""
4749
}
4850
]
4951
},

config/tx_1v_1a_1anc.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@
3939
"audio_url": "./test.pcm"
4040
}
4141
],
42-
"ancillary": [
42+
"st40p": [
4343
{
4444
"replicas": 1,
4545
"start_port": 40000,
4646
"payload_type": 113,
47-
"type": "frame",
48-
"ancillary_format": "closed_caption",
49-
"ancillary_url": "./test.txt",
50-
"ancillary_fps": "p59"
47+
"fps": "p59",
48+
"st40p_url": "./test.txt"
5149
}
5250
]
5351
}

config/tx_2v2dest_1a_1anc.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@
3939
"audio_url": "./test.pcm"
4040
}
4141
],
42-
"ancillary": [
42+
"st40p": [
4343
{
4444
"replicas": 1,
4545
"start_port": 40000,
4646
"payload_type": 113,
47-
"type": "frame",
48-
"ancillary_format": "closed_caption",
49-
"ancillary_url": "./test.txt",
50-
"ancillary_fps": "p59"
47+
"fps": "p59",
48+
"st40p_url": "./test.txt"
5149
}
5250
]
5351
},

tests/tools/RxTxApp/meson.build

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ endif
6969
# simd build option, enable sse4.2 default, todo: do we need AVX2/AVX512 for app ?
7070
app_c_args += ['-msse4.2']
7171

72+
# Keep column tracking enabled on large translation units to avoid misleading-indentation noise.
73+
app_c_args += ['-flarge-source-files']
74+
7275
if is_windows
7376
ws2_32_dep = cc.find_library('ws2_32', required: true)
7477
mman_dep = cc.find_library('mman', required: true)

tests/tools/RxTxApp/src/app_base.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <mtl/st30_api.h>
1515
#include <mtl/st30_pipeline_api.h>
1616
#include <mtl/st40_api.h>
17+
#include <mtl/st40_pipeline_api.h>
1718
#include <mtl/st41_api.h>
1819
#include <mtl/st_pipeline_api.h>
1920
#include <pcap.h>
@@ -209,11 +210,18 @@ struct st_app_tx_audio_session {
209210
};
210211

211212
struct st_app_tx_anc_session {
213+
struct st_app_context* ctx;
214+
212215
int idx;
213216
st40_tx_handle handle;
214217

215218
uint16_t framebuff_cnt;
216219

220+
uint64_t frame_num;
221+
double frame_time;
222+
uint64_t local_tai_base_time;
223+
struct st_user_time* user_time;
224+
217225
uint16_t framebuff_producer_idx;
218226
uint16_t framebuff_consumer_idx;
219227
struct st_tx_frame* framebuffs;
@@ -480,6 +488,36 @@ struct st_app_tx_st22p_session {
480488
bool st22p_app_thread_stop;
481489
};
482490

491+
struct st_app_tx_st40p_session {
492+
struct st_app_context* ctx;
493+
494+
int idx;
495+
st40p_tx_handle handle;
496+
mtl_handle st;
497+
int framebuff_cnt;
498+
499+
st_json_st40p_session_t* st40p;
500+
501+
char st40p_source_url[ST_APP_URL_MAX_LEN];
502+
uint8_t* st40p_source_begin;
503+
uint8_t* st40p_source_end;
504+
uint8_t* st40p_frame_cursor;
505+
506+
double expect_fps;
507+
double frame_time;
508+
uint64_t frame_num;
509+
uint64_t local_tai_base_time;
510+
struct st_user_time* user_time;
511+
512+
size_t udw_payload_limit;
513+
514+
pthread_t st40p_app_thread;
515+
bool st40p_app_thread_stop;
516+
517+
int fb_send;
518+
int fb_send_done;
519+
};
520+
483521
struct st_app_rx_st22p_session {
484522
int idx;
485523
mtl_handle st;
@@ -704,6 +742,10 @@ struct st_app_context {
704742
struct st_app_tx_st22p_session* tx_st22p_sessions;
705743
int tx_st22p_session_cnt;
706744

745+
char tx_st40p_url[ST_APP_URL_MAX_LEN];
746+
struct st_app_tx_st40p_session* tx_st40p_sessions;
747+
int tx_st40p_session_cnt;
748+
707749
char tx_st20p_url[ST_APP_URL_MAX_LEN]; /* send st20p content url*/
708750
struct st_app_tx_st20p_session* tx_st20p_sessions;
709751
int tx_st20p_session_cnt;

0 commit comments

Comments
 (0)