diff options
author | Val Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-02-11 17:34:32 +0100 |
---|---|---|
committer | Val Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-02-20 13:43:24 +0100 |
commit | ccde3b75e4ff53e711439e82e1c5640fac225d8e (patch) | |
tree | 2a4b4a5387af010ca1a3dd9c10b47a7a3626c7d4 /src/multimedia/playback/qmediaplayer.cpp | |
parent | 30034a140ca8aefa1986c9964ae1f30dcfef886e (diff) |
AVF: Introduce adoption of AVAssetResourceLoaderDelegate protocol
AVAssetResourceLoaderDelegate allows to load custom resources.
Implemented resourceLoader:shouldWaitForLoadingOfRequestedResource to read data
from QIODevice.
The device should be seekable, and already should have all data available.
Since there is a need to know total size of the stream.
So the media player will wait for QIODevice::readyRead before loading the resource.
Also it requires to have url together with the stream:
QMediaPlayer->setMedia(QUrl("does_not_matter.mp3"), buffer);
Since the backend uses extension to determine type of the stream.
Fixes: QTBUG-69101
Change-Id: I8ab0b69f668ccd67c42a8e5d5c1ad518d3306cce
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/multimedia/playback/qmediaplayer.cpp')
-rw-r--r-- | src/multimedia/playback/qmediaplayer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/multimedia/playback/qmediaplayer.cpp b/src/multimedia/playback/qmediaplayer.cpp index 2f1aa45c3..9d26e8d38 100644 --- a/src/multimedia/playback/qmediaplayer.cpp +++ b/src/multimedia/playback/qmediaplayer.cpp @@ -1005,8 +1005,9 @@ void QMediaPlayer::setPlaybackRate(qreal rate) Sets the current \a media source. If a \a stream is supplied; media data will be read from it instead of resolving the media - source. In this case the media source may still be used to resolve additional information + source. In this case the url should be provided to resolve additional information about the media such as mime type. The \a stream must be open and readable. + For macOS the \a stream should be also seekable. Setting the media to a null QMediaContent will cause the player to discard all information relating to the current media source and to cease all I/O operations related |