Skip to content

Commit

Permalink
add json config guide and example
Browse files Browse the repository at this point in the history
Signed-off-by: Ric Li <[email protected]>
  • Loading branch information
ricmli committed Dec 6, 2023
1 parent d0ced54 commit 1748055
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 3 deletions.
2 changes: 2 additions & 0 deletions doc/configuration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ Common settings for following sessions in the group:

**ip (array-string):** the transmitter's IP or the multicast group IP, at least 1 primary IP, the second is redundant IP

**mcast_src_ip (array-string):** the source IP filter for multicast(optional), assume primary and redundant sessions use different multicast group, if one of the source filter set, another is allowed to be set as 0.0.0.0(any source)

**interfaces (array-int):** interfaces/ports used by the sessions, at least 1 primary interface, the second is redundant interface

#### video (array of video sessions) for RX
Expand Down
2 changes: 1 addition & 1 deletion include/st20_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ struct st22_rx_ops {
uint8_t num_port;
/** Mandatory. Pcie BDF path like 0000:af:00.0, should align to BDF of mtl_init */
char port[MTL_SESSION_PORT_MAX][MTL_PORT_MAX_LEN];
/** Mandatory. UDP source port number */
/** Mandatory. UDP dest port number */
uint16_t udp_port[MTL_SESSION_PORT_MAX];

/** Mandatory. Sender pacing type, default is narrow */
Expand Down
2 changes: 1 addition & 1 deletion include/st30_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ struct st30_rx_ops {
uint8_t num_port;
/** Mandatory. Pcie BDF path like 0000:af:00.0, should align to BDF of mtl_init */
char port[MTL_SESSION_PORT_MAX][MTL_PORT_MAX_LEN];
/** Mandatory. UDP source port number */
/** Mandatory. UDP dest port number */
uint16_t udp_port[MTL_SESSION_PORT_MAX];

/** Mandatory. Session PCM format */
Expand Down
2 changes: 1 addition & 1 deletion include/st40_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ struct st40_rx_ops {
uint8_t num_port;
/** Mandatory. Pcie BDF path like 0000:af:00.0, should align to BDF of mtl_init */
char port[MTL_SESSION_PORT_MAX][MTL_PORT_MAX_LEN];
/** Mandatory. UDP source port number */
/** Mandatory. UDP dest port number */
uint16_t udp_port[MTL_SESSION_PORT_MAX];

/** Mandatory. 7 bits payload type define in RFC3550 */
Expand Down
1 change: 1 addition & 0 deletions lib/src/mt_mcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ int mt_mcast_parse(struct mtl_main_impl* impl, struct mcast_mb_query_v3* query,
enum mtl_port port) {
if (query->type != MEMBERSHIP_QUERY) {
err("%s, invalid type %u, only allow igmp query packet.\n", __func__, query->type);
return -EIO;
}

uint16_t checksum = mcast_msg_checksum(MEMBERSHIP_QUERY, query, 0);
Expand Down
110 changes: 110 additions & 0 deletions tests/script/loop_json/multicast_source_1v_1a_1anc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"interfaces": [
{
"name": "0000:af:01.0",
"ip": "192.168.17.101"
},
{
"name": "0000:af:01.1",
"ip": "192.168.17.102"
}
],
"tx_sessions": [
{
"dip": [
"239.168.17.101"
],
"interface": [
0
],
"video": [
{
"replicas": 1,
"type": "frame",
"pacing": "gap",
"packing": "BPM",
"start_port": 20000,
"payload_type": 112,
"tr_offset": "default",
"video_format": "i1080p59",
"pg_format": "YUV_422_10bit",
"video_url": "./test.yuv"
}
],
"audio": [
{
"replicas": 1,
"type": "frame",
"start_port": 30000,
"payload_type": 111,
"audio_format": "PCM16",
"audio_channel": [
"ST"
],
"audio_sampling": "48kHz",
"audio_ptime": "1",
"audio_url": "./test.wav"
}
],
"ancillary": [
{
"replicas": 1,
"start_port": 40000,
"payload_type": 113,
"type": "frame",
"ancillary_format": "closed_caption",
"ancillary_url": "./test.txt",
"ancillary_fps": "p59"
}
]
}
],
"rx_sessions": [
{
"ip": [
"239.168.17.101"
],
"mcast_src_ip": [
"192.168.17.101"
],
"interface": [
1
],
"video": [
{
"replicas": 1,
"type": "frame",
"pacing": "gap",
"start_port": 20000,
"payload_type": 112,
"tr_offset": "default",
"video_format": "i1080p59",
"pg_format": "YUV_422_10bit",
"display": false
}
],
"audio": [
{
"replicas": 1,
"type": "frame",
"start_port": 30000,
"payload_type": 111,
"audio_format": "PCM16",
"audio_channel": [
"ST"
],
"audio_sampling": "48kHz",
"audio_ptime": "1",
"audio_url": "./test.wav"
}
],
"ancillary": [
{
"replicas": 1,
"start_port": 40000,
"payload_type": 113
}
]
}
]
}
115 changes: 115 additions & 0 deletions tests/script/loop_json/multicast_source_redundant_1v_1a_1anc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"interfaces": [
{
"name": "0000:af:01.0",
"ip": "192.168.17.101"
},
{
"name": "0000:af:01.1",
"ip": "192.168.17.102"
}
],
"tx_sessions": [
{
"dip": [
"239.168.17.101",
"239.168.17.102"
],
"interface": [
0,
1
],
"video": [
{
"replicas": 1,
"type": "frame",
"pacing": "gap",
"packing": "BPM",
"start_port": 20000,
"payload_type": 112,
"tr_offset": "default",
"video_format": "i1080p59",
"pg_format": "YUV_422_10bit",
"video_url": "./test.yuv"
}
],
"audio": [
{
"replicas": 1,
"type": "frame",
"start_port": 30000,
"payload_type": 111,
"audio_format": "PCM16",
"audio_channel": [
"ST"
],
"audio_sampling": "48kHz",
"audio_ptime": "1",
"audio_url": "./test.wav"
}
],
"ancillary": [
{
"replicas": 1,
"start_port": 40000,
"payload_type": 113,
"type": "frame",
"ancillary_format": "closed_caption",
"ancillary_url": "./test.txt",
"ancillary_fps": "p59"
}
]
}
],
"rx_sessions": [
{
"ip": [
"239.168.17.101",
"239.168.17.102"
],
"mcast_src_ip": [
"192.168.17.101",
"192.168.17.102"
],
"interface": [
1,
0
],
"video": [
{
"replicas": 1,
"type": "frame",
"pacing": "gap",
"start_port": 20000,
"payload_type": 112,
"tr_offset": "default",
"video_format": "i1080p59",
"pg_format": "YUV_422_10bit",
"display": false
}
],
"audio": [
{
"replicas": 1,
"type": "frame",
"start_port": 30000,
"payload_type": 111,
"audio_format": "PCM16",
"audio_channel": [
"ST"
],
"audio_sampling": "48kHz",
"audio_ptime": "1",
"audio_url": "./test.wav"
}
],
"ancillary": [
{
"replicas": 1,
"start_port": 40000,
"payload_type": 113
}
]
}
]
}

0 comments on commit 1748055

Please sign in to comment.