-
Notifications
You must be signed in to change notification settings - Fork 77
Test: Test framework refactor #1287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
d9a74dc
a788507
ae6f41e
8adf99b
3c29b7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # Application name mappings and format conversion utilities | ||
|
|
||
| # Map framework names to executable names | ||
| APP_NAME_MAP = { | ||
| "rxtxapp": "RxTxApp", | ||
| "ffmpeg": "ffmpeg", | ||
| "gstreamer": "gst-launch-1.0" | ||
| } | ||
|
|
||
| # Format conversion mappings | ||
| FFMPEG_FORMAT_MAP = { | ||
| "YUV422PLANAR10LE": "yuv422p10le", | ||
| "YUV422PLANAR8": "yuv422p", | ||
| "YUV420PLANAR8": "yuv420p", | ||
| "YUV420PLANAR10LE": "yuv420p10le", | ||
| "RGB24": "rgb24", | ||
| "RGBA": "rgba" | ||
| } | ||
|
|
||
| SESSION_TYPE_MAP = { | ||
| "ffmpeg": { | ||
| "st20p": "mtl_st20p", | ||
| "st22p": "mtl_st22p", | ||
| "st30p": "mtl_st30p", | ||
| "video": "rawvideo", | ||
| "audio": "pcm_s24le" | ||
| }, | ||
| "gstreamer": { | ||
| "st20p": "mtl_st20p", | ||
| "st22p": "mtl_st22p", | ||
| "st30p": "mtl_st30p", | ||
| "video": "mtl_video", | ||
| "audio": "mtl_audio" | ||
|
Comment on lines
+32
to
+33
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ?? i don't this this is right? Gstreamer types are
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if i understand your configuration correctly |
||
| } | ||
| } | ||
|
|
||
| FRAMERATE_TO_VIDEO_FORMAT_MAP = { | ||
| "p60": "i1080p60", | ||
| "p59": "i1080p59", | ||
| "p50": "i1080p50", | ||
| "p30": "i1080p30", | ||
| "p29": "i1080p29", | ||
| "p25": "i1080p25", | ||
| "p24": "i1080p24", | ||
| "p23": "i1080p23" | ||
| } | ||
|
|
||
| # Default network configuration values | ||
| DEFAULT_NETWORK_CONFIG = { | ||
| "nic_port": "0000:31:01.0", | ||
| "unicast_tx_ip": "192.168.17.101", | ||
| "unicast_rx_ip": "192.168.17.102", | ||
| "multicast_tx_ip": "192.168.17.101", | ||
| "multicast_rx_ip": "192.168.17.102", | ||
| "multicast_destination_ip": "239.168.48.9", | ||
| "default_config_file": "config.json" | ||
| } | ||
|
|
||
| # Default port configuration by session type | ||
| DEFAULT_PORT_CONFIG = { | ||
| "st20p_port": 20000, | ||
| "st22p_port": 20000, | ||
| "st30p_port": 30000, | ||
| "video_port": 20000, | ||
| "audio_port": 30000, | ||
| "ancillary_port": 40000, | ||
| "fastmetadata_port": 40000 | ||
|
Comment on lines
+66
to
+67
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think they shoould be diffrent ?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It could be, but this is for ST 2110-40 and ST 2110-41. It's unlikely they would be used simultaneously. However, this is only the default option and can be changed during command creation. |
||
| } | ||
|
|
||
| # Default payload type configuration by session type | ||
| DEFAULT_PAYLOAD_TYPE_CONFIG = { | ||
| "st20p_payload_type": 112, | ||
| "st22p_payload_type": 114, | ||
| "st30p_payload_type": 111, | ||
| "video_payload_type": 112, | ||
| "audio_payload_type": 111, | ||
| "ancillary_payload_type": 113, | ||
| "fastmetadata_payload_type": 115 | ||
| } | ||
|
|
||
| # Default ST22p-specific configuration | ||
| DEFAULT_ST22P_CONFIG = { | ||
| "framerate": "p25", | ||
| "pack_type": "codestream", | ||
| "codec": "JPEG-XS", | ||
| "quality": "speed", | ||
| "codec_threads": 2 | ||
| } | ||
|
|
||
| # Default FFmpeg configuration | ||
| DEFAULT_FFMPEG_CONFIG = { | ||
| "default_pixel_format": "yuv422p10le", | ||
| "default_session_type": "mtl_st20p" | ||
| } | ||
|
|
||
| # Default GStreamer configuration | ||
| DEFAULT_GSTREAMER_CONFIG = { | ||
| "default_session_type": "mtl_st20p" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,159 @@ | ||
| # Parameter trans "pixel_format": "input_format", # for TX sessions | ||
| # pixel_format_rx removed - now uses pixel_format for both TX and RXtion mappings for different applications | ||
| # Maps universal parameter names to application-specific names | ||
|
|
||
| # RxTxApp parameter mapping | ||
| RXTXAPP_PARAM_MAP = { | ||
| # Network parameters | ||
| "source_ip": "ip", | ||
| "destination_ip": "dip", | ||
| "multicast_ip": "ip", | ||
| "port": "start_port", | ||
| "nic_port": "name", | ||
|
|
||
| # Video parameters | ||
| "width": "width", | ||
| "height": "height", | ||
| "framerate": "fps", | ||
| "interlaced": "interlaced", | ||
| "pixel_format": "input_format", # for TX sessions | ||
| "pixel_format": "output_format", # for RX sessions | ||
| "transport_format": "transport_format", | ||
|
|
||
| # Audio parameters | ||
| "audio_format": "audio_format", | ||
| "audio_channels": "audio_channel", | ||
| "audio_sampling": "audio_sampling", | ||
| "audio_ptime": "audio_ptime", | ||
|
|
||
| # Streaming parameters | ||
| "payload_type": "payload_type", | ||
| "replicas": "replicas", | ||
| "pacing": "pacing", | ||
| "packing": "packing", | ||
| "device": "device", | ||
| "codec": "codec", | ||
| "quality": "quality", | ||
| "codec_threads": "codec_thread_count", | ||
|
|
||
| # File I/O | ||
| "input_file": "st20p_url", # for input files | ||
| "output_file": "st20p_url", # for output files (RX) | ||
| "url": "video_url", # for video files | ||
|
|
||
| # Flags | ||
| "enable_rtcp": "enable_rtcp", | ||
| "measure_latency": "measure_latency", | ||
| "display": "display", | ||
|
|
||
| # RxTxApp specific command-line parameters | ||
| "config_file": "--config_file", | ||
| "enable_ptp": "--ptp", | ||
| "lcores": "--lcores", | ||
| "test_time": "--test_time", | ||
| "dma_dev": "--dma_dev", | ||
| "log_level": "--log_level", | ||
| "log_file": "--log_file", | ||
| "arp_timeout_s": "--arp_timeout_s", | ||
| "allow_across_numa_core": "--allow_across_numa_core", | ||
| "no_multicast": "--no_multicast", | ||
| "rx_separate_lcore": "--rx_separate_lcore", | ||
| "rx_mix_lcore": "--rx_mix_lcore", | ||
| "runtime_session": "--runtime_session", | ||
| "rx_timing_parser": "--rx_timing_parser", | ||
| "pcapng_dump": "--pcapng_dump", | ||
| "rx_video_file_frames": "--rx_video_file_frames", | ||
| "framebuffer_count": "--rx_video_fb_cnt", | ||
| "promiscuous": "--promiscuous", | ||
| "cni_thread": "--cni_thread", | ||
| "sch_session_quota": "--sch_session_quota", | ||
| "p_tx_dst_mac": "--p_tx_dst_mac", | ||
| "r_tx_dst_mac": "--r_tx_dst_mac", | ||
| "nb_tx_desc": "--nb_tx_desc", | ||
| "nb_rx_desc": "--nb_rx_desc", | ||
| "tasklet_time": "--tasklet_time", | ||
| "tsc": "--tsc", | ||
| "pacing_way": "--pacing_way", | ||
| "shaping": "--shaping", | ||
| "vrx": "--vrx", | ||
| "ts_first_pkt": "--ts_first_pkt", | ||
| "ts_delta_us": "--ts_delta_us", | ||
| "mono_pool": "--mono_pool", | ||
| "tasklet_thread": "--tasklet_thread", | ||
| "tasklet_sleep": "--tasklet_sleep", | ||
| "tasklet_sleep_us": "--tasklet_sleep_us", | ||
| "app_bind_lcore": "--app_bind_lcore", | ||
| "rxtx_simd_512": "--rxtx_simd_512", | ||
| "rss_mode": "--rss_mode", | ||
| "tx_no_chain": "--tx_no_chain", | ||
| "multi_src_port": "--multi_src_port", | ||
| "audio_fifo_size": "--audio_fifo_size", | ||
| "dhcp": "--dhcp", | ||
| "virtio_user": "--virtio_user", | ||
| "phc2sys": "--phc2sys", | ||
| "ptp_sync_sys": "--ptp_sync_sys", | ||
| "rss_sch_nb": "--rss_sch_nb", | ||
| "log_time_ms": "--log_time_ms", | ||
| "rx_audio_dump_time_s": "--rx_audio_dump_time_s", | ||
| "dedicated_sys_lcore": "--dedicated_sys_lcore", | ||
| "bind_numa": "--bind_numa", # unified NUMA parameter (when False, equivalent to --not_bind_numa) | ||
| "force_numa": "--force_numa" | ||
| } | ||
|
|
||
| # FFmpeg parameter mapping | ||
| FFMPEG_PARAM_MAP = { | ||
| # Network parameters | ||
| "source_ip": "-p_sip", | ||
| "destination_ip": "-p_tx_ip", # for TX | ||
| "multicast_ip": "-p_rx_ip", # for RX | ||
| "port": "-udp_port", | ||
| "nic_port": "-p_port", | ||
|
|
||
| # Video parameters | ||
| "width": "-video_size", # combined with height as "1920x1080" | ||
| "height": "-video_size", # combined with width as "1920x1080" | ||
| "framerate": "-fps", # fps_numeric removed - extracted from framerate | ||
| "pixel_format": "-pix_fmt", # pixel_format_rx removed - uses same format for TX/RX | ||
|
|
||
| # Streaming parameters | ||
| "payload_type": "-payload_type", | ||
| "session_type": "-f", # format specifier (automatically converted: st20p->mtl_st20p, etc.) | ||
|
|
||
| # File I/O | ||
| "input_file": "-i", | ||
| "output_file": "", # output file is typically last argument | ||
| } | ||
|
|
||
| # GStreamer parameter mapping | ||
| GSTREAMER_PARAM_MAP = { | ||
| # Network parameters | ||
| "source_ip": "dev-ip", | ||
| "destination_ip": "ip", | ||
| "port": "udp-port", | ||
| "nic_port": "dev-port", | ||
|
|
||
| # Video parameters | ||
| "width": "rx-width", # for RX pipeline | ||
| "width_tx": "width", # for caps in TX pipeline | ||
| "height": "rx-height", # for RX pipeline | ||
| "height_tx": "height", # for caps in TX pipeline | ||
| "framerate": "rx-fps", # for RX pipeline | ||
| "framerate_tx": "framerate", # for caps in TX pipeline | ||
| "pixel_format": "rx-pixel-format", | ||
| "pixel_format_tx": "format", # for caps in TX pipeline | ||
|
||
|
|
||
| # Audio parameters | ||
| "audio_format": "rx-audio-format", | ||
| "audio_channels": "rx-channel", | ||
| "audio_sampling": "rx-sampling", | ||
|
|
||
| # Streaming parameters | ||
| "payload_type": "payload-type", | ||
| "queues": "tx-queues", # for TX | ||
| "queues_rx": "rx-queues", # for RX | ||
| "framebuffer_count": "tx-framebuff-cnt", | ||
|
|
||
| # File I/O | ||
| "input_file": "location", # for filesrc | ||
| "output_file": "location", # for filesink | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| # Universal parameter definitions for all media applications | ||
| # This serves as the common interface for RxTxApp, FFmpeg, and GStreamer | ||
|
|
||
| UNIVERSAL_PARAMS = { | ||
| # Network parameters | ||
| "source_ip": None, # Source IP address (interface IP) | ||
| "destination_ip": None, # Destination IP address (session IP) | ||
| "multicast_ip": None, # Multicast group IP | ||
| "port": 20000, # UDP port number | ||
| "nic_port": None, # Network interface/port name | ||
| "nic_port_list": None, # List of network interfaces/ports for multi-interface configs | ||
|
|
||
| # Video parameters | ||
| "width": 1920, # Video width in pixels | ||
| "height": 1080, # Video height in pixels | ||
| "framerate": "p60", # Frame rate (p25, p30, p50, p60, etc.) | ||
| "interlaced": False, # Progressive (False) or Interlaced (True) | ||
| "pixel_format": "YUV422PLANAR10LE", # Pixel format for both TX (input) and RX (output) | ||
| "transport_format": "YUV_422_10bit", # Transport format for streaming | ||
| "default_video_format": "i1080p60", # Default video format for framerate conversion | ||
|
|
||
| # Audio parameters | ||
| "audio_format": "PCM24", # Audio format | ||
| "audio_channels": ["U02"], # Audio channel configuration | ||
| "audio_sampling": "96kHz", # Audio sampling rate | ||
| "audio_ptime": "1", # Audio packet time | ||
|
|
||
| # Streaming parameters | ||
| "payload_type": 112, # RTP payload type | ||
| "session_type": "st20p", # Session type (st20p, st22p, st30p, video, audio, etc.) | ||
| "direction": None, # Direction: tx (transmit), rx (receive), or None (both for RxTxApp) | ||
| "replicas": 1, # Number of session replicas | ||
| "queues": 1, # Number of TX/RX queues | ||
| "framebuffer_count": None, # Frame buffer count (for RX video: rx_video_fb_cnt) | ||
|
|
||
| # Quality and encoding parameters | ||
| "pacing": "gap", # Pacing mode (gap, auto, etc.) | ||
| "packing": "BPM", # Packing mode | ||
| "device": "AUTO", # Device selection | ||
| "codec": "JPEG-XS", # Codec for compressed formats | ||
| "quality": "speed", # Quality setting | ||
| "codec_threads": 2, # Number of codec threads | ||
|
|
||
| # File I/O parameters | ||
| "input_file": None, # Input file path | ||
| "output_file": None, # Output file path | ||
| "url": None, # Generic URL parameter | ||
|
|
||
| # Test configuration | ||
| "test_mode": "multicast", # Test mode (unicast, multicast, kernel) | ||
| "test_time": 30, # Test duration in seconds | ||
| "enable_rtcp": False, # Enable RTCP | ||
| "measure_latency": False, # Enable latency measurement | ||
| "display": False, # Enable display output | ||
| "enable_ptp": False, # Enable PTP synchronization | ||
| "virtio_user": False, # Enable virtio-user mode | ||
|
|
||
| # RxTxApp specific parameters | ||
| "config_file": None, # JSON config file path | ||
| "lcores": None, # DPDK lcore list (e.g., "28,29,30,31") | ||
| "dma_dev": None, # DMA device list (e.g., "DMA1,DMA2,DMA3") | ||
| "log_level": None, # Log level (debug, info, notice, warning, error) | ||
| "log_file": None, # Log file path | ||
| "arp_timeout_s": None, # ARP timeout in seconds (default: 60) | ||
| "allow_across_numa_core": False, # Allow cores across NUMA nodes | ||
| "no_multicast": False, # Disable multicast join message | ||
| "rx_separate_lcore": False, # RX video on dedicated lcores | ||
| "rx_mix_lcore": False, # Allow TX/RX video on same core | ||
| "runtime_session": False, # Start instance before creating sessions | ||
| "rx_timing_parser": False, # Enable timing check for video RX streams | ||
| "pcapng_dump": None, # Dump n packets to pcapng files | ||
| "rx_video_file_frames": None, # Dump received video frames to yuv file | ||
| "promiscuous": False, # Enable RX promiscuous mode | ||
| "cni_thread": False, # Use dedicated thread for CNI messages | ||
| "sch_session_quota": None, # Max sessions count per lcore | ||
| "p_tx_dst_mac": None, # Destination MAC for primary port | ||
| "r_tx_dst_mac": None, # Destination MAC for redundant port | ||
| "nb_tx_desc": None, # Number of TX descriptors per queue | ||
| "nb_rx_desc": None, # Number of RX descriptors per queue | ||
| "tasklet_time": False, # Enable tasklet running time stats | ||
| "tsc": False, # Force TSC pacing | ||
| "pacing_way": None, # Pacing way (auto, rl, tsc, tsc_narrow, ptp, tsn) | ||
| "shaping": None, # ST21 shaping type (narrow, wide) | ||
| "vrx": None, # ST21 vrx value | ||
| "ts_first_pkt": False, # Set RTP timestamp at first packet egress | ||
| "ts_delta_us": None, # RTP timestamp delta in microseconds | ||
| "mono_pool": False, # Use mono pool for all queues | ||
| "tasklet_thread": False, # Run tasklet under thread | ||
| "tasklet_sleep": False, # Enable sleep if tasklets report done | ||
| "tasklet_sleep_us": None, # Sleep microseconds value | ||
| "app_bind_lcore": False, # Run app thread on pinned lcore | ||
| "rxtx_simd_512": False, # Enable DPDK SIMD 512 path | ||
| "rss_mode": None, # RSS mode (l3_l4, l3, none) | ||
| "tx_no_chain": False, # Use memcopy instead of mbuf chain | ||
| "multi_src_port": False, # Use multiple source ports for ST20 TX | ||
| "audio_fifo_size": None, # Audio FIFO size | ||
| "dhcp": False, # Enable DHCP for all ports | ||
| "phc2sys": False, # Enable built-in phc2sys function | ||
| "ptp_sync_sys": False, # Enable PTP to system time sync | ||
| "rss_sch_nb": None, # Number of schedulers for RSS dispatch | ||
| "log_time_ms": False, # Enable ms accuracy log printer | ||
| "rx_audio_dump_time_s": None, # Dump audio frames for n seconds | ||
| "dedicated_sys_lcore": False, # Run MTL system tasks on dedicated lcore | ||
| "bind_numa": False, # Bind all MTL threads to NIC NUMA (when False, threads run without NUMA awareness) | ||
| "force_numa": None, # Force NIC port NUMA ID | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do not understand the video and audio session type
if you want this to be "video" and "audio" to be legacy pipelines like in RxTxApp (i think thats the purpose?
Then they should be
"video" mtl_st20
"auido" mtl_st30
Without p