summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation
Commit message (Collapse)AuthorAgeFilesLines
* Add ; to Q_UNUSEDLars Schmertmann2020-06-2813-25/+25
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I5466906d759a7cc046d77a21e2c647a4b938d070 Reviewed-by: Val Doroshchuk <valentyn.doroshchuk@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-252-6/+6
| | | | | | Task-number: QTBUG-84469 Change-Id: Id8d07836a66e4d9223341483bfe0ed251ba2806c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Qt6: Port QtMultimedia from QStringRef to QStringViewKarsten Heimrich2020-06-111-1/+1
| | | | | | Task-number: QTBUG-84319 Change-Id: Ic342142dd17591159ee84139157e5ed613b03682 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Introduce QAbstractVideoBuffer::MTLTextureHandleVal Doroshchuk2020-06-107-59/+145
| | | | | | | | | | | | | | | | Added MTLTextureHandle to render metal textures. Is used by default if rhi is enabled for metal backend. Also fixed the frame renderer to create new opengl context and use provided one from the video surface as a share context. To remember, when the quick item is created and updatePaintNode is called, current gl context is set to the video surface as a property. When the frame renderer is ready, it extracts the gl context and uses it as a share one. Task-number: QTBUG-78678 Change-Id: I51ce666ca7c2adc10dd2c1d1dfed99cc9f596e2b Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* AVFoundation: fix playback of files with spaces in their namesNick Korotysh2020-06-021-7/+7
| | | | | | | | | | | | | | | | | Used QUrl::toEncoded() instead of QUrl::toString(). Usage of QUrl::toString() leads to URLs which can contain spaces and as result such URLs are not accepted by AVPlayer, and it remains in unknown state because AVFMediaPlayerSession::processLoadStateChange() is not called at all. And as result, QMediaPlayer waits media loading forever. [ChangeLog][Platform Specific Changes][AVFoundation] Fixed playback of files with spaces in their names. Fixes: QTBUG-84585 Pick-to: 5.15 Change-Id: I69e522d048d88310803a7040f114ee808c18720b Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-05-297-3/+455
|\ | | | | | | | | | | | | | | | | Conflicts: examples/multimedia/audiodecoder/audiodecoder.cpp examples/multimedia/audiodecoder/main.cpp src/multimedia/playback/qmediaplayer.cpp Change-Id: I8cf1293023c09069745aa3aa6df49b1e0a8a1c22
| * Add AVFCameraWindowControl as QVideoWindowControl_iid implementationIhor Dutchak2020-03-237-3/+455
| | | | | | | | | | | | | | | | | | | | | | AVFCameraWindowControl is a renderer backend, when QCamera viewfinder output set to QVideoWidget on macOS or iOS. As it uses native API and lets the OS handle rendering pipeline, it is an efficient alternative to default renderer backend. Task-number: QTBUG-68779 Change-Id: I4d27022655a7d9f4ad7cf99c84b570a0c48cf10a Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* | Update qtbase dependencyFriedemann Kleint2020-03-254-5/+5
|/ | | | | | | | | - Adapt to QOpenGLWidgets split - Use new Q_MOC_INCLUDE directive where required - Fix QtConcurrent usage Change-Id: I9de650ae4fbbd397ef4fd4650c8aa5a0443d566f Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-03-104-33/+40
|\ | | | | | | Change-Id: I4ea49723c74c6dccf141b65f834b5d539d2ab9d7
| * AVF: Use supported pixel formats from video surface in CameraVal Doroshchuk2020-03-032-23/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | QAbstractVideoSurface is waiting for the video frames in supported pixel formats. See QAbstractVideoSurface::supportedPixelFormats(). If the surface does not support device's pixel format, don't show the camera's viewfinder and don't return video frames in unsupported formats. Task-number: QTBUG-82264 Change-Id: I084674f4b093a751bc4f4941047b979766880963 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * Fix AVFVideoWindowControl/AVFVideoWidget content flick on resizeIhor Dutchak2020-03-032-10/+16
| | | | | | | | | | | | | | | | | | | | When AVPlayerLayer as a backend for AVFVideoWindowControl being resized, macOS adds animation that interferes with Qt resize routines. Disabling animation fixes visual flicks. Task-number: QTBUG-82542 Change-Id: I20a5699431369bcc2da8719b8c4a0151273f9973 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15v5.15.0-beta1Qt Forward Merge Bot2020-02-224-8/+20
|\| | | | | | | Change-Id: I04934575bd661b80b1f012a7e825dcd753d26908
| * AVF: Don't override AVPlayerLayer's bounds if already setVal Doroshchuk2020-02-201-3/+5
| | | | | | | | | | | | | | | | | | AVPlayerLayer's bounds can be changed while resizing, and should not be overridden by default/native size. Fixes: QTBUG-65536 Change-Id: I771b13e58606663ded80df3665454007d28836b7 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * AVF: Fix applying viewfinder settings for iOSVal Doroshchuk2020-02-183-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. If a resolution of the viewfinder is requested to be changed, it is not needed to check available formats for highResolutionStillImageDimensions (since it is viewfinder resolution and not still images). format.highResolutionStillImageDimensions returns the highest resolution still image that can be produced by the format. Using this format will cause wrong resolution in the viewfinder. 2. Seems iOS requires to call beginConfiguration/commitConfiguration to apply any changes. commitConfiguration is currently called when the camera gets active. In case if settings are changed after starting the camera, they will not be applied. To fix that, added beginConfiguration/commitConfiguration. Fixes: QTBUG-79935 Change-Id: I60b6e08887a82e4337a2a302b8e5513c65b26e61 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | AVF: Introduce adoption of AVAssetResourceLoaderDelegate protocolVal Doroshchuk2020-02-202-12/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-151-2/+3
|\| | | | | | | Change-Id: Ia0c325dc50b9a5a1cdd205609ba688ad9874f297
| * AVF: Only resume playback after a stalled buffer if really neededDominik Holland2020-02-061-1/+2
| | | | | | | | | | | | | | | | | | | | When AVFoundation reports that the media is now buffered, we only should resume the playback if the QMediaPlayer is in the according state. Fixes: QTBUG-81912 Change-Id: Idba30ecf6c9c7b87a1c67896d89faa9a1bceae10 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
| * AVF: Don't use deprecated AVPlayerItem::seekToTime::CMTimeVal Doroshchuk2020-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | AVPlayerItem::seekToTime::CMTime is deprecated since 10.13 Also fixed to use accurate seeking by passing a time value of kCMTimeZero for both toleranceBefore and toleranceAfter. Fixes: QTBUG-81804 Change-Id: Ifafeb1fb5ca66ecba14d77abf315ebe6ffd45eab Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-282-1/+3
|\| | | | | | | Change-Id: Ic6618a0d2e40f7008d766d861f4d2cb0190a94dd
| * AVF: Always lock the capture device when start the cameraVal Doroshchuk2020-01-242-1/+3
| | | | | | | | | | | | | | | | | | | | | | If the viewfinder settings are valid, need to lock the capture device to avoid reseting settings to default values. See also a8123e737140719549252806e0e6a1c121359f79 Fixes: QTBUG-81048 Change-Id: I834815ef6c5ef28d8017d04bdb9d5256c02d1de7 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | AVF: Check supported surface's pixel formats to enable glVal Doroshchuk2020-01-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | Supported formats might be changed, thus need to inform the renderer control about this. If gl textures are supported by the surface, the video frames will be rendered to FBO instead of QImage, next time when the update request will be received. Change-Id: I7750def3e943ea2680bb8b83853cb987ab554f00 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-142-3/+1
|\| | | | | | | Change-Id: Ie511ad4ccac1b5bde6686bbe2c391dd175dd3274
| * AVF: Set the stopped state before emitting the status after EOSVal Doroshchuk2020-01-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixed a bug when the media status was changed and emitted, but the state was kept old, this prevented to start playing again in a loop if the loops were requested. This is a regression since 9dbdd5d. Fixes: QTBUG-81122 Change-Id: Id2c7d03a25cc22f7f45c6017d2da0af9bb52e528 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| * AVF: Don't apply settings if the camera is not active yetVal Doroshchuk2020-01-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In macOS, a capture session can still automatically configure the capture format after you make changes. If frame rates are applied to the capture device and the camera is still not active, these rates will be overridden by old values when the capture session will be started. For this purpose lockForConfiguration is currently used within startRunning method of capture session. But in case if the settings are already applied to the capture device, we don't call lockForConfiguration within starting of the capture session (since it is needed to be called only when the settings have been changed). Suggesting to postpone setting of the format (to the capture device) until the camera is started. This will lead to apply settings before startRunning method with proper configuration lock. Fixes: QTBUG-81048 Change-Id: I04664e7b63474ce28571e888e524170b995a38d6 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-203-24/+28
|\| | | | | | | Change-Id: Ib250ceecd02291f752b7775f329f0f494c4aed38
| * Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-11-123-20/+24
| |\ | | | | | | | | | Change-Id: I5b99b3d05502e15373ebaedcad06d6ab4d25d387
| | * AVFMediaAsserWriter: remove deprecated declrationTimur Pocheptsov2019-11-053-20/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Interface in headers should not contain i-var declarations, these days it must be in implementation part. Also, replace quite suspicious 'load' with 'loadAquire' to pair 'storeRelease'. Since I have QT_USE_NAMESPACE in *.mm file, no need in ugly QT_PREPEND_NAMESPACE macro anymore. Change-Id: Ia19e3c5b68687030c97e8e8e982ae89627e909f9 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
| * | Merge remote-tracking branch 'origin/5.13' into 5.14v5.14.0-beta3Qt Forward Merge Bot2019-11-051-4/+4
| |\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I255dc22dc21d3629a41a8c2ae2076c48b594e626
| | * Qt Mumtimedia - fix build for iOSTimur Pocheptsov2019-11-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since RestrictedBool conversion operator was introduced, objective-C method calls require explicit .data() on our smart pointers. Fixes: QTBUG-79686 Change-Id: Ie32ebf0442cd56a01466aa58b89651d7c293de6d Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* | | Introduce QVideoFrame::image()VaL Doroshchuk2019-10-311-2/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Since QVideoFrame::pixelFormat's do not 100% match QImage::Format's, introducing converstion function. Returns an image based on current frame. Converts data if needed to supported QImage format. Change-Id: I3331578c01cf9c999a380efc4a83bf9eddb07901 (cherry picked from commit 93f966335e1ed8ed47b7e8b32452d43c2f8a7bb1) Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-151-0/+13
|\| | | | | | | | | | | | | | | Conflicts: src/multimedia/video/qvideoframe.cpp src/plugins/directshow/player/directshowplayercontrol.cpp Change-Id: I00840245e35861cf4fe1d62789815ca125b2052a
| * AVF: Emit StalledMedia when unbuffered and resume playback afterwardsVaL Doroshchuk2019-10-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | If remote source is requested to play but there is a limitation in network bandwidth, StalledMedia status is never emitted, also the playback is not resumed after buffer gets full again. Based on AVPlayerItem.playbackLikelyToKeepUp introduced changing the media status and resuming the playback. Task-number: QTBUG-49806 Change-Id: If8aa10a1ea2cee2a40c679871b836d2dca622fcd Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-172-4/+16
|\| | | | | | | Change-Id: I09f511d894db5e9987ac2b9e42266bb87ef0161d
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-132-4/+16
| |\ | | | | | | | | | Change-Id: I428528333e89214d96acef5c2ba8ea832b2b145f
| | * AVFCameraUtility: fix UB (std::sort with unfit predicate)Marc Mutz2019-08-101-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ResolutionPredicate defines an order on the resolutions (expressed as QSize) of AVCaptureDeviceFormats, from smallest (width as primary, height as secondary sort key) to largest, as the lexicographical less-than of width and height. A a lexicographical order over Strict Weak Orders is a Strict Weak Order of the product type. So far, so good. The logical negation of a Stict Weak Order is, however, not a Strict Weak Order (not-less-than is greater-or-equal, not greater-than), so it cannot be used as the predicate in std::sort. Rewrite the ResolutionPredicate as an adapter that can be used with std::less _or_ std::greater (or even std::equal_to), piggy-backing on std::tuple to implement the lexicographical sort for us, then replace not2(ResolutionPredicate) with ResolutionPredicate<std::greater>. Rename the predicate to something more apt. This also solves the use of deprecated (and in C++20, removed) std::not2. Change-Id: I6f81b149e53a5b4299b188bf3ce996f638bf3334 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | * AVFoundation: Re-create CARenderer if current OpenGL context changedAndrew Smolko2019-08-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | CARenderer was not re-created so black frames were rendered in video if current OpenGL context changed. Task-number: QTBUG-77270 Change-Id: I8df423aaa9239c938363141cca1ae4136cde839b Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-061-0/+2
|\| | | | | | | | | | | Change-Id: Ibe09461a3c1541836cc3a766276114d4ac2a74d9
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-031-0/+2
| |\| | | | | | | | | | Change-Id: Ic69cafce59e842ec05a90544e10c0bcebf5daeec
| | * AVFoundation: Fix memory leak when gl context is changedVaL Doroshchuk2019-08-021-0/+2
| | | | | | | | | | | | | | | | | | | | | I might happen when shareContext remains the same but current context has been changed few times. Change-Id: I55a7a9eab03776e3d1ca6d32117de6714692bbf0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | AVFoundation: Use 270 for the front facing camera's orientationAndrew Dolby2019-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Patch content originally proposed by Alex Reche and Olivier Le Roux. Fixes: QTBUG-67985 Change-Id: I3ec80c566bf7c67c50e3e7485248412c40bdf169 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Eradicate all but one Q_FOREACH loopMarc Mutz2019-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Q_FOREACH is going to be deprecated, or at the very least banned from use in Qt code. All these are trivial in the sense that the loop body clearly doesn't modify the container over which we iterate, and that the container is const, or trivially marked as such. In one case, replaced Q_FOREACH + delete + clear() with qDeleteAll(qExchange()), in three others, replaced Qt containers with statically-known content with plain C arrays. Change-Id: I718821811370f0cfefac3893283572d39a7d957d Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-06-251-38/+0
|\| | | | | | | | | | | Change-Id: Ia427729f2b302854daa9f8259eae038498088b7e
| * | AVFoundation: remove ResourceHandler nested classThiago Macieira2019-06-201-38/+0
| | | | | | | | | | | | | | | | | | | | | | | | Doesn't seem to be used. Task-number: QTBUG-76521 Change-Id: Ief874765cd7b43798de3fffd15a9f691e1ac078d Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-06-181-4/+2
|\| | | | | | | | | | | Change-Id: Ic3ac3515666576046ac1ec5342c5b06aadbc18ac
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-151-4/+2
| |\| | | | | | | | | | Change-Id: Ib819180a25ceedfb072362d55d30f94e40a44f9b
| | * AVFoundation: Fix sending proper state in QMediaRecorderVaL Doroshchuk2019-05-101-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Need to send the state if it has been applied. Currently it happens when Recording is requested. If Stopped is requested, the state will be changed in handleRecordingFinished callback. Change-Id: I6911f2cebb2d1cc8a08eee17e7b91654b5d6e4c7 Fixes: QTBUG-75287 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | | Deprecate canonicalUrl and canonicalRequest in QMediaContentVaL Doroshchuk2019-05-131-3/+3
|/ / | | | | | | | | | | | | | | | | | | | | Since QMediaContent can contain only one content and media resources are already deprecated, canonicalUrl and canonicalRequest are a bit confusing and outdated. Deprecated and replaced by QMediaContent::request() which already contains the url. Change-Id: I418006e112f49466b0129bf1e6e1ae629c714538 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | AVFoundation: Fix typosv5.13.0-beta1Val Doroshchuk2019-03-111-5/+4
| | | | | | | | | | Change-Id: Iab522426786a0244bf23cf889e08b5c52550eb39 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | avfoundation: fix compiler warnings regarding Objective-CJochen Seemann2019-01-046-51/+53
| | | | | | | | | | | | | | warning: declaration of instance variables in the interface is deprecated [-Wobjc-interface-ivars] Change-Id: I3763d207d916bc4f0355a282b47769d5404ea087 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | avfoundation: modernize by using nullptr and overrideJochen Seemann2019-01-0449-270/+270
|/ | | | | Change-Id: Ifd483f925ed69f0ba35c46facfdb571dea87c1ac Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>