Skip to content

Commit 65cca69

Browse files
committed
Merge branch 'master' into update-doc
2 parents 1e71793 + 6fc99f1 commit 65cca69

17 files changed

+417
-75
lines changed

.github/workflows/build-test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ jobs:
262262
libssl-dev
263263
264264
cd ${{ env.RUNNER_WORKSPACE }}
265-
git clone --recurse-submodules --branch v2.10.18 https://github.com/Microsoft/cpprestsdk
265+
git clone --recurse-submodules --branch v2.10.19 https://github.com/Microsoft/cpprestsdk
266266
cd cpprestsdk/Release
267267
mkdir build
268268
cd build
@@ -801,7 +801,7 @@ jobs:
801801
libssl-dev
802802
803803
cd ${{ env.RUNNER_WORKSPACE }}
804-
git clone --recurse-submodules --branch v2.10.18 https://github.com/Microsoft/cpprestsdk
804+
git clone --recurse-submodules --branch v2.10.19 https://github.com/Microsoft/cpprestsdk
805805
cd cpprestsdk/Release
806806
mkdir build
807807
cd build

.github/workflows/src/build-setup.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
libssl-dev
143143
144144
cd ${{ env.RUNNER_WORKSPACE }}
145-
git clone --recurse-submodules --branch v2.10.18 https://github.com/Microsoft/cpprestsdk
145+
git clone --recurse-submodules --branch v2.10.19 https://github.com/Microsoft/cpprestsdk
146146
cd cpprestsdk/Release
147147
mkdir build
148148
cd build

Development/cmake/NmosCppDependencies.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Boost
22

33
set(BOOST_VERSION_MIN "1.54.0")
4-
set(BOOST_VERSION_CUR "1.80.0")
4+
set(BOOST_VERSION_CUR "1.83.0")
55
# note: 1.57.0 doesn't work due to https://svn.boost.org/trac10/ticket/10754
66
# note: some components are only required for one platform or other
77
# so find_package(Boost) is called after adding those components
@@ -95,7 +95,7 @@ add_library(nmos-cpp::Boost ALIAS Boost)
9595

9696
# note: 2.10.16 or higher is recommended (which is the first version with cpprestsdk-configVersion.cmake)
9797
set(CPPRESTSDK_VERSION_MIN "2.10.11")
98-
set(CPPRESTSDK_VERSION_CUR "2.10.18")
98+
set(CPPRESTSDK_VERSION_CUR "2.10.19")
9999
find_package(cpprestsdk REQUIRED)
100100
if(NOT cpprestsdk_VERSION)
101101
message(STATUS "Found cpprestsdk unknown version; minimum version: " ${CPPRESTSDK_VERSION_MIN})

Development/cmake/NmosCppTest.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ set(NMOS_CPP_TEST_NMOS_TEST_SOURCES
4949
nmos/test/jwt_validation_test.cpp
5050
nmos/test/paging_utils_test.cpp
5151
nmos/test/query_api_test.cpp
52+
nmos/test/sdp_test_utils.cpp
5253
nmos/test/sdp_utils_test.cpp
5354
nmos/test/system_resources_test.cpp
5455
nmos/test/video_jxsv_test.cpp
5556
)
5657
set(NMOS_CPP_TEST_NMOS_TEST_HEADERS
58+
nmos/test/sdp_test_utils.h
5759
)
5860

5961
set(NMOS_CPP_TEST_PPLX_TEST_SOURCES

Development/conanfile.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[requires]
2-
boost/1.80.0
3-
cpprestsdk/2.10.18
2+
boost/1.83.0
3+
cpprestsdk/2.10.19
44
websocketpp/0.8.2
55
openssl/1.1.1s
66
json-schema-validator/2.3.0

Development/mdns/service_advertiser_impl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ namespace mdns_details
6969
}
7070
}
7171

72-
static bool register_address(DNSServiceRef client, const std::string& host_name, const std::string& ip_address_, const std::string& domain, std::uint32_t interface_id, slog::base_gate& gate)
72+
static bool register_address(DNSServiceRef& client, const std::string& host_name, const std::string& ip_address_, const std::string& domain, std::uint32_t interface_id, slog::base_gate& gate)
7373
{
7474
// since empty host_name is valid for other functions, check that logic error here
7575
if (host_name.empty()) return false;

Development/nmos/client_utils.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ namespace nmos
127127
}
128128

