Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qqnxmediautil.cpp File Reference
#include "qqnxmediautil_p.h"
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>
#include <QMutex>
#include <QString>
#include <QXmlStreamReader>
#include <mm/renderer.h>
#include <mm/renderer/types.h>
+ Include dependency graph for qqnxmediautil.cpp:

Go to the source code of this file.

Classes

struct  MmError
 

Macros

#define MM_ERROR_ENTRY(error)   { error, #error }
 

Functions

template<typename T , size_t N>
constexpr size_t countof (T(&)[N])
 
QString keyValueMapsLocation ()
 
QJsonObject loadMapObject (const QString &keyValueMapPath)
 
QString mmErrorMessage (const QString &msg, mmr_context_t *context, int *errorCode)
 
bool checkForDrmPermission ()
 

Variables

static const MmError mmErrors []
 
static const unsigned int numMmErrors = sizeof(mmErrors) / sizeof(MmError)
 

Macro Definition Documentation

◆ MM_ERROR_ENTRY

#define MM_ERROR_ENTRY (   error)    { error, #error }

Definition at line 26 of file qqnxmediautil.cpp.

Function Documentation

◆ checkForDrmPermission()

bool checkForDrmPermission ( )

Definition at line 102 of file qqnxmediautil.cpp.

References QDir::cdUp(), file, QDir::filePath(), QString::fromUtf8(), QDir::home(), QFile::open(), qWarning, and QIODeviceBase::ReadOnly.

+ Here is the call graph for this function:

◆ countof()

template<typename T , size_t N>
constexpr size_t countof ( T(&)  [N])
constexpr

Definition at line 59 of file qqnxmediautil.cpp.

◆ keyValueMapsLocation()

QString keyValueMapsLocation ( )

Definition at line 64 of file qqnxmediautil.cpp.

References QString::fromUtf8(), QByteArray::isNull(), and qgetenv().

Referenced by loadMapObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadMapObject()

QJsonObject loadMapObject ( const QString keyValueMapPath)

Definition at line 73 of file qqnxmediautil.cpp.

References QJsonDocument::fromJson(), QJsonDocument::isObject(), keyValueMapsLocation(), QJsonDocument::object(), QFile::open(), QIODevice::readAll(), and QIODeviceBase::ReadOnly.

+ Here is the call graph for this function:

◆ mmErrorMessage()

QString mmErrorMessage ( const QString msg,
mmr_context_t context,
int *  errorCode 
)

Definition at line 87 of file qqnxmediautil.cpp.

References QString::arg(), context, QString::fromLatin1(), QString::fromUtf8(), mmErrors, MmError::name, and numMmErrors.

+ Here is the call graph for this function:

Variable Documentation

◆ mmErrors

const MmError mmErrors[]
static
Initial value:
= {
MM_ERROR_ENTRY(MMR_ERROR_NONE),
MM_ERROR_ENTRY(MMR_ERROR_UNKNOWN ),
MM_ERROR_ENTRY(MMR_ERROR_INVALID_PARAMETER ),
MM_ERROR_ENTRY(MMR_ERROR_INVALID_STATE),
MM_ERROR_ENTRY(MMR_ERROR_UNSUPPORTED_VALUE),
MM_ERROR_ENTRY(MMR_ERROR_UNSUPPORTED_MEDIA_TYPE),
MM_ERROR_ENTRY(MMR_ERROR_MEDIA_PROTECTED),
MM_ERROR_ENTRY(MMR_ERROR_UNSUPPORTED_OPERATION),
MM_ERROR_ENTRY(MMR_ERROR_READ),
MM_ERROR_ENTRY(MMR_ERROR_WRITE),
MM_ERROR_ENTRY(MMR_ERROR_MEDIA_UNAVAILABLE),
MM_ERROR_ENTRY(MMR_ERROR_MEDIA_CORRUPTED),
MM_ERROR_ENTRY(MMR_ERROR_OUTPUT_UNAVAILABLE),
MM_ERROR_ENTRY(MMR_ERROR_NO_MEMORY),
MM_ERROR_ENTRY(MMR_ERROR_RESOURCE_UNAVAILABLE),
MM_ERROR_ENTRY(MMR_ERROR_MEDIA_DRM_NO_RIGHTS),
MM_ERROR_ENTRY(MMR_ERROR_DRM_CORRUPTED_DATA_STORE),
MM_ERROR_ENTRY(MMR_ERROR_DRM_OUTPUT_PROTECTION),
MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_HDMI),
MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_DISPLAYPORT),
MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_DVI),
MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_ANALOG_VIDEO),
MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_ANALOG_AUDIO),
MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_TOSLINK),
MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_SPDIF),
MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_BLUETOOTH),
MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_WIRELESSHD),
}
#define MM_ERROR_ENTRY(error)

Definition at line 27 of file qqnxmediautil.cpp.

Referenced by mmErrorMessage().

◆ numMmErrors

const unsigned int numMmErrors = sizeof(mmErrors) / sizeof(MmError)
static

Definition at line 56 of file qqnxmediautil.cpp.

Referenced by mmErrorMessage().