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
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user