GPUJPEG: check minor version compat

Check only minor version on runtime (using GPUJPEG_VERSION_INT).
This commit is contained in:
Martin Pulec
2020-12-02 11:17:59 +01:00
parent 52a8538a2d
commit 17bb871cf0
3 changed files with 10 additions and 9 deletions

View File

@@ -2175,8 +2175,8 @@ AC_ARG_ENABLE(gpujpeg,
[gpujpeg_req=$build_default])
PKG_CHECK_MODULES([LIBGPUJPEG_ANY], [ libgpujpeg ], [ found_gpujpeg_any=yes ], [ found_gpujpeg_any=no ])
PKG_CHECK_MODULES([LIBGPUJPEG], [ libgpujpeg >= 0.11 ], [ found_gpujpeg=yes ], [ found_gpujpeg=no ])
PKG_CHECK_MODULES([LIBGPUJPEG_ANY], [libgpujpeg], [ found_gpujpeg_any=yes ], [ found_gpujpeg_any=no ])
PKG_CHECK_MODULES([LIBGPUJPEG], [libgpujpeg >= 0.12.0], [ found_gpujpeg=yes ], [ found_gpujpeg=no ])
if test "$found_gpujpeg_any" = yes -a "$found_gpujpeg" = no; then
AC_MSG_WARN([Old GPUJPEG version found, please upgrade]);

View File

@@ -63,8 +63,8 @@
#include <set>
#include <vector>
#if LIBGPUJPEG_API_VERSION < 11
#error "GPUJPEG API 10 or more requested!"
#if GPUJPEG_VERSION_INT == 0
#error "Old GPUJPEG API detected!"
#endif
#define MOD_NAME "[GPUJPEG enc.] "
@@ -446,9 +446,10 @@ state_video_compress_gpujpeg *state_video_compress_gpujpeg::create(struct module
struct module * gpujpeg_compress_init(struct module *parent, const char *opts)
{
if (gpujpeg_version() != LIBGPUJPEG_API_VERSION) {
if (gpujpeg_version() >> 8 != GPUJPEG_VERSION_INT >> 8) {
LOG(LOG_LEVEL_WARNING) << "GPUJPEG API version mismatch! (" <<
gpujpeg_version() << " vs " << LIBGPUJPEG_API_VERSION << ")\n";
gpujpeg_version_to_string(gpujpeg_version()) << " vs " <<
gpujpeg_version_to_string(GPUJPEG_VERSION_INT) << ", required same minor version)\n";
}
struct state_video_compress_gpujpeg *s;

View File

@@ -122,9 +122,9 @@ static int configure_with(struct state_decompress_gpujpeg *s, struct video_desc
static void * gpujpeg_decompress_init(void)
{
if (gpujpeg_version() != LIBGPUJPEG_API_VERSION) {
log_msg(LOG_LEVEL_WARNING, "GPUJPEG API version mismatch! (%d vs %d)\n",
gpujpeg_version(), LIBGPUJPEG_API_VERSION);
if (gpujpeg_version() >> 8 != GPUJPEG_VERSION_INT >> 8) {
log_msg(LOG_LEVEL_WARNING, "GPUJPEG API version mismatch! (%s vs %s, required same minor version)\n",
gpujpeg_version_to_string(gpujpeg_version()), gpujpeg_version_to_string(GPUJPEG_VERSION_INT));
}
struct state_decompress_gpujpeg *s = (struct state_decompress_gpujpeg *) calloc(1, sizeof(struct state_decompress_gpujpeg));