129129
#ifdef CPPRESTSDK_ENABLE_BIND_WEBSOCKET_CLIENT
130-
// The current version of the C++ REST SDK 2.10.18 does not provide the callback to enable the custom websocket setting
130+
// The current version of the C++ REST SDK 2.10.19 does not provide the callback to enable the custom websocket setting
131131
inline std::function<void(web::websockets::client::native_handle)> make_ws_client_nativehandle_options(bool secure, const utility::string_t& client_address, slog::base_gate& gate)
132132
{
133133
if (client_address.empty()) return {};

Development/nmos/mdns.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ namespace nmos
569569
auto resolved_ver = std::find_first_of(resolved_vers.rbegin(), resolved_vers.rend(), api_ver.rbegin(), api_ver.rend());
570570
if (resolved_vers.rend() == resolved_ver) return true;
571571

572-
// hmm, may be in the furture check for the matching 'api_selector' value
572+
// hmm, maybe in the future check for the matching 'api_selector' value
573573
auto resolved_selector = nmos::parse_api_selector_record(records);
574574

575575
auto resolved_uri = web::uri_builder();

Development/nmos/sdp_utils.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -793,11 +793,11 @@ namespace nmos
793793
// additional parameters introduced by SMPTE specs since then...
794794
if (!params.range.empty()) fmtp.push_back({ sdp::fields::range, params.range.name });
795795
if (0 != params.par) fmtp.push_back({ sdp::fields::pixel_aspect_ratio, nmos::details::make_pixel_aspect_ratio(params.par) });
796-
if (0 != params.troff) fmtp.push_back({ sdp::fields::TROFF, utility::ostringstreamed(params.troff) });
796+
if (params.troff) fmtp.push_back({ sdp::fields::TROFF, utility::ostringstreamed(*params.troff) });
797797
if (0 != params.cmax) fmtp.push_back({ sdp::fields::CMAX, utility::ostringstreamed(params.cmax) });
798798
if (0 != params.maxudp) fmtp.push_back({ sdp::fields::max_udp_packet_size, utility::ostringstreamed(params.maxudp) });
799799
if (!params.tsmode.empty()) fmtp.push_back({ sdp::fields::timestamp_mode, params.tsmode.name });
800-
if (0 != params.tsdelay) fmtp.push_back({ sdp::fields::timestamp_delay, utility::ostringstreamed(params.tsdelay) });
800+
if (params.tsdelay) fmtp.push_back({ sdp::fields::timestamp_delay, utility::ostringstreamed(*params.tsdelay) });
801801

802802
return{ session_name, sdp::media_types::video, rtpmap, fmtp, {}, {}, {}, {}, media_stream_ids, ts_refclk };
803803
}
@@ -814,7 +814,7 @@ namespace nmos
814814
sdp_parameters::fmtp_t fmtp = {};
815815
if (!params.channel_order.empty()) fmtp.push_back({ sdp::fields::channel_order, params.channel_order });
816816
if (!params.tsmode.empty()) fmtp.push_back({ sdp::fields::timestamp_mode, params.tsmode.name });
817-
if (0 != params.tsdelay) fmtp.push_back({ sdp::fields::timestamp_delay, utility::ostringstreamed(params.tsdelay) });
817+
if (params.tsdelay) fmtp.push_back({ sdp::fields::timestamp_delay, utility::ostringstreamed(*params.tsdelay) });
818818

