Skip to content

Commit 870bcf9

Browse files
Merge branch 'main' into test_report
Signed-off-by: KarolinaPomian <[email protected]>
2 parents 8b3335e + beca485 commit 870bcf9

19 files changed

+1880
-117
lines changed

docs/sphinx/conf.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,57 +14,57 @@
1414
import os
1515
import sys
1616

17-
project = 'Media Communications Mesh'
18-
copyright = '2023-2024, Intel Corporation'
19-
author = 'Intel Corporation'
17+
project = "Media Communications Mesh"
18+
copyright = "2023-2025, Intel Corporation"
19+
author = "Intel Corporation"
2020

2121
extensions = [
22-
'myst_parser',
23-
'sphinx.ext.graphviz',
24-
'sphinxcontrib.mermaid',
25-
'sphinx_copybutton'
22+
"myst_parser",
23+
"sphinx.ext.graphviz",
24+
"sphinxcontrib.mermaid",
25+
"sphinx_copybutton",
2626
]
2727

2828
coverage_statistics_to_report = coverage_statistics_to_stdout = True
2929

3030
inline_highlight_respect_highlight = False
3131
inline_highlight_literals = False
3232

33-
templates_path = ['_templates']
33+
templates_path = ["_templates"]
3434
exclude_patterns = [
35-
'_build/*',
36-
'tests/*',
37-
'patches/*',
38-
'Thumbs.db',
39-
'.DS_Store',
40-
'**/CMakeLists.txt',
41-
'*CMakeLists.txt',
42-
'**/requirements.txt'
35+
"_build/*",
36+
"tests/*",
37+
"patches/*",
38+
"Thumbs.db",
39+
".DS_Store",
40+
"**/CMakeLists.txt",
41+
"*CMakeLists.txt",
42+
"**/requirements.txt",
4343
]
4444

4545
# -- Options for HTML output -------------------------------------------------
4646
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
4747

48-
html_theme = 'sphinx_book_theme'
49-
html_static_path = ['../_static']
48+
html_theme = "sphinx_book_theme"
49+
html_static_path = ["../_static"]
5050
language = "en_US"
5151

5252
# Options for myst_html_meta output -------------------------------------------------
5353

5454
myst_html_meta = {
5555
"description lang=en": "Media Communications Mesh",
5656
"keywords": "Intel®, Intel, Media Communications Mesh, MCM, MTL, Tiber, st20, st22, ST 2110, ST2110",
57-
"property=og:locale": "en_US"
57+
"property=og:locale": "en_US",
5858
}
59-
myst_enable_extensions = [ "strikethrough" ]
60-
myst_fence_as_directive = [ "mermaid" ]
59+
myst_enable_extensions = ["strikethrough"]
60+
myst_fence_as_directive = ["mermaid"]
6161

6262
suppress_warnings = ["myst.xref_missing", "myst.strikethrough"]
6363

6464
source_suffix = {
65-
'.rst': 'restructuredtext',
66-
'.md': 'markdown',
65+
".rst": "restructuredtext",
66+
".md": "markdown",
6767
}
6868

69-
sys.path.insert(0, os.path.abspath('..'))
70-
sys.path.insert(0, os.path.abspath('../../'))
69+
sys.path.insert(0, os.path.abspath(".."))
70+
sys.path.insert(0, os.path.abspath("../../"))

scripts/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ MTL_VERSIONS_FILE_PATH="${MTL_VERSIONS_FILE:-${MTL_DIR}/versions.env}"
2121
if [[ -f "${MTL_VERSIONS_FILE_PATH}" ]]; then
2222
MTL_VERSIONS_FILE_PATH="$(readlink -f "${MTL_VERSIONS_FILE_PATH}")"
2323
export MTL_VERSIONS_FILE_PATH
24+
# shellcheck source=/dev/null
2425
. "${MTL_VERSIONS_FILE_PATH}"
2526
fi
2627

@@ -32,6 +33,7 @@ export JPEGXS_DIR="${BUILD_DIR}/jpegxs"
3233
export LIBFABRIC_DIR="${BUILD_DIR}/libfabric"
3334
export LIBFDT_DIR="${BUILD_DIR}/libfdt"
3435
export JSONC_DIR="${BUILD_DIR}/json-c"
36+
export CMAKE_DIR="${BUILD_DIR}/cmake"
3537
export NASM_DIR="${BUILD_DIR}/nasm"
3638

3739
export ICE_DIR="${DRIVERS_DIR}/ice/${ICE_VER}"

