diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-02-19 17:14:43 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-02-19 17:15:56 +0100 |
commit | d396262bc9771cacbc71e79215768984fa1974ff (patch) | |
tree | e029399524feabed6ebe0ee1e010af9f5e58932d /src/plugins/blackberry | |
parent | 0ce2cb3ebe6289e3db14438560fa186d9e5186b8 (diff) | |
parent | 2db2cde0d8433ad1aed59412717c4cddf496ba66 (diff) | |
download | qtmultimedia-d396262bc9771cacbc71e79215768984fa1974ff.tar.gz |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/multimedia/doc/qtmultimedia.qdocconf
src/plugins/blackberry/mediaplayer/bbmetadata.cpp
src/plugins/blackberry/mediaplayer/bbmetadata.h
tests/auto/unit/qpaintervideosurface/tst_qpaintervideosurface.cpp
Change-Id: I447c297ea15a94d1d2feb0fb5f9edac8c5d4505a
Diffstat (limited to 'src/plugins/blackberry')
-rw-r--r-- | src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp | 11 | ||||
-rw-r--r-- | src/plugins/blackberry/mediaplayer/bbmetadata.cpp | 10 | ||||
-rw-r--r-- | src/plugins/blackberry/mediaplayer/bbmetadata.h | 3 |
3 files changed, 17 insertions, 7 deletions
diff --git a/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp index 5998603d5..d664336d3 100644 --- a/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp +++ b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp @@ -305,8 +305,10 @@ void BbMediaPlayerControl::setPositionInternal(qint64 position) if (!m_context) return; - if (mmr_seek(m_context, QString::number(position).toLatin1()) != 0) - emitMmError("Seeking failed"); + if (m_metaData.isSeekable()) { + if (mmr_seek(m_context, QString::number(position).toLatin1()) != 0) + emitMmError("Seeking failed"); + } } void BbMediaPlayerControl::setMediaStatus(QMediaPlayer::MediaStatus status) @@ -385,9 +387,7 @@ bool BbMediaPlayerControl::isVideoAvailable() const bool BbMediaPlayerControl::isSeekable() const { - // We can currently not get that information from the mmrenderer API. Just pretend we can seek, - // it will fail at runtime if we can not. - return true; + return m_metaData.isSeekable(); } QMediaTimeRange BbMediaPlayerControl::availablePlaybackRanges() const @@ -605,6 +605,7 @@ void BbMediaPlayerControl::updateMetaData() emit audioAvailableChanged(m_metaData.hasAudio()); emit videoAvailableChanged(m_metaData.hasVideo()); emit availablePlaybackRangesChanged(availablePlaybackRanges()); + emit seekableChanged(m_metaData.isSeekable()); } void BbMediaPlayerControl::emitMmError(const QString &msg) diff --git a/src/plugins/blackberry/mediaplayer/bbmetadata.cpp b/src/plugins/blackberry/mediaplayer/bbmetadata.cpp index 38bb0c80b..680833e85 100644 --- a/src/plugins/blackberry/mediaplayer/bbmetadata.cpp +++ b/src/plugins/blackberry/mediaplayer/bbmetadata.cpp @@ -66,6 +66,7 @@ static const char * heightKey = "md_video_height"; static const char * mediaTypeKey = "md_title_mediatype"; static const char * pixelWidthKey = "md_video_pixel_height"; static const char * pixelHeightKey = "md_video_pixel_width"; +static const char * seekableKey = "md_title_seekable"; static const int mediaTypeAudioFlag = 4; static const int mediaTypeVideoFlag = 2; @@ -113,6 +114,8 @@ bool BbMetaData::parse(const QString &contextName) m_pixelHeight = value.toFloat(); else if (key == titleKey) m_title = value; + else if (key == seekableKey) + m_seekable = !(value == QLatin1String("0")); else if (key == artistKey) m_artist = value; else if (key == commentKey) @@ -143,7 +146,7 @@ void BbMetaData::clear() m_mediaType = -1; m_pixelWidth = 1; m_pixelHeight = 1; - + m_seekable = true; m_title.clear(); m_artist.clear(); m_comment.clear(); @@ -203,6 +206,11 @@ QString BbMetaData::title() const return m_title; } +bool BbMetaData::isSeekable() const +{ + return m_seekable; +} + QString BbMetaData::artist() const { return m_artist; diff --git a/src/plugins/blackberry/mediaplayer/bbmetadata.h b/src/plugins/blackberry/mediaplayer/bbmetadata.h index 3bb323a4d..f4b742296 100644 --- a/src/plugins/blackberry/mediaplayer/bbmetadata.h +++ b/src/plugins/blackberry/mediaplayer/bbmetadata.h @@ -61,6 +61,7 @@ public: int width() const; bool hasVideo() const; bool hasAudio() const; + bool isSeekable() const; QString title() const; QString artist() const; @@ -81,7 +82,7 @@ private: int m_mediaType; float m_pixelWidth; float m_pixelHeight; - + bool m_seekable; QString m_title; QString m_artist; QString m_comment; |