Skip to content

Commit e65776b

Browse files
committed
Add multicast source filter IP address in ST 2110 connections
* Add JSON field "multicastSourceIpAddr". * Add FFmpeg argument "-mcast_sip_addr". * Rename JSON ST 2110 connection parameters "remoteIpAddr" and "remotePort" to "ipAddr" and "port" respectively to better align with MTL API. * Adjust unit tests. * Update documentation. Signed-off-by: Konstantin Ilichev <konstantin.ilichev@intel.com>
1 parent 17c8f76 commit e65776b

32 files changed

+171
-132
lines changed

control-plane-agent/api/proxy/proxy_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ func TestProxyAPI_RegisterConnection(t *testing.T) {
312312
},
313313
Conn: &sdk.ConnectionConfig_St2110{
314314
St2110: &sdk.ConfigST2110{
315-
RemoteIpAddr: "192.168.96.10",
316-
RemotePort: 8100,
315+
IpAddr: "192.168.96.10",
316+
Port: 8100,
317317
},
318318
},
319319
Payload: &sdk.ConnectionConfig_Video{
@@ -341,8 +341,8 @@ func TestProxyAPI_RegisterConnection(t *testing.T) {
341341
},
342342
Conn: &sdk.ConnectionConfig_St2110{
343343
St2110: &sdk.ConfigST2110{
344-
RemoteIpAddr: "192.168.97.10",
345-
RemotePort: 8201,
344+
IpAddr: "192.168.97.10",
345+
Port: 8201,
346346
},
347347
},
348348
Payload: &sdk.ConnectionConfig_Audio{

control-plane-agent/internal/logic/actions/action-all-multipoint-groups-apply-proxy-star-interconnect.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ func (a *Action_AllMultipointGroupsApplyProxyStarInterconnect) Perform(ctx conte
172172
type bridgeConfig struct {
173173
model.SDKConnectionConfig
174174

175-
GroupId string
176-
ProxyId string
177-
Kind string
178-
RemoteIP string
179-
Port uint16
175+
GroupId string
176+
ProxyId string
177+
Kind string
178+
RemoteIPAddr string
179+
Port uint16
180180

181181
Exists bool
182182
}
@@ -197,19 +197,19 @@ func (a *Action_AllMultipointGroupsApplyProxyStarInterconnect) Perform(ctx conte
197197
}
198198

199199
destBridge := bridgeConfig{
200-
GroupId: groupId,
201-
ProxyId: destProxyId,
202-
Kind: "rx",
203-
RemoteIP: sourceProxy.Config.RDMA.DataplaneIPAddr,
200+
GroupId: groupId,
201+
ProxyId: destProxyId,
202+
Kind: "rx",
203+
RemoteIPAddr: sourceProxy.Config.RDMA.DataplaneIPAddr,
204204
// Port: port, // 9100, // DEBUG
205205
}
206206
destBridge.CopyFrom(&group.SDKConnectionConfig)
207207

208208
sourceBridge := bridgeConfig{
209-
GroupId: groupId,
210-
ProxyId: group.SourceProxyId,
211-
Kind: "tx",
212-
RemoteIP: destProxy.Config.RDMA.DataplaneIPAddr,
209+
GroupId: groupId,
210+
ProxyId: group.SourceProxyId,
211+
Kind: "tx",
212+
RemoteIPAddr: destProxy.Config.RDMA.DataplaneIPAddr,
213213
// Port: port, // 9100, // DEBUG
214214
}
215215
sourceBridge.CopyFrom(&group.SDKConnectionConfig)
@@ -235,7 +235,7 @@ func (a *Action_AllMultipointGroupsApplyProxyStarInterconnect) Perform(ctx conte
235235
if bridge.GroupId == newBridge.GroupId &&
236236
bridge.ProxyId == newBridge.ProxyId &&
237237
bridge.Config.Kind == newBridge.Kind &&
238-
bridge.Config.RDMA.RemoteIP == newBridge.RemoteIP {
238+
bridge.Config.RDMA.RemoteIPAddr == newBridge.RemoteIPAddr {
239239
// bridge.Config.RDMA.Port == newBridge.Port {
240240
newBridge.Exists = true
241241
found = true
@@ -314,8 +314,8 @@ func (a *Action_AllMultipointGroupsApplyProxyStarInterconnect) Perform(ctx conte
314314
Kind: newBridge.Kind,
315315
Type: "rdma",
316316
RDMA: &model.BridgeRDMAConfig{
317-
RemoteIP: newBridge.RemoteIP,
318-
Port: newBridge.Port,
317+
RemoteIPAddr: newBridge.RemoteIPAddr,
318+
Port: newBridge.Port,
319319
},
320320
}
321321

control-plane-agent/internal/logic/actions/action-registry-add-bridge-st2110.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ func (a *Action_RegistryAddBridgeST2110) Perform(ctx context.Context, modifier s
5858
config := &model.BridgeConfig{
5959
Type: connType,
6060
ST2110: &model.BridgeST2110Config{
61-
RemoteIP: sdkConnConfig.Conn.ST2110.RemoteIPAddr,
62-
Port: sdkConnConfig.Conn.ST2110.RemotePort,
63-
Transport: sdkConnConfig.Conn.ST2110.Transport,
64-
PayloadType: sdkConnConfig.Conn.ST2110.PayloadType,
61+
IPAddr: sdkConnConfig.Conn.ST2110.IPAddr,
62+
Port: sdkConnConfig.Conn.ST2110.Port,
63+
McastSipAddr: sdkConnConfig.Conn.ST2110.McastSipAddr,
64+
Transport: sdkConnConfig.Conn.ST2110.Transport,
65+
PayloadType: sdkConnConfig.Conn.ST2110.PayloadType,
6566
},
6667
}
6768

control-plane-agent/internal/logic/mesh/proxy-config.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,18 @@ func ApplyProxyConfig(ctx context.Context, mp *model.MediaProxy, groups []model.
9898
case "st2110":
9999
pbBridge.Config = &pb.Bridge_St2110{
100100
St2110: &pb.BridgeST2110{
101-
RemoteIp: bridge.Config.ST2110.RemoteIP,
102-
Port: uint32(bridge.Config.ST2110.Port),
103-
Transport: bridge.Config.ST2110.Transport,
104-
PayloadType: uint32(bridge.Config.ST2110.PayloadType),
101+
IpAddr: bridge.Config.ST2110.IPAddr,
102+
Port: uint32(bridge.Config.ST2110.Port),
103+
McastSipAddr: bridge.Config.ST2110.McastSipAddr,
104+
Transport: bridge.Config.ST2110.Transport,
105+
PayloadType: uint32(bridge.Config.ST2110.PayloadType),
105106
},
106107
}
107108
case "rdma":
108109
pbBridge.Config = &pb.Bridge_Rdma{
109110
Rdma: &pb.BridgeRDMA{
110-
RemoteIp: bridge.Config.RDMA.RemoteIP,
111-
Port: uint32(bridge.Config.RDMA.Port),
111+
RemoteIpAddr: bridge.Config.RDMA.RemoteIPAddr,
112+
Port: uint32(bridge.Config.RDMA.Port),
112113
},
113114
}
114115
}

control-plane-agent/internal/model/bridge.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@ type Bridge struct {
2222
}
2323

2424
type BridgeST2110Config struct {
25-
RemoteIP string `json:"remoteIp"`
26-
Port uint16 `json:"port"`
27-
Transport sdk.ST2110Transport `json:"-"`
28-
PayloadType uint8 `json:"payloadType"`
25+
IPAddr string `json:"remoteIp"`
26+
Port uint16 `json:"port"`
27+
McastSipAddr string `json:"mcastSipAddr,omitempty"`
28+
Transport sdk.ST2110Transport `json:"-"`
29+
PayloadType uint8 `json:"payloadType"`
2930
}
3031

3132
type BridgeRDMAConfig struct {
32-
RemoteIP string `json:"remoteIp"`
33-
Port uint16 `json:"port"`
33+
RemoteIPAddr string `json:"remoteIp"`
34+
Port uint16 `json:"port"`
3435
}
3536

3637
type BridgeConfig struct {
@@ -58,8 +59,8 @@ func (b *Bridge) ValidateConfig() error {
5859
if b.Config.ST2110 == nil {
5960
return errors.New("st2110 bridge config is nil")
6061
}
61-
if b.Config.ST2110.RemoteIP == "" {
62-
return errors.New("bad st2110 bridge remote ip")
62+
if b.Config.ST2110.IPAddr == "" {
63+
return errors.New("bad st2110 bridge ip addr")
6364
}
6465
if b.Config.ST2110.Port == 0 {
6566
return errors.New("bad st2110 bridge port")
@@ -75,8 +76,8 @@ func (b *Bridge) ValidateConfig() error {
7576
if b.Config.RDMA == nil {
7677
return errors.New("rdma bridge config is nil")
7778
}
78-
if b.Config.RDMA.RemoteIP == "" {
79-
return errors.New("bad rdma bridge remote ip")
79+
if b.Config.RDMA.RemoteIPAddr == "" {
80+
return errors.New("bad rdma bridge remote ip addr")
8081
}
8182
if b.Config.RDMA.Port == 0 {
8283
return errors.New("bad rdma bridge port")

control-plane-agent/internal/model/sdk.go

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ type SDKConfigMultipointGroup struct {
2525
}
2626

2727
type SDKConfigST2110 struct {
28-
RemoteIPAddr string `json:"remoteIpAddr"`
29-
RemotePort uint16 `json:"port"`
28+
IPAddr string `json:"remoteIpAddr"`
29+
Port uint16 `json:"port"`
30+
McastSipAddr string `json:"mcastSipAddr,omitempty"`
3031
Transport sdk.ST2110Transport `json:"-"`
3132
TransportStr string `json:"transport"`
3233
Pacing string `json:"pacing"`
@@ -161,8 +162,9 @@ func (s *SDKConnectionConfig) AssignFromPb(cfg *sdk.ConnectionConfig) error {
161162
}
162163
case *sdk.ConnectionConfig_St2110:
163164
s.Conn.ST2110 = &SDKConfigST2110{
164-
RemoteIPAddr: conn.St2110.RemoteIpAddr,
165-
RemotePort: uint16(conn.St2110.RemotePort),
165+
IPAddr: conn.St2110.IpAddr,
166+
Port: uint16(conn.St2110.Port),
167+
McastSipAddr: conn.St2110.McastSipAddr,
166168
Transport: conn.St2110.Transport,
167169
Pacing: conn.St2110.Pacing,
168170
PayloadType: uint8(conn.St2110.PayloadType),
@@ -232,8 +234,9 @@ func (s *SDKConnectionConfig) AssignToPb(cfg *sdk.ConnectionConfig) {
232234
case s.Conn.ST2110 != nil:
233235
cfg.Conn = &sdk.ConnectionConfig_St2110{
234236
St2110: &sdk.ConfigST2110{
235-
RemoteIpAddr: s.Conn.ST2110.RemoteIPAddr,
236-
RemotePort: uint32(s.Conn.ST2110.RemotePort),
237+
IpAddr: s.Conn.ST2110.IPAddr,
238+
Port: uint32(s.Conn.ST2110.Port),
239+
McastSipAddr: s.Conn.ST2110.McastSipAddr,
237240
Transport: s.Conn.ST2110.Transport,
238241
Pacing: s.Conn.ST2110.Pacing,
239242
PayloadType: uint32(s.Conn.ST2110.PayloadType),
@@ -294,11 +297,11 @@ func (s *SDKConnectionConfig) CheckPayloadCompatibility(c *SDKConnectionConfig)
294297
if c.Conn.ST2110 == nil {
295298
return errors.New("no st2110 cfg")
296299
}
297-
if s.Conn.ST2110.RemoteIPAddr != c.Conn.ST2110.RemoteIPAddr ||
298-
s.Conn.ST2110.RemotePort != c.Conn.ST2110.RemotePort {
300+
if s.Conn.ST2110.IPAddr != c.Conn.ST2110.IPAddr ||
301+
s.Conn.ST2110.Port != c.Conn.ST2110.Port {
299302
return fmt.Errorf("wrong st2110 remote host: %v:%v vs. %v:%v",
300-
s.Conn.ST2110.RemoteIPAddr, s.Conn.ST2110.RemotePort,
301-
c.Conn.ST2110.RemoteIPAddr, c.Conn.ST2110.RemotePort)
303+
s.Conn.ST2110.IPAddr, s.Conn.ST2110.Port,
304+
c.Conn.ST2110.IPAddr, c.Conn.ST2110.Port)
302305
}
303306
if s.Conn.ST2110.Transport != c.Conn.ST2110.Transport {
304307
return fmt.Errorf("incompatible st2110 transport: %v vs. %v", s.Conn.ST2110.Transport, c.Conn.ST2110.Transport)
@@ -390,7 +393,7 @@ func (s *SDKConnectionConfig) GetMultipointGroupURN() (string, error) {
390393
case s.Conn.MultipointGroup != nil:
391394
return s.Conn.MultipointGroup.URN, nil
392395
case s.Conn.ST2110 != nil:
393-
return fmt.Sprintf("%v:%v", s.Conn.ST2110.RemoteIPAddr, s.Conn.ST2110.RemotePort), nil
396+
return fmt.Sprintf("%v:%v", s.Conn.ST2110.IPAddr, s.Conn.ST2110.Port), nil
394397
default:
395398
return "", errors.New("can't get multipoint group urn: no cfg")
396399
}

docs/FFmpegPlugin.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,14 @@ Refer to the [SDK API Definition](SDK_API_Definition.md) for the options of conf
7878

7979
### SMPTE ST 2110 connection parameters (`-conn_type st2110`)
8080

81-
| Argument | Description | Example |
82-
|---------------------------|-------------------------------------------------------------------------------------------------------|--------------------------------------------|
83-
| `-ip_addr` | Remote device/host IP address, default "192.168.96.1". | `-ip_addr 224.0.0.1` |
84-
| `-port` | **Tx connection**: remote device/host port number.<br>**Rx connection**: local host port number. | `-port 9001` |
81+
| Argument | Description | Example |
82+
|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------|
83+
| `-ip_addr` | **Tx connection**: destination IP address.<br>**Rx connection**: multicast IP address or unicast source IP address. Default "192.168.96.1". | `-ip_addr 224.0.0.1` |
84+
| `-port` | **Tx connection**: destination port number.<br>**Rx connection**: local port number. | `-port 9001` |
85+
| `-mcast_sip_addr` | **Rx connection only**: optional multicast source filter IP address. ||
8586
| `-transport` | **Only for Video Muxer/Demuxer**: SMPTE ST 2110-2x transport type, `"st2110-20"` or `"st2110-22"`. Default "st2110-20".<br>**In Audio Muxers/Demuxers** this argument is not available. The SMPTE ST 2110 transport type is set internally to "st2110-30". | `-transport st2110-20` |
86-
| `-payload_type` | SMPTE ST 2110 payload type, typically between 96..127.<br>Default 112 for video, 111 for audio. | `-payload_type 112` |
87-
| `-transport_pixel_format` | Required only for the `"st2110-20"` transport type, default "yuv422p10rfc4175" | `-transport_pixel_format yuv422p10rfc4175` |
87+
| `-payload_type` | SMPTE ST 2110 payload type, typically between 96..127.<br>Default 112 for video, 111 for audio. | `-payload_type 112` |
88+
| `-transport_pixel_format` | Required only for the `"st2110-20"` transport type, default "yuv422p10rfc4175" | `-transport_pixel_format yuv422p10rfc4175` |
8889

8990
### Multipoint Group connection parameters (`-conn_type multipoint-group`)
9091

docs/Runbook.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ Refer to the [FFmpeg MCM Plugin](FFmpegPlugin.md) documentation to learn how to
149149
"connection": {
150150
"st2110": {
151151
"transport": "st2110-20",
152-
"remoteIpAddr": "224.0.0.1",
153-
"remotePort": 9002,
152+
"ipAddr": "224.0.0.1",
153+
"port": 9002,
154154
"pacing": "narrow",
155155
"payloadType": 112,
156156
"transportPixelFormat": "yuv422p10rfc4175"

docs/SDK_API_Definition.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ Creates a transmitter connection with the provided JSON configuration.
7474
"connection": {
7575
"st2110": {
7676
"transport": "st2110-20",
77-
"remoteIpAddr": "224.0.0.1",
78-
"remotePort": 9002,
77+
"ipAddr": "224.0.0.1",
78+
"port": 9002,
79+
"multicastSourceIpAddr": "192.168.95.10",
7980
"pacing": "narrow",
8081
"payloadType": 112,
8182
"transportPixelFormat": "yuv422p10rfc4175"
@@ -110,8 +111,9 @@ to setup various connection and payload options. The examples correspond to the
110111
"connection": {
111112
"st2110": {
112113
"transport": "st2110-22",
113-
"remoteIpAddr": "192.168.95.2",
114-
"remotePort": 9002,
114+
"ipAddr": "224.0.0.1",
115+
"multicastSourceIpAddr": "192.168.95.10",
116+
"port": 9002,
115117
"pacing": "narrow",
116118
"payloadType": 112
117119
}
@@ -169,9 +171,10 @@ The above `maxPayloadSize` is set explicitly to define the buffer size for the B
169171
* `"transport"` – SMPTE ST 2110 connection type.
170172
* `"st2110-20"` – Uncompressed video.
171173
* `"st2110-22"` – Compressed video (JPEG XS).
172-
* `"st2110-30"` – Audio.
173-
* `"remoteIpAddr"` – Remote device/host IP address.
174-
* `"remotePort"`**Tx connection**: remote device/host port number, **Rx connection**: local host port number.
174+
* `"st2110-30"` – Uncompressed audio (PCM).
175+
* `"ipAddr"`**Tx connection**: destination IP address. **Rx connection**: multicast IP address or unicast source IP address.
176+
* `"port"`**Tx connection**: destination port number. **Rx connection**: local port number.
177+
* `"multicastSourceIpAddr"`**Rx connection only**: optional multicast source filter IP address.
175178
* `"pacing"`
176179
* `"narrow"`
177180
* `"payloadType"` – Default 112.

docs/SDK_API_Examples.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ int main(void)
1818
"connection": {
1919
"st2110": {
2020
"transport": "st2110-20",
21-
"remoteIpAddr": "224.0.0.1",
22-
"remotePort": 9002,
21+
"ipAddr": "224.0.0.1",
22+
"port": 9002,
23+
"multicastSourceIpAddr": "192.168.95.10",
2324
"pacing": "narrow",
2425
"payloadType": 112,
2526
"transportPixelFormat": "yuv422p10rfc4175"
@@ -117,8 +118,8 @@ int main(void)
117118
"connection": {
118119
"st2110": {
119120
"transport": "st2110-20",
120-
"remoteIpAddr": "224.0.0.1",
121-
"remotePort": 9002,
121+
"ipAddr": "224.0.0.1",
122+
"port": 9002,
122123
"pacing": "narrow",
123124
"payloadType": 112,
124125
"transportPixelFormat": "yuv422p10rfc4175"

0 commit comments

Comments
 (0)