summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* AVFoundation: Use opengl context from surface as sharedVaL Doroshchuk2018-08-021-7/+7
| | | | | | | | | | | Since few opengl contexts could be used at the same time, CARenderer could use wrong context to render the video frame. If the video surface contains an opengl context then need to use it as shared regardless of existing of current context. Change-Id: Ie7e87682c73c0fd341b40c05e3f3c4a70d563242 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* AVFoundation: Do not use AVFVideoRendererControl if no openglVaL Doroshchuk2018-06-261-3/+6
| | | | | | | | Removed code to use AVFVideoRendererControl to avoid link error. Task-number: QTBUG-69076 Change-Id: Iea87570fa6bb95541507d2ed84b6a1aa70984370 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* AVFoundation: Fix crash when no video capture deviceVaL Doroshchuk2018-06-252-1/+5
| | | | | | | | No need to configure anything if there is no video capture device. Task-number: QTBUG-65740 Change-Id: I8de7dced14b00ab3eba560f395d7e1a4a5de1682 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Add missing includesJake Petroules2018-02-121-0/+8
| | | | | | | | Messages are sent to NSView and UIView pointers in this file, which will generate unrecognized selector warnings (and eventually, errors). Change-Id: I4c4d65b555eb4cac8d73596ccb986b14d34ddf31 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Remove obsolete code pathsJake Petroules2018-02-121-12/+11
| | | | | Change-Id: I331f48cc6776b2fc6bb2efc2829555f8284eeff9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-203-13/+32
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/avfoundation/mediaplayer/avfmediaplayersession.h src/plugins/avfoundation/mediaplayer/avfmediaplayersession.mm Change-Id: Ic43fb2a805ed9f0f2ea48993d47859716f1f11b4
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-183-13/+33
| |\ | | | | | | | | | Change-Id: I7566f543ce11ff6cddc4d17e2c258a582f365b65
| | * AVFoundation: use observer for tracking durationJochen Seemann2018-01-082-13/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For getting the duration of a video, Apple advises to use AVPlayerItem.duration and tracking its duration changes with an observer. Task-number: QTBUG-49558 Change-Id: Ia2adc0d23deacd185f8c338f7f44948db2444beb Reviewed-by: Christian Stromme <christian.stromme@qt.io>
| | * avfoundation: resolve unused parameter warningsJochen Seemann2018-01-081-0/+2
| | | | | | | | | | | | | | | Change-Id: I49eb4e04dd6d63a17d31fd0981be18f3b88fcc39 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-061-1/+1
|\| | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I5acdc7e0bd3729b80522dfff0f388cf2507fb111
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-061-1/+1
| |\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I3d6e69f3f99b2f0a0e2c29ffdd02176e1f22304e