Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions applications/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
add_holohub_application(adv_networking_bench DEPENDS
OPERATORS advanced_network)

add_holohub_application(adv_networking_media_player DEPENDS
OPERATORS advanced_network advanced_network_media_rx)

add_holohub_application(adv_networking_media_sender DEPENDS
OPERATORS advanced_network advanced_network_media_tx)

add_holohub_application(aja_video_capture DEPENDS
OPERATORS aja_source)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%YAML 1.2
# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -55,26 +55,19 @@ advanced_network:
- "Data_RX_GPU"
rivermax_rx_settings:
settings_type: "ipo_receiver"
memory_registration: true
#allocator_type: "huge_page_2mb"
verbose: true
max_path_diff_us: 10000
ext_seq_num: true
sleep_between_operations_us: 0
local_ip_addresses:
- 2.1.0.12
- 2.1.0.12
source_ip_addresses:
- 2.1.0.12
- 2.1.0.12
destination_ip_addresses:
- 224.1.1.1
- 224.1.1.1
destination_ports:
- 50001
- 50002
stats_report_interval_ms: 1000
send_packet_ext_info: true
rx_threads:
- thread_id: 0
network_settings:
- stream_id: 0
local_ip_addresses:
- 2.1.0.11
source_ip_addresses:
- 2.1.0.12
destination_ip_addresses:
- 224.1.1.1
destination_ports:
- 50000

bench_rx:
interface_name: "rx_port" # Name of the RX port from the advanced_network config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ advanced_network:
#allocator_type: "huge_page_2mb"
verbose: true
sleep_between_operations: false
local_ip_address: 2.1.0.12
destination_ip_address: 224.1.1.2
destination_port: 50001
stats_report_interval_ms: 1000
send_packet_ext_info: true
video_format: YCbCr-4:2:2
Expand All @@ -73,6 +70,19 @@ advanced_network:
frame_height: 1080
frame_rate: 60
dummy_sender: false
tx_threads:
- thread_id: 0
network_settings:
- stream_id: 0
local_ip_address: 1.1.164.19
destination_ip_address: 224.1.50.1
destination_port: 50505
- thread_id: 1
network_settings:
- stream_id: 1
local_ip_address: 1.1.164.19
destination_ip_address: 224.1.50.2
destination_port: 50505

bench_tx:
interface_name: cc:00.1
Expand Down
30 changes: 19 additions & 11 deletions applications/adv_networking_bench/cpp/rivermax_bench_op_tx.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -411,6 +411,14 @@ class MediaFileFrameProvider {
size_t sleep_duration_microseconds_;
};

void shutdown(std::string message) {
HOLOSCAN_LOG_ERROR("{}", message);
if (advanced_network::is_initialized()) {
advanced_network::shutdown();
}
exit(1);
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

class AdvNetworkingBenchRivermaxTxOp : public Operator {
public:
HOLOSCAN_OPERATOR_FORWARD_ARGS(AdvNetworkingBenchRivermaxTxOp)
Expand Down Expand Up @@ -443,7 +451,7 @@ class AdvNetworkingBenchRivermaxTxOp : public Operator {

auto status = frame_provider_->initialize();
if (status != Status::SUCCESS) {
throw std::runtime_error("Failed to initialize media file provider");
shutdown("Failed to initialize media file provider");
}

// Start the provider thread
Expand Down Expand Up @@ -534,8 +542,8 @@ class AdvNetworkingBenchRivermaxTxOp : public Operator {
err);
}

enum class VideoSampling { RGB, YCbCr_4_2_2, YCbCr_4_2_0, YCbCr_4_4_4 };
enum class ColorBitDepth { _8, _10, _12 };
enum class VideoSampling { RGB, YCbCr_4_2_2, YCbCr_4_2_0, YCbCr_4_4_4, Unknown};
enum class ColorBitDepth { _8, _10, _12, Unknown};
using BytesPerPixelRatio = std::pair<uint32_t, uint32_t>;
using ColorDepthPixelRatioMap =
std::unordered_map<VideoSampling, std::unordered_map<ColorBitDepth, BytesPerPixelRatio>>;
Expand All @@ -557,14 +565,14 @@ class AdvNetworkingBenchRivermaxTxOp : public Operator {
*
* @return the corresponding VideoSampling enum value
*
* @throws std::invalid_argument if the video sampling format is not supported
* @note exits the application if the video sampling format is not supported
*/
VideoSampling get_video_sampling_format(const std::string& format) {
if (format == "RGB888") return VideoSampling::RGB;
if (format == "YUV422") return VideoSampling::YCbCr_4_2_2;
if (format == "YUV420") return VideoSampling::YCbCr_4_2_0;
if (format == "YUV442") return VideoSampling::YCbCr_4_4_4;
throw std::invalid_argument("Unsupported video sampling format: " + format);
return VideoSampling::Unknown;
}

/**
Expand All @@ -574,7 +582,7 @@ class AdvNetworkingBenchRivermaxTxOp : public Operator {
*
* @return the corresponding ColorBitDepth enum value
*
* @throws std::invalid_argument if the bit depth is not supported
* @note exits the application if the bit depth is not supported
*/
ColorBitDepth get_color_bit_depth(int bit_depth) {
switch (bit_depth) {
Expand All @@ -585,7 +593,7 @@ class AdvNetworkingBenchRivermaxTxOp : public Operator {
case 12:
return ColorBitDepth::_12;
default:
throw std::invalid_argument("Unsupported bit depth: " + std::to_string(bit_depth));
return ColorBitDepth::Unknown;
}
}

Expand All @@ -599,7 +607,7 @@ class AdvNetworkingBenchRivermaxTxOp : public Operator {
*
* @return The size of the frame in bytes.
*
* @throws std::invalid_argument If the sampling format or bit depth is unsupported.
* @note exits the application if the format or bit depth is unsupported.
*/
size_t calculate_frame_size(uint32_t width, uint32_t height, const std::string& format_str,
uint32_t bit_depth_int) {
Expand All @@ -608,12 +616,12 @@ class AdvNetworkingBenchRivermaxTxOp : public Operator {

auto format_it = COLOR_DEPTH_TO_PIXEL_RATIO.find(sampling_format);
if (format_it == COLOR_DEPTH_TO_PIXEL_RATIO.end()) {
throw std::invalid_argument("Unsupported sampling format");
shutdown("Unsupported sampling format");
}

auto depth_it = format_it->second.find(bit_depth);
if (depth_it == format_it->second.end()) {
throw std::invalid_argument("Unsupported bit depth");
shutdown("Unsupported bit depth");
}

float bytes_per_pixel = static_cast<float>(depth_it->second.first) / depth_it->second.second;
Expand Down
20 changes: 20 additions & 0 deletions applications/adv_networking_media_player/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Add subdirectories
add_subdirectory(cpp)
if(HOLOHUB_BUILD_PYTHON)
add_subdirectory(python)
endif()
Loading
Loading