Skip to content

Commit 496cf40

Browse files
committed
Add: add st40 pipeline rx GST plugin support
- document new mtl_st40p_rx element and arguments in README.md, including updated usage example. - extend gst_mtl_common getters to expose session ports and onboard-ptp state, and include the st40 pipeline API header. - add the mtl_st40p_rx GStreamer source plugin (implementation + header) with RFC8331/raw-UDW serialization, stats logging, and Meson build integration. - update validation tooling (GstreamerApp.py) to launch the new pipeline receiver with optional frame-buffer count, interlaced flag, and output format selection.
1 parent 101dd49 commit 496cf40

File tree

7 files changed

+809
-12
lines changed

7 files changed

+809
-12
lines changed

ecosystem/gstreamer_plugin/README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ In MTL GStreamer plugins there are general arguments that apply to every plugin.
110110
| port-red | string | Redundant session DPDK device port if left open taken from dev-port-red argument if specified. | N/A |
111111

112112
These are also general parameters accepted by plugins, but the functionality they provide to the user is not yet supported in plugins.
113+
113114
| Property Name | Type | Description | Range |
114115
|---------------|--------|---------------------------------------------------------------------------------------------------|--------------------------|
115116
| dma-dev | string | **RESERVED FOR FUTURE USE** port for the MTL direct memory functionality. | N/A |
@@ -204,6 +205,7 @@ To be fixed in the future.
204205
[More information about GStreamer capabilities (GstCaps)](https://gstreamer.freedesktop.org/documentation/gstreamer/gstcaps.html)
205206
206207
**Arguments**
208+
207209
| Property Name | Type | Description | Range | Default Value |
208210
|----------------------|----------|-------------------------------------------------------|-------------------------|---------------|
209211
| retry | uint | Number of times the MTL will try to get a frame. | 0 to G_MAXUINT | 10 |
@@ -257,6 +259,7 @@ The `mtl_st20p_rx` plugin supports the following pad capabilities:
257259
`11988/100`, `120`
258260
259261
**Arguments**
262+
260263
| Property Name | Type | Description | Range | Default Value |
261264
|---------------------|----------|-----------------------------------------------------|----------------------------|---------------|
262265
| retry | uint | Number of times the MTL will try to get a frame. | 0 to G_MAXUINT | 10 |
@@ -308,6 +311,7 @@ The `mtl_st30p_tx` plugin supports the following pad capabilities:
308311
- **Channels Range**: 1 to 8
309312
310313
**Arguments**
314+
311315
| Property Name | Type | Description | Range | Default Value |
312316
|----------------------|---------|-------------------------------------------------------|-------------------------|---------------|
313317
| tx-samplerate | uint | Sample rate of the audio. | [Supported Audio Sampling Rates](#232-supported-audio-sampling-rates) | 0 |
@@ -345,6 +349,7 @@ The `mtl_st30p_rx` plugin supports the following pad capabilities:
345349
- **Sample Rate Range**: 44100, 48000, 96000
346350
347351
**Arguments**
352+
348353
| Property Name | Type | Description | Range | Default Value |
349354
|---------------------|---------|-------------------------------------------------------|--------------------------|---------------|
350355
| rx-framebuff-num | uint | Number of framebuffers to be used for transmission. | 0 to G_MAXUINT | 3 |
@@ -395,6 +400,7 @@ The `mtl_st40p_tx` plugin supports all pad capabilities (the data is not checked
395400
- **Capabilities**: Any (GST_STATIC_CAPS_ANY)
396401
397402
**Arguments**
403+
398404
| Property Name | Type | Description | Range | Default Value |
399405
|-----------------------|----------|--------------------------------------------------------------------|------------------|---------------|
400406
| tx-framebuff-cnt | uint | Number of framebuffers to be used for transmission. | 0 to G_MAXUINT | 3 |
@@ -433,15 +439,20 @@ The `mtl_st40p_rx` plugin supports all pad capabilities (the data is not checked
433439
- **Capabilities**: Any (GST_STATIC_CAPS_ANY)
434440
435441
**Arguments**
436-
| Property Name | Type | Description | Range | Default Value |
437-
|---------------------|--------|-------------------------------------------------------|-----------------------------|---------------|
438-
| buffer-size | uint | Size of the buffer used for receiving data | 0 to G_MAXUINT (power of 2) | 1024 |
439-
| timeout | uint | Timeout in seconds for getting mbuf | 0 to G_MAXUINT | 10 |
440-
| include-metadata-in-buffer | gboolean | Inserts the ancillary data into buffer | TRUE/FALSE | FALSE |
441442
442-
When `include-metadata-in-buffer` is enabled, each ancillary packet includes 8 additional bytes for metadata:
443-
`c | line_number | horizontal_offset | s | stream_num | did | sdid | data_count`
444-
This metadata provides detailed information about each packet for downstream processing.
443+
| Property Name | Type | Description | Range | Default Value |
444+
|---------------------|---------|-------------------------------------------------------------|-----------------------------|---------------|
445+
| rx-framebuff-cnt | uint | Number of frame buffers allocated in the pipeline | 2 to 16 | 3 |
446+
| max-udw-size | uint | Maximum user-data word buffer size in bytes per frame | 1024 to 1,048,576 | 131,072 |
447+
| rtp-ring-size | uint | Size of the internal RTP ring (must be power of two) | 64 to 16,384 | 1,024 |
448+
| timeout | uint | Timeout in seconds for blocking frame retrieval | 0 to 300 | 60 |
449+
| rx-interlaced | boolean | Whether the incoming ancillary stream is interlaced | TRUE/FALSE | FALSE |
450+
| output-format | enum | Serialization format for received ancillary data | `raw-udw` / `rfc8331` | `raw-udw` |
451+
452+
When `output-format` is set to `rfc8331`, each ancillary packet is serialized with an 8-byte
453+
header (C, line number, horizontal offset, S, stream number, DID, SDID, data count) followed by
454+
its user data words so that downstream elements receive complete RFC8331 payloads. Selecting
455+
`raw-udw` delivers only the user-data words exactly as received on the wire.
445456
446457
#### 5.2.2. Example GStreamer Pipeline for Reception
447458
@@ -457,6 +468,6 @@ export VFIO_PORT_R="pci_address_of_the_device"
457468
export OUTPUT="path_to_the_file_we_want_to_save"
458469
459470
# Run the receiver pipeline
460-
gst-launch-1.0 -v mtl_st40_rx rx-queues=4 udp-port=40000 payload-type=113 dev-ip="$IP_PORT_R" ip="$IP_PORT_T" timeout=61 dev-port=$VFIO_PORT_R ! filesink location=$OUTPUT --gst-plugin-path $GSTREAMER_PLUGINS_PATH
471+
gst-launch-1.0 -v mtl_st40p_rx rx-queues=4 rx-framebuff-cnt=3 timeout=61 output-format=rfc8331 udp-port=40000 payload-type=113 dev-ip="$IP_PORT_R" ip="$IP_PORT_T" dev-port=$VFIO_PORT_R ! filesink location=$OUTPUT --gst-plugin-path $GSTREAMER_PLUGINS_PATH
461472
```
462473

ecosystem/gstreamer_plugin/gst_mtl_common.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,12 @@ void gst_mtl_common_get_general_arguments(GObject* object, guint prop_id,
379379
case PROP_GENERAL_DEV_ARGS_DMA_DEV:
380380
g_value_set_string(value, general_args->dma_dev);
381381
break;
382+
case PROP_GENERAL_SESSION_PORT:
383+
g_value_set_string(value, portArgs->port[MTL_PORT_P]);
384+
break;
385+
case PROP_GENERAL_SESSION_PORT_R:
386+
g_value_set_string(value, portArgs->port[MTL_PORT_R]);
387+
break;
382388
case PROP_GENERAL_PORT_IP:
383389
g_value_set_string(value, portArgs->session_ip_string[MTL_PORT_P]);
384390
break;
@@ -400,6 +406,9 @@ void gst_mtl_common_get_general_arguments(GObject* object, guint prop_id,
400406
case PROP_GENERAL_PORT_TX_QUEUES:
401407
g_value_set_uint(value, general_args->tx_queues_cnt[MTL_PORT_P]);
402408
break;
409+
case PROP_GENERAL_ENABLE_ONBOARD_PTP:
410+
g_value_set_boolean(value, general_args->enable_onboard_ptp);
411+
break;
403412
default:
404413
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
405414
break;

ecosystem/gstreamer_plugin/gst_mtl_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <mtl/mtl_api.h>
1414
#include <mtl/st30_pipeline_api.h>
1515
#include <mtl/st40_api.h>
16+
#include <mtl/st40_pipeline_api.h>
1617
#include <mtl/st_pipeline_api.h>
1718

1819
#define PAYLOAD_TYPE_AUDIO (111)

0 commit comments

Comments
 (0)