valbok / QtAVPlayer

Free and open-source Qt Media Player library based on FFmpeg, for Linux, Windows, macOS, iOS and Android.
MIT License
282 stars 54 forks source link

Error with Qt 6.7 beta 2: no type named 'ReturnType' in 'QtPrivate::Callable' #450

Closed geminixdev closed 7 months ago

geminixdev commented 7 months ago

Qt 6.7 is coming, and it is relevant for QtAVPlayer, because during last month there had been lots of changes in Qt Rendering, possibly and probably allowing the missing real zero copy rendering. These changes will be in Qt 6.6.2, but that's not out yet for another week or two, and they are in this Qt 6.7 beta 2, which was just released.

However when I compile with Qt 6.7 beta 2 I get this error:

/Users/.../Qt/6.7.0/macos/lib/QtCore.framework/Headers/qobjectdefs.h:513:64: error: no type named 'ReturnType' in 'QtPrivate::Callable<(lambda at ../../Projects/Player/QtAVPlayer/qavplayer.cpp:518:14) &, std::nullptr_t>'
        using R = typename QtPrivate::Callable<Func, Args...>::ReturnType;

the relevant line is 518

   dispatch([this] {

and this dispatch() is defined at Line 292ff:

template <class T>
void QAVPlayerPrivate::dispatch(T fn)
{
    QMetaObject::invokeMethod(q_ptr, fn, nullptr);
}

The complete error message:

In file included from ../../Projects/Player/QtAVPlayer/qavplayer.cpp:8:
In file included from ../../Projects/Player/QtAVPlayer/qavplayer.h:11:
In file included from ../../Projects/Player/QtAVPlayer/qavvideoframe.h:11:
In file included from ../../Projects/Player/QtAVPlayer/qavframe.h:12:
In file included from ../../Projects/Player/QtAVPlayer/qavstreamframe.h:12:
In file included from ../../Projects/Player/QtAVPlayer/qavstream.h:13:
In file included from ../../Qt/6.7.0/macos/lib/QtCore.framework/Headers/QSharedPointer:1:
In file included from ../../Qt/6.7.0/macos/lib/QtCore.framework/Headers/qsharedpointer.h:12:
In file included from /Users/name/Qt/6.7.0/macos/lib/QtCore.framework/Headers/qsharedpointer_impl.h:30:
In file included from /Users/name/Qt/6.7.0/macos/lib/QtCore.framework/Headers/qmetatype.h:18:
/Users/name/Qt/6.7.0/macos/lib/QtCore.framework/Headers/qobjectdefs.h:513:64: error: no type named 'ReturnType' in 'QtPrivate::Callable<(lambda at ../../Projects/Player/QtAVPlayer/qavplayer.cpp:518:14) &, std::nullptr_t>'
        using R = typename QtPrivate::Callable<Func, Args...>::ReturnType;
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
../../Projects/Player/QtAVPlayer/qavplayer.cpp:313:18: note: in instantiation of function template specialization 'QMetaObject::invokeMethod<(lambda at ../../Projects/Player/QtAVPlayer/qavplayer.cpp:518:14) &, std::nullptr_t>' requested here
    QMetaObject::invokeMethod(q_ptr, fn, nullptr);
                 ^
../../Projects/Player/QtAVPlayer/qavplayer.cpp:582:5: note: in instantiation of function template specialization 'QAVPlayerPrivate::dispatch<(lambda at ../../Projects/Player/QtAVPlayer/qavplayer.cpp:518:14)>' requested here
    dispatch([this] {
    ^

The issue is not Mac specific, the same happens on Linux.

I know Qt 6.7 is still beta, so consider this as a heads up, there seems to be this issue coming.

I will also test with Qt 6.6.2 in about a week, as soon as it becomes available.

valbok commented 7 months ago

https://github.com/valbok/QtAVPlayer/pull/451