DoViGUI/QMediaInfo.cpp

39 lines
995 B
C++
Raw Normal View History

#include "QMediaInfo.h"
2023-10-07 17:25:58 -05:00
#include "MediaInfoDLL.h"
2023-10-07 17:25:58 -05:00
#include <QDebug>
QMediaInfo::QMediaInfo(QObject *parent){}
2023-10-07 17:25:58 -05:00
2023-12-23 05:29:36 -06:00
enum QMediaInfo::HDR_Type QMediaInfo::getHDRType(MediaInfoDLL::String fileName) {
2023-10-07 17:25:58 -05:00
if (Open(fileName)) {
MediaInfoDLL::String HDRtext = Get(MediaInfoDLL::Stream_Video, 0, __T("HDR_Format"), MediaInfoDLL::Info_Text, MediaInfoDLL::Info_Name);
Close();
uint32_t position = HDRtext.find(__T("Dolby Vision"));
if (HDRtext.length()) {
return (position >= 0 && position < HDRtext.length()) ? DOVI : HDR;
} else {
return SDR;
}
}
return ERR;
}
enum QMediaInfo::HDR_Type QMediaInfo::getHDRType(const QString fileName) {
2023-12-23 05:29:36 -06:00
#ifdef linux
return getHDRType(fileName.toStdString());
#else
return getHDRType(fileName.toStdWString());
2023-12-23 05:29:36 -06:00
#endif
}
QString QMediaInfo::fixFileName(QString fileName) {
#ifdef linux
return fileName.remove(0, 7);
#else
return fileName.remove(0, 8);
#endif
}