Skip to content

Commit

Permalink
fix build with SDK 1.30.16
Browse files Browse the repository at this point in the history
fix NVIDIA#4
the other 2 examples probably need similar changes however I can't build them since I'm running Windows
  • Loading branch information
avilleret committed May 25, 2023
1 parent 4d69c68 commit da1f6f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
17 changes: 6 additions & 11 deletions generic_receiver/generic_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
18 changes: 7 additions & 11 deletions rivermax_player/rivermax_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2619,10 +2619,6 @@ static bool set_clock(rmax_clock_types clock_handler_type, std::vector<std::stri

int main(int argc, char *argv[])
{
unsigned int api_major;
unsigned int api_minor;
unsigned int release;
unsigned int build;
int ret = 0;

std::vector<std::string> sdp_files;
Expand Down Expand Up @@ -2756,23 +2752,23 @@ 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;
std::cout<<"## Rivermax player version: " << media_version << std::endl;
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);
Expand Down

0 comments on commit da1f6f4

Please sign in to comment.