scripts/setup_build_env.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function install_ubuntu_package_dependencies()
7474
llvm \
7575
m4 \
7676
meson \
77-
nasm cmake=3.22* \
77+
nasm \
7878
pkg-config \
7979
python3-dev \
8080
python3-pyelftools \
@@ -85,6 +85,7 @@ function install_ubuntu_package_dependencies()
8585
zlib1g-dev \
8686
"${APT_LINUX_HEADERS}" \
8787
"${APT_LINUX_MOD_EXTRA}" && \
88+
lib_build_and_install_cmake && \
8889
lib_build_and_install_golang && \
8990
return 0 || return 1
9091
}
@@ -103,7 +104,6 @@ function install_yum_package_dependencies()
103104
curl-minimal \
104105
ca-certificates \
105106
clang \
106-
cmake=3.22.1-1ubuntu1 \
107107
dracut \
108108
dtc \
109109
elfutils-libelf-devel \
@@ -145,6 +145,7 @@ function install_yum_package_dependencies()
145145
wget \
146146
zlib-devel && \
147147
python3 -m pip install meson ninja && \
148+
lib_build_and_install_cmake && \
148149
lib_install_nasm_from_rpm && \
149150
lib_build_and_install_libfdt && \
150151
lib_build_and_install_jsonc && \
@@ -184,6 +185,17 @@ function get_download_unpack_dependencies()
184185
apply_dpdk_patches
185186
}
186187

