From da1f6f4ad1f687549d0902c1cc5841c6251327b2 Mon Sep 17 00:00:00 2001 From: Antoine Villeret Date: Thu, 25 May 2023 14:36:11 +0200 Subject: [PATCH] fix build with SDK 1.30.16 fix https://github.com/NVIDIA/Rivermax/issues/4 the other 2 examples probably need similar changes however I can't build them since I'm running Windows --- generic_receiver/generic_receiver.cpp | 17 ++++++----------- rivermax_player/rivermax_player.cpp | 18 +++++++----------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/generic_receiver/generic_receiver.cpp b/generic_receiver/generic_receiver.cpp index d2fee58..d26437b 100644 --- a/generic_receiver/generic_receiver.cpp +++ b/generic_receiver/generic_receiver.cpp @@ -74,26 +74,21 @@ int main(int argc, char *argv[]) // Print the library and app version. const char *rmax_version = rmax_get_version_string(); static std::string app_version = - std::to_string(RMAX_API_MAJOR) + std::string(".") + - std::to_string(RMAX_API_MINOR) + std::string(".") + - std::to_string(RMAX_RELEASE_VERSION) + std::string(".") + - std::to_string(RMAX_BUILD); + std::to_string(RMX_VERSION_MAJOR) + std::string(".") + + std::to_string(RMX_VERSION_MINOR) + std::string(".") + + std::to_string(RMX_VERSION_PATCH); std::cout << "#########################################\n"; std::cout << "## Rivermax library version: " << rmax_version << "\n"; std::cout << "## Application version: " << app_version << "\n"; std::cout << "#########################################\n"; // Verify Rivermax library version matches (or is compatible) with this application. - unsigned int api_major; - unsigned int api_minor; - unsigned int release; - unsigned int build; - rmax_get_version(&api_major, &api_minor, &release, &build); - if (api_major != RMAX_API_MAJOR || api_minor < RMAX_API_MINOR) { + const rmx_version* version = rmx_get_version_numbers(); + if (version->major != RMX_VERSION_MAJOR || version->minor < RMX_VERSION_MINOR) { std::cerr << "The current Rivermax version is not compatible with this application." << std::endl; exit(-1); } - if (api_minor > RMAX_API_MINOR || release != RMAX_RELEASE_VERSION || build != RMAX_BUILD) { + if (version->minor > RMX_VERSION_MINOR || version->patch != RMX_VERSION_PATCH) { std::cout << "WARNING!!! Rivermax and application versions are not aligned" << std::endl; } diff --git a/rivermax_player/rivermax_player.cpp b/rivermax_player/rivermax_player.cpp index e331e37..0a9ee17 100644 --- a/rivermax_player/rivermax_player.cpp +++ b/rivermax_player/rivermax_player.cpp @@ -2619,10 +2619,6 @@ static bool set_clock(rmax_clock_types clock_handler_type, std::vector sdp_files; @@ -2756,10 +2752,10 @@ int main(int argc, char *argv[]) } } - static std::string media_version = std::to_string(RMAX_API_MAJOR) + std::string(".") + - std::to_string(RMAX_API_MINOR)+ std::string(".") + - std::to_string(RMAX_RELEASE_VERSION) + - std::string(".") + std::to_string(RMAX_BUILD); + static std::string media_version = + std::to_string(RMX_VERSION_MAJOR) + std::string(".") + + std::to_string(RMX_VERSION_MINOR) + std::string(".") + + std::to_string(RMX_VERSION_PATCH); std::cout<<"#############################################\n"; std::cout<<"## Rivermax library version: " << rmax_version << std::endl; @@ -2767,12 +2763,12 @@ int main(int argc, char *argv[]) std::cout<<"#############################################\n"; /* Verify version mismatch */ - rmax_get_version(&api_major, &api_minor, &release, &build); - if (api_major != RMAX_API_MAJOR || api_minor < RMAX_API_MINOR) { + const rmx_version* version = rmx_get_version_numbers(); + if (version->major != RMX_VERSION_MAJOR || version->minor < RMX_VERSION_MINOR) { std::cerr << "The current Rivermax version is not compatible with this version of rivermax player\n"; return -1; } - if (api_minor > RMAX_API_MINOR || release != RMAX_RELEASE_VERSION || build != RMAX_BUILD) { + if (version->minor > RMX_VERSION_MINOR || version->patch != RMX_VERSION_PATCH) { void *ctx; ctx = color_set(COLOR_RED);