diff options
author | Liang Qi <liang.qi@qt.io> | 2017-10-27 07:15:28 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-10-27 07:15:35 +0200 |
commit | 1cb4027e0a59e1875db88b72afb5833aafbd87eb (patch) | |
tree | 35646da4972db8bff385ec4147161d133e7bf1b8 /src/plugins | |
parent | 82694e41b1d37e04ecc911f420ad4317220f8180 (diff) | |
parent | 732d9cb6848a42f5a61b2b74dece962cdfba1d31 (diff) |
Merge remote-tracking branch 'origin/5.10' into dev
Change-Id: Ib509a8c90dd6c7229510a400612cc27a4957d015
Diffstat (limited to 'src/plugins')
9 files changed, 87 insertions, 87 deletions
diff --git a/src/plugins/android/src/common/qandroidvideooutput.cpp b/src/plugins/android/src/common/qandroidvideooutput.cpp index b425b9d89..eb41d4a8e 100644 --- a/src/plugins/android/src/common/qandroidvideooutput.cpp +++ b/src/plugins/android/src/common/qandroidvideooutput.cpp @@ -324,6 +324,7 @@ void QAndroidTextureVideoOutput::onFrameAvailable() if (!m_surface->isActive()) { QVideoSurfaceFormat format(frame.size(), frame.pixelFormat(), QAbstractVideoBuffer::GLTextureHandle); + format.setScanLineDirection(QVideoSurfaceFormat::BottomToTop); m_surface->start(format); } diff --git a/src/plugins/directshow/directshow.pro b/src/plugins/directshow/directshow.pro index 2857f87d9..54d617166 100644 --- a/src/plugins/directshow/directshow.pro +++ b/src/plugins/directshow/directshow.pro @@ -8,7 +8,13 @@ win32:!qtHaveModule(opengl)|qtConfig(dynamicgl) { HEADERS += dsserviceplugin.h SOURCES += dsserviceplugin.cpp -mingw: DEFINES += NO_DSHOW_STRSAFE +# Remove WINVER/_WIN32_WINNT definitions added to qt_build_config.prf +# by qtbase/d57a7c41712f8627a462d893329dc3f0dbb52d32 since the multimedia +# headers of MinGW 5.3/7.1 are too broken to compile with 0x0601. +mingw { + DEFINES -= WINVER=0x0601 _WIN32_WINNT=0x0601 + DEFINES += NO_DSHOW_STRSAFE +} include(common/common.pri) qtConfig(directshow-player): include(player/player.pri) diff --git a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp index df73b9d2c..29d7743ed 100644 --- a/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp +++ b/src/plugins/gstreamer/camerabin/camerabinimagecapture.cpp @@ -305,7 +305,9 @@ bool CameraBinImageCapture::processBusMessage(const QGstreamerMessage &message) if (!element) return false; - QString elementName = QString::fromLatin1(gst_element_get_name(element)); + gchar *name = gst_element_get_name(element); + QString elementName = QString::fromLatin1(name); + g_free(name); #if !GST_CHECK_VERSION(1,0,0) GstElementClass *elementClass = GST_ELEMENT_GET_CLASS(element); QString elementLongName = elementClass->details.longname; diff --git a/src/plugins/qnx/mediaplayer/mediaplayer.pri b/src/plugins/qnx/mediaplayer/mediaplayer.pri index f1b51a06e..71bb98827 100644 --- a/src/plugins/qnx/mediaplayer/mediaplayer.pri +++ b/src/plugins/qnx/mediaplayer/mediaplayer.pri @@ -23,4 +23,4 @@ SOURCES += \ $$PWD/mmreventmediaplayercontrol.cpp \ $$PWD/mmreventthread.cpp -QMAKE_USE += mmrenderer pps +QMAKE_USE += mmrenderer diff --git a/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.cpp b/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.cpp index 83e24dc67..55116f642 100644 --- a/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.cpp +++ b/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.cpp @@ -450,8 +450,8 @@ void MmRendererMediaPlayerControl::setMedia(const QMediaContent &media, QIODevic void MmRendererMediaPlayerControl::continueLoadMedia() { + updateMetaData(nullptr); attach(); - updateMetaData(); if (m_playAfterMediaLoaded) play(); } @@ -578,12 +578,9 @@ void MmRendererMediaPlayerControl::setMmBufferLevel(const QString &bufferLevel) } } -void MmRendererMediaPlayerControl::updateMetaData() +void MmRendererMediaPlayerControl::updateMetaData(const strm_dict *dict) { - if (m_mediaStatus == QMediaPlayer::LoadedMedia) - m_metaData.parse(m_contextName); - else - m_metaData.clear(); + m_metaData.update(dict); if (m_videoWindowControl) m_videoWindowControl->setMetaData(m_metaData); diff --git a/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.h b/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.h index 4c5adbf0d..dbac4aeb0 100644 --- a/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.h +++ b/src/plugins/qnx/mediaplayer/mmrenderermediaplayercontrol.h @@ -48,6 +48,7 @@ typedef struct mmr_connection mmr_connection_t; typedef struct mmr_context mmr_context_t; typedef struct mmrenderer_monitor mmrenderer_monitor_t; +typedef struct strm_dict strm_dict_t; QT_BEGIN_NAMESPACE @@ -116,6 +117,7 @@ protected: void setMmBufferStatus(const QString &bufferStatus); void setMmBufferLevel(const QString &bufferLevel); void handleMmStopped(); + void updateMetaData(const strm_dict_t *dict); // must be called from subclass dtors (calls virtual function stopMonitoring()) void destroy(); @@ -132,7 +134,6 @@ private: void closeConnection(); void attach(); void detach(); - void updateMetaData(); // All these set the specified value to the backend, but neither emit changed signals // nor change the member value. diff --git a/src/plugins/qnx/mediaplayer/mmrenderermetadata.cpp b/src/plugins/qnx/mediaplayer/mmrenderermetadata.cpp index 9f1087382..50b45382c 100644 --- a/src/plugins/qnx/mediaplayer/mmrenderermetadata.cpp +++ b/src/plugins/qnx/mediaplayer/mmrenderermetadata.cpp @@ -42,6 +42,13 @@ #include <QtCore/qfile.h> #include <QtCore/qstringlist.h> +#include <sys/strm.h> + +static const char *strm_string_getx(const strm_string_t *sstr, const char *defaultValue) +{ + return sstr ? strm_string_get(sstr) : defaultValue; +} + QT_BEGIN_NAMESPACE MmRendererMetaData::MmRendererMetaData() @@ -69,91 +76,72 @@ static const char * seekableKey = "md_title_seekable"; static const int mediaTypeAudioFlag = 4; static const int mediaTypeVideoFlag = 2; -bool MmRendererMetaData::parse(const QString &contextName) +bool MmRendererMetaData::update(const strm_dict_t *dict) { - clear(); - QString fileName = - QString("/pps/services/multimedia/renderer/context/%1/metadata").arg(contextName); + if (!dict) { + clear(); + return true; + } - // In newer OS versions, the filename is "metadata0", not metadata, so try both. - if (!QFile::exists(fileName)) - fileName += '0'; + const strm_string_t *value; - QFile metaDataFile(fileName); - if (!metaDataFile.open(QFile::ReadOnly)) { - qWarning() << "Unable to open media metadata file" << fileName << ":" - << metaDataFile.errorString(); - return false; - } + value = strm_dict_find_rstr(dict, durationKey); + m_duration = QByteArray(strm_string_getx(value, "0")).toLongLong(); - const QString separator("::"); - QTextStream stream(&metaDataFile); - Q_FOREVER { - const QString line = stream.readLine(); - if (line.isNull()) - break; - - const int separatorPos = line.indexOf(separator); - if (separatorPos != -1) { - const QStringRef key = line.leftRef(separatorPos); - const QStringRef value = line.midRef(separatorPos + separator.length()); - - if (key == durationKey) - m_duration = value.toLongLong(); - else if (key == widthKey) - m_width = value.toInt(); - else if (key == heightKey) - m_height = value.toInt(); - else if (key == mediaTypeKey) - m_mediaType = value.toInt(); - else if (key == pixelWidthKey) - m_pixelWidth = value.toFloat(); - else if (key == pixelHeightKey) - m_pixelHeight = value.toFloat(); - else if (key == titleKey) - m_title = value.toString(); - else if (key == seekableKey) - m_seekable = !(value == QLatin1String("0")); - else if (key == artistKey) - m_artist = value.toString(); - else if (key == commentKey) - m_comment = value.toString(); - else if (key == genreKey) - m_genre = value.toString(); - else if (key == yearKey) - m_year = value.toInt(); - else if (key == bitRateKey) - m_audioBitRate = value.toInt(); - else if (key == sampleKey) - m_sampleRate = value.toInt(); - else if (key == albumKey) - m_album = value.toString(); - else if (key == trackKey) - m_track = value.toInt(); - } - } + value = strm_dict_find_rstr(dict, widthKey); + m_width = QByteArray(strm_string_getx(value, "0")).toInt(); + + value = strm_dict_find_rstr(dict, heightKey); + m_height = QByteArray(strm_string_getx(value, "0")).toInt(); + + value = strm_dict_find_rstr(dict, mediaTypeKey); + m_mediaType = QByteArray(strm_string_getx(value, "-1")).toInt(); + + value = strm_dict_find_rstr(dict, pixelWidthKey); + m_pixelWidth = QByteArray(strm_string_getx(value, "1")).toFloat(); + + value = strm_dict_find_rstr(dict, pixelHeightKey); + m_pixelHeight = QByteArray(strm_string_getx(value, "1")).toFloat(); + + value = strm_dict_find_rstr(dict, titleKey); + m_title = QString::fromLatin1(QByteArray(strm_string_getx(value, nullptr))); + + value = strm_dict_find_rstr(dict, seekableKey); + m_seekable = (strcmp(strm_string_getx(value, "1"), "0") != 0); + + value = strm_dict_find_rstr(dict, artistKey); + m_artist = QString::fromLatin1(QByteArray(strm_string_getx(value, nullptr))); + + value = strm_dict_find_rstr(dict, commentKey); + m_comment = QString::fromLatin1(QByteArray(strm_string_getx(value, nullptr))); + + value = strm_dict_find_rstr(dict, genreKey); + m_genre = QString::fromLatin1(QByteArray(strm_string_getx(value, nullptr))); + + value = strm_dict_find_rstr(dict, yearKey); + m_year = QByteArray(strm_string_getx(value, "0")).toInt(); + + value = strm_dict_find_rstr(dict, bitRateKey); + m_audioBitRate = QByteArray(strm_string_getx(value, "0")).toInt(); + + value = strm_dict_find_rstr(dict, sampleKey); + m_sampleRate = QByteArray(strm_string_getx(value, "0")).toInt(); + + value = strm_dict_find_rstr(dict, albumKey); + m_album = QString::fromLatin1(QByteArray(strm_string_getx(value, nullptr))); + + value = strm_dict_find_rstr(dict, trackKey); + m_track = QByteArray(strm_string_getx(value, "0")).toInt(); return true; } void MmRendererMetaData::clear() { - m_duration = 0; - m_height = 0; - m_width = 0; - m_mediaType = -1; - m_pixelWidth = 1; - m_pixelHeight = 1; - m_seekable = true; - m_title.clear(); - m_artist.clear(); - m_comment.clear(); - m_genre.clear(); - m_year = 0; - m_audioBitRate = 0; - m_sampleRate = 0; - m_album.clear(); - m_track = 0; + strm_dict_t *dict; + dict = strm_dict_new(); + update(dict); + strm_dict_destroy(dict); } qlonglong MmRendererMetaData::duration() const diff --git a/src/plugins/qnx/mediaplayer/mmrenderermetadata.h b/src/plugins/qnx/mediaplayer/mmrenderermetadata.h index 4473e5306..ad2193d29 100644 --- a/src/plugins/qnx/mediaplayer/mmrenderermetadata.h +++ b/src/plugins/qnx/mediaplayer/mmrenderermetadata.h @@ -43,13 +43,15 @@ #include <QtCore/QSize> #include <QtCore/QString> +typedef struct strm_dict strm_dict_t; + QT_BEGIN_NAMESPACE class MmRendererMetaData { public: MmRendererMetaData(); - bool parse(const QString &contextName); + bool update(const strm_dict_t *dict); void clear(); // Duration in milliseconds diff --git a/src/plugins/qnx/mediaplayer/mmreventmediaplayercontrol.cpp b/src/plugins/qnx/mediaplayer/mmreventmediaplayercontrol.cpp index 3aac3124c..a0bac1261 100644 --- a/src/plugins/qnx/mediaplayer/mmreventmediaplayercontrol.cpp +++ b/src/plugins/qnx/mediaplayer/mmreventmediaplayercontrol.cpp @@ -122,12 +122,15 @@ void MmrEventMediaPlayerControl::readEvents() } break; } + case MMR_EVENT_METADATA: { + updateMetaData(event->data); + break; + } case MMR_EVENT_ERROR: case MMR_EVENT_STATE: case MMR_EVENT_NONE: case MMR_EVENT_OVERFLOW: case MMR_EVENT_WARNING: - case MMR_EVENT_METADATA: case MMR_EVENT_PLAYLIST: case MMR_EVENT_INPUT: case MMR_EVENT_OUTPUT: |