819819
return{ session_name, sdp::media_types::audio, rtpmap, fmtp, {}, params.packet_time, {}, {}, media_stream_ids, ts_refclk };
820820
}
@@ -836,9 +836,9 @@ namespace nmos
836836
if (0 != params.exactframerate) fmtp.push_back({ sdp::fields::exactframerate, nmos::details::make_exactframerate(params.exactframerate) });
837837
if (!params.tm.empty()) fmtp.push_back({ sdp::fields::TM, params.tm.name });
838838
if (!params.ssn.empty()) fmtp.push_back({ sdp::fields::smpte_standard_number, params.ssn.name });
839-
if (0 != params.troff) fmtp.push_back({ sdp::fields::TROFF, utility::ostringstreamed(params.troff) });
839+
if (params.troff) fmtp.push_back({ sdp::fields::TROFF, utility::ostringstreamed(*params.troff) });
840840
if (!params.tsmode.empty()) fmtp.push_back({ sdp::fields::timestamp_mode, params.tsmode.name });
841-
if (0 != params.tsdelay) fmtp.push_back({ sdp::fields::timestamp_delay, utility::ostringstreamed(params.tsdelay) });
841+
if (params.tsdelay) fmtp.push_back({ sdp::fields::timestamp_delay, utility::ostringstreamed(*params.tsdelay) });
842842

843843
return{ session_name, sdp::media_types::video, rtpmap, fmtp, {}, {}, {}, {}, media_stream_ids, ts_refclk };
844844
}
@@ -854,7 +854,7 @@ namespace nmos
854854
// See https://tools.ietf.org/html/rfc4566#section-6
855855
sdp_parameters::fmtp_t fmtp = {};
856856
if (!params.tp.empty()) fmtp.push_back({ sdp::fields::type_parameter, params.tp.name });
857-
if (0 != params.troff) fmtp.push_back({ sdp::fields::TROFF, utility::ostringstreamed(params.troff) });
857+
if (params.troff) fmtp.push_back({ sdp::fields::TROFF, utility::ostringstreamed(*params.troff) });
858858

859859
return{ session_name, sdp::media_types::video, rtpmap, fmtp, {}, {}, {}, {}, media_stream_ids, ts_refclk };
860860
}

Development/nmos/sdp_utils.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,13 @@ namespace nmos
316316

317317
// additional fmtp parameters from ST 2110-21:2022
318318
sdp::type_parameter tp;
319-
uint32_t troff; // if omitted (zero), assume default
319+
bst::optional<uint32_t> troff; // if omitted, assume default
320320
uint32_t cmax; // if omitted (zero), assume max defined for tp
321321

322322
// additional fmtp parameters from ST 2110-10:2022
323323
uint32_t maxudp; // if omitted (zero), assume the Standard UP Size Limit
324324
sdp::timestamp_mode tsmode; // if omitted (empty), assume sdp::timestamp_modes::NEW
325-
uint32_t tsdelay;
325+
bst::optional<uint32_t> tsdelay;
326326

327327
video_raw_parameters() : depth(), width(), height(), interlace(), segmented(), troff(), cmax(), maxudp(), tsdelay() {}
328328

@@ -341,11 +341,11 @@ namespace nmos
341341
sdp::packing_mode pm,
342342
sdp::smpte_standard_number ssn,
343343
sdp::type_parameter tp,
344-
uint32_t troff,
344+
bst::optional<uint32_t> troff,
345345
uint32_t cmax,
346346
uint32_t maxudp,
347347
sdp::timestamp_mode tsmode,
348-
uint32_t tsdelay
348+
bst::optional<uint32_t> tsdelay
349349
)
350350
: sampling(std::move(sampling))
351351
, depth(depth)
@@ -393,7 +393,7 @@ namespace nmos
393393

394394
// additional fmtp parameters from ST 2110-10:2022
395395
sdp::timestamp_mode tsmode; // if omitted (empty), assume sdp::timestamp_modes::NEW
396-
uint32_t tsdelay;
396+
bst::optional<uint32_t> tsdelay;
397397

398398
// ptime
399399
double packet_time;
@@ -406,7 +406,7 @@ namespace nmos
406406
uint64_t sample_rate,
407407
utility::string_t channel_order,
408408
sdp::timestamp_mode tsmode,
409-
uint32_t tsdelay,
409+
bst::optional<uint32_t> tsdelay,
410410
double packet_time
411411
)
412412
: channel_count(channel_count)
@@ -442,11 +442,11 @@ namespace nmos
442442
sdp::smpte_standard_number ssn;
443443

444444
// additional fmtp parameters from ST 2110-21:2022
445-
uint32_t troff; // if omitted (zero), assume default
445+
bst::optional<uint32_t> troff; // if omitted, assume default
446446

