summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation
Commit message (Collapse)AuthorAgeFilesLines
* AVFoundation: Use 90 for the front facing camera's orientationAndy Shaw2017-12-121-1/+1
| | | | | | | | | | | | Since the information is not available as to what the orientation is from the AVFoundation API then we need to rely on common sense. Since the back facing camera is 270, then it stands to reason that the front one would be 90. This has been tested on macOS and iOS and all three cameras behave correctly. Task-number: QTBUG-37955 Change-Id: I1ab079cb5d4337948541e58321df51efbadf3e39 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* AVFoundation: Make AVFImageCaptureControl work without a previewTimur Pocheptsov2017-06-272-3/+5
| | | | | | | | | | | | We only need to wait for a new viewfinder frame if we have a videorenderer control. If there's no videorender control, then there's no preview set and we can therefore just save the capture image immediately. Task-number: QTBUG-60329 Change-Id: I9ba34919f7cd82258482507c65db6367e330e231 Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* AVFImageCaptureControl - do not block the capture's callbackTimur Pocheptsov2017-06-262-7/+23
| | | | | | | | | | | | | | | | | | It's possible to initiate an asynchronous image capture (via AVCaptureStillImageOutput object) and immediately stop AVCaptureSession. In this case image capture's callback can potentially block forever, waiting for a semaphore: (if) no new frames arrive after 'stop' (on whatever thread AVFoundation/GDC chooses), this semaphore is never released. To avoid this we try to acquire a semaphore with a (reasonable) timeout and report an error in case of failure. To make sure we are not leaking a semaphore and not creating a danling pointer, we use a QSharedPointer now. Task-number: QTBUG-61367 Change-Id: I208cd463f843bc807b53b23ac9651aab0382775a Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Emit the StoppedState change after the file has finished writingAndy Shaw2017-05-232-6/+12
| | | | | | | | | | | Where possible, we should be emitting the stateChanged() signal to StoppedState when we know the file is no longer being written to. The finializing status can be used to indicate it is finishing and when it is actually finished then StoppedState should be used. Task-number: QTBUG-50588 Change-Id: Ie3ac1c5cd00a6a36978e72b5485622e3302054ce Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* AVF: Fix mediaplayer state and status issuesChristian Strømme2017-04-263-52/+90
| | | | | | | | | This fixes the issues that were causing the whole qmediaplayerbackend test to be blacklisted on macOS. Task-number: QTBUG-46368 Change-Id: I59a35dd50a9c07e4e4382c5facb391f5c8a27ee7 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-102-4/+0
|\ | | | | | | | | | | | | Conflicts: src/plugins/gstreamer/camerabin/camerabincontainer.h Change-Id: I4942d41d69112335fe0c994002f1b32ef3aad051
| * Use QT_CONFIG macro to check for featuresLars Knoll2017-02-272-4/+0
| | | | | | | | | | | | | | And remove many custom defines. Change-Id: I658cc8430d1d99ed3c0aafe03a77adce76621a29 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-124-4/+7
|\| | | | | | | | | | | | | Conflicts: src/plugins/gstreamer/mediacapture/qgstreameraudioencode.cpp Change-Id: I7c30c2d13fdd07ee07e4449d5d3e256e988d3793
| * Add proper global headers for QtMultimediaLars Knoll2016-11-232-2/+2
| | | | | | | | | | | | | | And deprecate the old qtmultimediadefs.h Change-Id: I2d4164f3a51d8e5d1813413b4f6691a721386fdf Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
| * Move qtmultimedia over to the new config systemLars Knoll2016-11-142-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Use the new configuration system to define external libraries, configure tests and features. Don't use pkg-config outside of the configuration step. And move all command line options over from qtbase, so that we can remove them from there in a second step. Change-Id: I1aa4b557a6aee17eeceb00602005a2d28b426a26 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-10-122-53/+59
|\| | | | | | | Change-Id: I126bc73db5b5d9b6c26cb9ff5da7ed13a16b378b
| * Merge remote-tracking branch 'origin/5.7' into 5.8Yoann Lopes2016-10-112-53/+59
| |\ | | | | | | | | | Change-Id: I8cfa9cb233675bb7ff842118d96ec8ac0b97964f
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-042-53/+59
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/integration/qaudiooutput/tst_qaudiooutput.cpp Change-Id: I4a30fc030c25e7b8da3eb9f386c4a5fa468df141
| | | * AVFoundation: fix metadata controlYoann Lopes2016-09-272-53/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correctly emit metaDataAvailableChanged and metaDataChanged signals. Task-number: QTBUG-46368 Change-Id: Ic79acd519b47f4d864fa335c8f75758fe9185c39 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | | | Remove deprecated QSysInfo APIs and dead code from macOS/iOS backendJake Petroules2016-09-2313-389/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Deployment targets are currently macOS 10.9 and iOS 7.0. Change-Id: I500a95c00eb3be6e693e38f0f2205941f7bc9601 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* | | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-09-212-3/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/multimedia/multimedia.cpp Change-Id: I38899391ec8d2fcec6f2d46514286759f7a27629
| * | | Merge remote-tracking branch 'origin/5.7' into 5.8Yoann Lopes2016-09-012-3/+19
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/multimedia/audio/qaudiosystemplugin.cpp src/plugins/directshow/helpers/directshowobject.cpp src/plugins/directshow/player/directshowiosource.cpp src/plugins/directshow/player/directshowiosource.h Change-Id: I0e4632c7705128f81429ddbcb0d4abbc04858a8b
| | * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-272-3/+19
| | |\| | | | | | | | | | | | | Change-Id: I639d42e78a2b85e939c9f8e9dd5da70cdc058857
| | | * AVFoundation: fix memory leakYoann Lopes2016-08-221-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using 'self' in a block maintains a strong reference to it, the previous code would never release that reference and therefore leak the AVFMediaPlayerSessionObserver object when the session was deleted. Captured variables used in the relevant block are now marked with '__block' to make sure no strong references are maintained. We now also make sure the session still exist when that callback block is called. Change-Id: I847b524d8692559fe5884517abb5b9cc7696b4fd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| | | * Fix instance method not found warningJake Petroules2016-08-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NSView/UIView were only forward declared here which led to warnings when calling methods on instances of them. Change-Id: Ic2b391bb0ed8d45306dc16e2a807ce7fcae5015e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* | | | Fix AVFoundation camera plugin linking as shared libraryJake Petroules2016-08-231-2/+5
|/ / / | | | | | | | | | | | | | | | | | | Static linking was hiding the additional framework dependencies. Change-Id: I4e6b8f4a8adf6af073bca90d63b04199844fad78 Reviewed-by: Lorn Potter <lorn.potter@canonical.com>
* | | Adjust to qtConfig() changes in qtbaseLars Knoll2016-08-191-2/+2
| | | | | | | | | | | | | | | | | | Change-Id: I26d80ece18abf882338de5ce0258469ed103a0eb Reviewed-by: Yoann Lopes <yoann.lopes@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-177-84/+129
|\| | | | | | | | | | | Change-Id: Ib8d05d6e21c7beb19f618cd1edc52d248b1e43b8
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-131-6/+15
| |\| | | | | | | | | | Change-Id: I3204cdf695f4b47730a88a7c41fc7a6de967b161
| | * AVFoundation: fix mediaStatus and state changesYoann Lopes2016-08-121-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When both state and mediaStatus are updated at the same time, make sure both variables are updated before emitting the corresponding signals. Also, always emit mediaStatusChanged() signals before stateChanged() to make sure mediaStatus changes are not cancelled by some action resulting from a state change. Task-number: QTBUG-49578 Change-Id: I0caea8261120595227834dbac7fed286d125bcab Reviewed-by: Christian Stromme <christian.stromme@qt.io>
| * | Replaced old license headers with new and correct onesJani Heikkinen2016-08-126-78/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced - header.LGPL3 with header.LGPL - header.LGPL21 with header.LGPL Change-Id: If11396da6ff12e9122281c17fc4354b05a554ee5 Reviewed-by: Ruslan Baratov <ruslan_baratov@yahoo.com> Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-024-77/+84
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/integration/qsoundeffect/BLACKLIST Change-Id: Icd2edd4410a4ee914d489634d26b262c0c146bf4
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Yoann Lopes2016-08-014-77/+84
| |\| | | | | | | | | | Change-Id: Ic29cb09048003f18ff86d4546cd547be715eaec8
| | * AVFMediaAssetWriter - fix race conditionsTimur Pocheptsov2016-07-264-65/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apple recommends starting/setting up a session (AVCaptureSession) on a special queue and in the past we did this on the writer's queue. Unfortunately, we also can access the same session from a different thread and this results in race conditions and different weird crashes, for example, we're calling start/stopRunning from the writer's queue, while the session is being configured (in between beginConfiguration/commitConfiguration on the recorder control's thread). So we have to limit access to the session by the control's thread. Apple docs say we have to ensure all appendSampleBuffer calls done _before_ finishWriting. We ensure this by dispatching_sync an empty block on the writer's queue after store-release of m_state. We also do the same with video queue to ensure it does not try to access viewfinder's data after stop/abort executed. All these changes also make lock/mutex unneeded. Task-number: QTBUG-54890 Change-Id: I38e86c879b6b62306bdfbeade65405d6ac3be9f3 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
| | * AVFMediaAssetWriter - fix atomics useTimur Pocheptsov2016-07-192-27/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. No need in two different atomics (m_stopped/m_aborted) - the single one 'm_state' with states (Idle/Active/Aborted) should be enough. 2. QAtomicInt::load/store actually have relaxed memory ordering semantics, (not like std::atomic with sequential ordering as the default one) which is not always appropriate - replace with loadAquire/storeRelease instead. Change-Id: I4ce8c9ca7556de3d2c7e369b8a05276b2870460c Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-07-2124-297/+1411
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/directshow/player/directshowiosource.cpp One side disintermediated filling a vector; the other reduced it to one entry. src/plugins/directshow/player/directshowiosource.h One side renamed a member, the other added another adjacent to it. src/plugins/pulseaudio/qpulseaudioengine.h One side added a header, the other replaced the next with a different header. Change-Id: I3a031975f5af43ca39cca571f215c612f640b7d6
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-3024-297/+1411
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blacklisted a few functions in tst_QAudioInput. Conflicts: .qmake.conf src/plugins/avfoundation/camera/avfcameracontrol.mm src/plugins/avfoundation/camera/avfcameraservice.h src/plugins/avfoundation/camera/avfcameraservice.mm src/plugins/avfoundation/camera/avfcamerasession.h src/plugins/avfoundation/camera/avfcamerasession.mm src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.h src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm src/plugins/avfoundation/camera/avfimagecapturecontrol.mm src/plugins/avfoundation/camera/avfimageencodercontrol.mm src/plugins/avfoundation/camera/avfmediarecordercontrol.h src/plugins/avfoundation/camera/avfmediarecordercontrol.mm tests/auto/integration/qaudioinput/BLACKLIST Task-number: QTBUG-54459 Task-number: QTBUG-49736 Change-Id: I3a1fe8cef50b44d5c2785aaf4cf69fe3f16728e6
| | * AVFoundation: improve changing the capture device format.Yoann Lopes2016-06-145-43/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure the device format is always set in the same way. We don't actually set the format anymore when it's the same as the current one. We also make sure the frame rate is preserved. Change-Id: I1c68239bc99d9c3cef920effcf47fc253220c26f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| | * AVFoundation: re-apply viewfinder settings on mode changes.Yoann Lopes2016-06-135-10/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since the active viewfinder resolution can be overridden by the image and video capture resolutions, we need to re-evaluate the viewfinder settings whenever the capture mode changes. Change-Id: Ibdb7a070585cf67ebb2fcfb95ccbdd105f5f41cf Reviewed-by: Christian Stromme <christian.stromme@qt.io>
| | * AVFoundation: fix orientation of recorded videos.Yoann Lopes2016-06-134-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure the video is recorded in the same orientation as the device. That means the top of the video matches the physical side of the device which is on top when starting recording. This patch makes sure the behavior is the same as on Android. In a future version, we should have an API to pick the desired orientation of the recorded video. Change-Id: Ia8bbfe621a0e54de3cb6bfe0a520f37e8a932539 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
| | * AVFoundation: implement QAudioEncoderSettings.Yoann Lopes2016-06-0910-23/+346
| | | | | | | | | | | | | | | | | | Change-Id: I24d3da1417142bc80bc6b6c1c8124c246afe03db Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
| | * AVFoundation: implement QMediaContainerControl.Yoann Lopes2016-06-098-5/+193
| | | | | | | | | | | | | | | Change-Id: I5097a0450f5836e48a697249619a1822775f3ad8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| | * AVFoundation: correctly set default frame rate on OSX.Yoann Lopes2016-06-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | On OSX, it's not possible to reset the frame rate to the default value by passing kCMTimeInvalid, so just set the first value from the supported frame rates. Change-Id: I984101c2a95e13053228e56f19b353e716eb2b67 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
| | * AVFoundation: implement QVideoEncoderSettingsControl.Yoann Lopes2016-06-0316-258/+781
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-40338 Change-Id: Ic23dabaad94d7b293019460710ae1a097002e227 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-137-113/+86
|\| | | | | | | | | | | Change-Id: I773db005bbdc511169917ee35eb5b517e898926b
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-107-113/+86
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/winrt/qwinrtcameracontrol.cpp Change-Id: I45d3042adf19577a72794610fa1c310cb22e26c4
| | * Fix unused variable warningChristian Stromme2016-04-261-2/+5
| | | | | | | | | | | | | | | | | | | | | - warning: unused variable 'm_renderer' [-Wunused-variable] Change-Id: Ie7d8ebe35a3ab0beb66cda3448595ed952f7dea4 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
| | * AVFMediaAssetWriter - fix potential race condition(s)Timur Pocheptsov2016-04-214-109/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. m_writerQueue is now shared by recorder control and asset writer to ensure it lives long enough. 2. m_delegate->method() calls from async block can be dangerous, since by the time this block is actually executed, delegate can be deleted already. This fix uses Q_INVOKABLE and invokeMethod with QueuedConnection instead. 3. -finishWritingWithCompletionHandler: is async and when the block finally gets executed, lock and 'if aborted' test are still needed. 4. Simplify the logic and reduce locking. Change-Id: If23daf2fe22043244033427a7f6517a0fe3f23d1 Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
| | * AVFFoundation - fix a compilation error (iOS, XCode 7.3)Timur Pocheptsov2016-04-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | __weak previously was a simple noop, but now it ends up in a compilation error in non-ARC'ed source code ('declaration uses __weak, but ARC is disabled'). Task-number: QTBUG-52671 Change-Id: I574519f892ba1d5f71488c5cc26423d04d5e02cf Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
| | * AVFoundation: fix switching to still image capture mode.Yoann Lopes2016-04-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | It would reset the active format on the capture device. The patch prevents that. Change-Id: I97c192c064bf3c6ed4ba1f8d78768196927819a7 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
| | * AVFoundation: return correct viewfinder settings.Yoann Lopes2016-04-131-1/+6
| | | | | | | | | | | | | | | | | | | | | When the camera is unloaded, return the requested settings. Change-Id: If39e158cd8d0fd8d4bbd7cf6cd48226cdefc1272 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* | | Add YUV 4:2:2 8Bit to supported formats of OS X camera plugin.Samuel Gaist2016-04-291-0/+10
|/ / | | | | | | | | | | | | | | | | | | | | Now that QtQuick handles YUV 4:2:2 8Bit video formats, let the input use them. [ChangeLog][OS X][Input format] Added YUV 4:2:2 8 bit to supported camera video formats. Change-Id: Ib9b927a530232111a1d1139689b4cd2adf34da3f Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-072-11/+11
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/avfoundation/mediaplayer/mediaplayer.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.pro Change-Id: I5742596230dc510ba2a09eba624429bb67179194
| * standardize statement order in project files a bitOswald Buddenhagen2016-02-252-2/+3
| | | | | | | | | | Change-Id: I96bbe1343eedbad6b48579d700bbb6b5b80d69f1 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * remove redundant statements from project filesOswald Buddenhagen2016-02-251-1/+0
| | | | | | | | | | | | | | | | | | | | - TARGET is unnecessary if it matches the project file's basename - CONFIG+=no_private_qt_headers_warning is added by qt_build_config.prf - load(qt_build_config) is done by .qmake.conf Change-Id: I3eb45a758dfee34be3c78fc13d996780741c95e9 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>