我处理一个 github 项目已经 5 天了。该项目是几年前完成的。但该项目的一个功能是使用旧版本的 QtMultimedia 制作的。目前没有工作。我在github上找到了qt多媒体5.4.3(它的旧版本)我需要手动将旧的5.4.3版本的Qtmultimedia添加到Qt软件中。尽管我按照说明添加了,但仍然遇到以下错误。 (请不要告诉我更新项目以使用新版本的 Qtmultimedia。我不是那么专业。我也在 Windows 平台上工作。这个项目是用 qt 5.x 版本制作的。
https://i.stack.imgur.com/tAyhb.png
当我手动添加 qtmultimedia 模块时,在调用过程中并没有像 #include 那样检测模块的目录。我收到“找不到文件”错误。此外,qtmultimedia 文件在其内部看不到彼此。
#define WEBCAMIMAGESURFACE_H
#include <QAbstractVideoSurface>
#include <QImage>
class QCamera;
class WebcamImageSurface: public QAbstractVideoSurface {
Q_OBJECT
QVideoFrame lastFrame;
QCamera *cam;
public:
WebcamImageSurface(QByteArray deviceName, QObject *parent = nullptr);
QList<QVideoFrame::PixelFormat>
supportedPixelFormats(QAbstractVideoBuffer::HandleType type) const;
bool present(const QVideoFrame& frame);
QImage image() const;
};
#endif // WEBCAMIMAGESURFACE_H```
code that works with an example legacy qtmultimedia. The QAbstractVideoSurface class is obsolete. When I add the qtmultimedia module manually, the module cannot even call its own classes (not found error). qtmultimedia no longer offers version 5.4.3 "qt maintance" software either.