188+
# Download, build and install cmake from source code
189+
function lib_build_and_install_cmake()
190+
{
191+
git_download_strip_unpack "kitware/cmake" "refs/tags/${CMAKE_VER}" "${CMAKE_DIR}" && \
192+
pushd "${CMAKE_DIR}" && \
193+
"${CMAKE_DIR}/bootstrap" --prefix=/usr/local && \
194+
make -j "${NPROC}" -C "${CMAKE_DIR}" && \
195+
as_root make -j "${NPROC}" -C "${CMAKE_DIR}" install && \
196+
popd
197+
}
198+
187199
# Download and install rpm repo for nasm
188200
function lib_install_nasm_from_rpm()
189201
{

scripts/text-detection.py

Lines changed: 54 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
from concurrent.futures import ThreadPoolExecutor
99
import os
1010

11+
1112
def is_display_attached():
1213
# Check if the DISPLAY environment variable is set
13-
return 'DISPLAY' in os.environ
14+
return "DISPLAY" in os.environ
15+
1416

1517
def extract_text_from_region(image, x, y, font_size, length):
1618
"""
@@ -31,13 +33,14 @@ def extract_text_from_region(image, x, y, font_size, length):
3133
roi = image[y_adjusted:height, x_adjusted:width]
3234

3335
# Use Tesseract to extract text from the ROI
34-
return pytesseract.image_to_string(roi, lang='eng')
36+
return pytesseract.image_to_string(roi, lang="eng")
37+
3538

3639
def process_frame(frame_idx, frame):
3740
print("Processing Frame: ", frame_idx)
3841

3942
timestamp_format = "%H:%M:%S:%f"
40-
timestamp_pattern = r'\b\d{2}:\d{2}:\d{2}:\d{3}\b'
43+
timestamp_pattern = r"\b\d{2}:\d{2}:\d{2}:\d{3}\b"
4144

4245
# Convert frame to grayscale for better OCR performance
4346
frame = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
@@ -69,6 +72,7 @@ def process_frame(frame_idx, frame):
6972
time_difference_ms = time_difference.total_seconds() * 1000
7073
return time_difference_ms
7174

75+
7276
def main():
7377
if len(sys.argv) < 2:
7478
print("Usage: python text-detection.py <input_video_file> <output_image_name>")
@@ -79,7 +83,7 @@ def main():
7983
if not cap.isOpened():
8084
print("Fatal: Could not open video file.")
8185
sys.exit(1)
82-
86+
8387
frame_idx = 0
8488
time_differences = []
8589

@@ -105,61 +109,85 @@ def main():
105109

106110
# Filter out anomaly peaks that differ more than 25% from the average for average calculation
107111
filtered_time_differences = [
108-
td for td in non_zero_time_differences if abs(td - average_latency) <= 0.25 * average_latency
112+
td
113+
for td in non_zero_time_differences
114+
if abs(td - average_latency) <= 0.25 * average_latency
109115
]
110116

111117
# Calculate the average latency using the filtered data
112118
filtered_average_latency = np.mean(filtered_time_differences)
113119
else:
114-
print("Fatal: No timestamps recognized in the video. No data for calculating latency.")
120+
print(
121+
"Fatal: No timestamps recognized in the video. No data for calculating latency."
122+
)
115123
sys.exit(1)
116124

117125
# Plot the non-zero data
118-
plt.plot(non_zero_time_differences, marker='o')
119-
plt.title('End-to-End Latency — Media Communications Mesh')
120-
plt.xlabel('Frame Index')
121-
plt.ylabel('Latency, ms')
126+
plt.plot(non_zero_time_differences, marker="o")
127+
plt.title("End-to-End Latency — Media Communications Mesh")
128+
plt.xlabel("Frame Index")
129+
plt.ylabel("Latency, ms")
122130
plt.grid(True)
123131

124132
# Adjust the layout to create more space for the text
125133
plt.subplots_adjust(bottom=0.5)
126134

127135
# Prepare text for display and stdout
128-
average_latency_text = f'Average End-to-End Latency: {filtered_average_latency:.2f} ms'
136+
average_latency_text = (
137+
f"Average End-to-End Latency: {filtered_average_latency:.2f} ms"
138+
)
129139
file_name = os.path.basename(input_video_file)
130-
file_mod_time = datetime.fromtimestamp(os.path.getmtime(input_video_file)).strftime('%Y-%m-%d %H:%M:%S')
131-
file_info_text = f'File: {file_name} | Last modified: {file_mod_time} UTC'
140+
file_mod_time = datetime.fromtimestamp(os.path.getmtime(input_video_file)).strftime(
141+
"%Y-%m-%d %H:%M:%S"
142+
)
143+
file_info_text = f"File: {file_name} | Last modified: {file_mod_time} UTC"
132144
width = int(cap.get(cv.CAP_PROP_FRAME_WIDTH))
133145
height = int(cap.get(cv.CAP_PROP_FRAME_HEIGHT))
134146
fps = cap.get(cv.CAP_PROP_FPS)
135-
video_properties_text = f'Resolution: {width}x{height} | FPS: {fps:.2f}'
147+
video_properties_text = f"Resolution: {width}x{height} | FPS: {fps:.2f}"
136148

137149
cap.release()
138150

139151
# Display text on the plot
140-
plt.text(0.5, -0.55, average_latency_text,
141-
horizontalalignment='center', verticalalignment='center',
142-
transform=plt.gca().transAxes)
143-
plt.text(0.5, -0.85, file_info_text,
144-
horizontalalignment='center', verticalalignment='center',
145-
transform=plt.gca().transAxes)
146-
plt.text(0.5, -1, video_properties_text,
147-
horizontalalignment='center', verticalalignment='center',
148-
transform=plt.gca().transAxes)
152+
plt.text(
153+
0.5,
154+
-0.55,
155+
average_latency_text,
156+
horizontalalignment="center",
157+
verticalalignment="center",
158+
transform=plt.gca().transAxes,
159+
)
160+
plt.text(
161+
0.5,
162+
-0.85,
163+
file_info_text,
164+
horizontalalignment="center",
165+
verticalalignment="center",
166+
transform=plt.gca().transAxes,
167+
)
168+
plt.text(
169+
0.5,
170+
-1,
171+
video_properties_text,
172+
horizontalalignment="center",
173+
verticalalignment="center",
174+
transform=plt.gca().transAxes,
175+
)
149176

150177
if is_display_attached():
151178
plt.show()
152179

153180
if len(sys.argv) == 3:
154181
filename = sys.argv[2]
155-
if not filename.endswith('.jpg'):
156-
filename += '.jpg'
182+
if not filename.endswith(".jpg"):
183+
filename += ".jpg"
157184
print("Saving the latency chart to: ", filename)
158-
plt.savefig(filename, format='jpg', dpi=300)
185+
plt.savefig(filename, format="jpg", dpi=300)
159186

160187
# Print text to stdout
161188
print(file_info_text)
162189
print(video_properties_text)
163190
print(average_latency_text)
164191

192+
165193
main()

tests/validation/Engine/const.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,47 @@
33
# Media Communications Mesh
44

55
LOG_FOLDER = "logs"
6-
DEFAULT_OUTPUT_PATH = "/dev/null"
76
TESTCMD_LVL = 24 # Custom logging level for test commands
7+
DEFAULT_MEDIA_PATH = "/mnt/media/"
8+
DEFAULT_INPUT_PATH = "/opt/intel/input_path/"
9+
DEFAULT_OUTPUT_PATH = "/opt/intel/output_path/"
810

911
# time for establishing connection for example between TX and RX in st2110
1012
MTL_ESTABLISH_TIMEOUT = 2
1113
MCM_ESTABLISH_TIMEOUT = 5
1214
DEFAULT_LOOP_COUNT = 7
1315
MCM_RXTXAPP_RUN_TIMEOUT = MCM_ESTABLISH_TIMEOUT * DEFAULT_LOOP_COUNT
1416
MAX_TEST_TIME_DEFAULT = 60
17+
STOP_GRACEFULLY_PERIOD = 2 # seconds
18+
19+
BUILD_DIR = "_build"
20+
INTEL_BASE_PATH = "/opt/intel" # Base path for Intel software
21+
MCM_PATH = f"{INTEL_BASE_PATH}/mcm" # Path for MCM repository
22+
MTL_PATH = f"{INTEL_BASE_PATH}/mtl" # Path for Media Transport Library repository
23+
24+
# Built binaries paths
25+
MCM_BUILD_PATH = f"{INTEL_BASE_PATH}/_build/mcm" # Path for MCM built binaries
26+
MTL_BUILD_PATH = f"{INTEL_BASE_PATH}/_build/mtl" # Path for MTL built binaries
27+
MEDIA_PROXY_PORT = 8002 # Default port for Media Proxy
28+
29+
DEFAULT_FFMPEG_PATH = f"{INTEL_BASE_PATH}/ffmpeg" # Path for FFmpeg repository
30+
DEFAULT_OPENH264_PATH = f"{INTEL_BASE_PATH}/openh264" # Path for OpenH264 installation
31+
32+
OPENH264_VERSION_TAG = "openh264v2.4.0"
33+
34+
ALLOWED_FFMPEG_VERSIONS = ["6.1", "7.0"]
35+
DEFAULT_MCM_FFMPEG_VERSION = "7.0"
36+
DEFAULT_MCM_FFMPEG_PATH = f"{INTEL_BASE_PATH}/_build/ffmpeg-{DEFAULT_MCM_FFMPEG_VERSION}/ffmpeg-{DEFAULT_MCM_FFMPEG_VERSION.replace('.', '-')}_mcm_build"
37+
DEFAULT_MCM_FFMPEG_LD_LIBRARY_PATH = f"{DEFAULT_MCM_FFMPEG_PATH}/lib"
38+
39+
DEFAULT_MTL_FFMPEG_VERSION = "7.0"
40+
DEFAULT_MTL_FFMPEG_PATH = f"{INTEL_BASE_PATH}/_build/ffmpeg-{DEFAULT_MTL_FFMPEG_VERSION}/ffmpeg-{DEFAULT_MTL_FFMPEG_VERSION.replace('.', '-')}_mtl_build"
41+
DEFAULT_MTL_FFMPEG_LD_LIBRARY_PATH = f"{DEFAULT_MTL_FFMPEG_PATH}/lib"
42+
43+
# Input/Output paths for media files
44+
DEFAULT_MEDIA_PATH = "/mnt/media/"
45+
DEFAULT_INPUT_PATH = f"{INTEL_BASE_PATH}/input_path"
46+
DEFAULT_OUTPUT_PATH = f"{INTEL_BASE_PATH}/output_path"
1547

1648
MEDIA_PROXY_ERROR_KEYWORDS = ["[ERRO]"]
1749
MESH_AGENT_ERROR_KEYWORDS = ["[ERRO]"]

tests/validation/Engine/mcm_apps.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66

77
from Engine.const import (
88
LOG_FOLDER,
9+
MCM_PATH,
910
MEDIA_PROXY_ERROR_KEYWORDS,
11+
MEDIA_PROXY_PORT,
1012
MESH_AGENT_ERROR_KEYWORDS,
13+
MTL_PATH,
14+
STOP_GRACEFULLY_PERIOD,
1115
)
1216

1317
logger = logging.getLogger(__name__)
14-
STOP_GRACEFULLY_PERIOD = 2 # seconds
15-
16-
MCM_PATH = "/opt/intel/mcm" # Default path for MCM installation
17-
MTL_PATH = f"{MCM_PATH}/_build/mtl" # Default path for Media Transport Library
18-
MEDIA_PROXY_PORT = 8002 # Default port for Media Proxy
1918

2019

2120
def get_mtl_path(host) -> str:

0 commit comments

Comments
 (0)