447447
// additional fmtp parameters from ST 2110-10:2022
448448
sdp::timestamp_mode tsmode; // if omitted (empty), assume sdp::timestamp_modes::NEW
449-
uint32_t tsdelay;
449+
bst::optional<uint32_t> tsdelay;
450450

451451
video_smpte291_parameters() : vpid_code(), troff(), tsdelay() {}
452452

@@ -456,9 +456,9 @@ namespace nmos
456456
nmos::rational exactframerate,
457457
sdp::transmission_model tm,
458458
sdp::smpte_standard_number ssn,
459-
uint32_t troff,
459+
bst::optional<uint32_t> troff,
460460
sdp::timestamp_mode tsmode,
461-
uint32_t tsdelay
461+
bst::optional<uint32_t> tsdelay
462462
)
463463
: did_sdids(std::move(did_sdids))
464464
, vpid_code(vpid_code)
@@ -482,13 +482,13 @@ namespace nmos
482482
{
483483
// additional fmtp parameters from ST 2110-21:2017
484484
sdp::type_parameter tp;
485-
uint32_t troff; // if omitted (zero), assume default
485+
bst::optional<uint32_t> troff; // if omitted, assume default
486486

487487
video_SMPTE2022_6_parameters() : troff() {}
488488

489489
video_SMPTE2022_6_parameters(
490490
sdp::type_parameter tp,
491-
uint32_t troff
491+
bst::optional<uint32_t> troff
492492
)
493493
: tp(std::move(tp))
494494
, troff(troff)
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include "nmos/test/sdp_test_utils.h"
2+
3+
#include "bst/test/test.h"
4+
#include "nmos/sdp_utils.h"
5+
6+
namespace nmos
7+
{
8+
typedef std::multimap<utility::string_t, utility::string_t> comparable_fmtp_t;
9+
10+
inline comparable_fmtp_t comparable_fmtp(const nmos::sdp_parameters::fmtp_t& fmtp)
11+
{
12+
return comparable_fmtp_t{ fmtp.begin(), fmtp.end() };
13+
}
14+
15+
void check_sdp_parameters(const nmos::sdp_parameters& lhs, const nmos::sdp_parameters& rhs)
16+
{
17+
BST_REQUIRE_EQUAL(lhs.session_name, rhs.session_name);
18+
BST_REQUIRE_EQUAL(lhs.rtpmap.payload_type, rhs.rtpmap.payload_type);
19+
BST_REQUIRE_EQUAL(lhs.rtpmap.encoding_name, rhs.rtpmap.encoding_name);
20+
BST_REQUIRE_EQUAL(lhs.rtpmap.clock_rate, rhs.rtpmap.clock_rate);
21+
if (0 != lhs.rtpmap.encoding_parameters)
22+
BST_REQUIRE_EQUAL(lhs.rtpmap.encoding_parameters, rhs.rtpmap.encoding_parameters);
23+
else
24+
BST_REQUIRE((0 == rhs.rtpmap.encoding_parameters || 1 == rhs.rtpmap.encoding_parameters));
25+
BST_REQUIRE_EQUAL(comparable_fmtp(lhs.fmtp), comparable_fmtp(rhs.fmtp));
26+
BST_REQUIRE_EQUAL(lhs.packet_time, rhs.packet_time);
27+
BST_REQUIRE_EQUAL(lhs.max_packet_time, rhs.max_packet_time);
28+
BST_REQUIRE_EQUAL(lhs.bandwidth.bandwidth_type, rhs.bandwidth.bandwidth_type);
29+
BST_REQUIRE_EQUAL(lhs.bandwidth.bandwidth, rhs.bandwidth.bandwidth);
30+
}
31+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#ifndef NMOS_SDP_TEST_UTILS_H
2+
#define NMOS_SDP_TEST_UTILS_H
3+
4+
namespace nmos
5+
{
6+
struct sdp_parameters;
7+
8+
void check_sdp_parameters(const nmos::sdp_parameters& lhs, const nmos::sdp_parameters& rhs);
9+
}
10+
11+
#endif

0 commit comments

Comments
 (0)