summaryrefslogtreecommitdiffstats
path: root/src/plugins/avfoundation/camera/avfmediaassetwriter.mm
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of plugins for MM backendsLars Knoll2021-01-221-514/+0
| | | | | | | | | | There's no need for having those in plugins and we can further remove abstractions and simplify our code if the code is directly compiled into Qt Multimedia. Change-Id: I5267a6a776375d99be8f0de4207f0288d963e620 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Adapt usage of QAtomicInt::store to storeRelaxedVal Doroshchuk2020-09-021-3/+3
| | | | | Change-Id: I6dd611adaf4fbabf17e925e0f23fbf977529dd2c Reviewed-by: Val Doroshchuk <valentyn.doroshchuk@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-06-281-1/+1
| | | | | | | | 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>
* AVFMediaAsserWriter: remove deprecated declrationTimur Pocheptsov2019-11-051-11/+22
| | | | | | | | | | 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>
* 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>
* avfoundation: fix compiler warnings regarding Objective-CJochen Seemann2019-01-041-0/+31
| | | | | | | warning: declaration of instance variables in the interface is deprecated [-Wobjc-interface-ivars] Change-Id: I3763d207d916bc4f0355a282b47769d5404ea087 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Remove deprecated QSysInfo APIs and dead code from macOS/iOS backendJake Petroules2016-09-231-1/+0
| | | | | | | 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.6' into 5.7Yoann Lopes2016-08-011-48/+66
|\ | | | | | | Change-Id: Ic29cb09048003f18ff86d4546cd547be715eaec8
| * AVFMediaAssetWriter - fix race conditionsTimur Pocheptsov2016-07-261-41/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-191-22/+31
| | | | | | | | | | | | | | | | | | | | | | 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.6' into 5.7Liang Qi2016-06-301-41/+28
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: fix orientation of recorded videos.Yoann Lopes2016-06-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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-091-19/+14
| | | | | | | | | | | | 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-091-1/+4
| | | | | | | | | | Change-Id: I5097a0450f5836e48a697249619a1822775f3ad8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| * AVFoundation: implement QVideoEncoderSettingsControl.Yoann Lopes2016-06-031-21/+6
| | | | | | | | | | | | Task-number: QTBUG-40338 Change-Id: Ic23dabaad94d7b293019460710ae1a097002e227 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-101-74/+62
|\| | | | | | | | | | | | | Conflicts: src/plugins/winrt/qwinrtcameracontrol.cpp Change-Id: I45d3042adf19577a72794610fa1c310cb22e26c4
| * AVFMediaAssetWriter - fix potential race condition(s)Timur Pocheptsov2016-04-211-74/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Updated license headersAntti Kokko2016-01-191-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I324f65c61171f36641472964d095d72e452afb3a Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Video asset writer for iOSTimur Pocheptsov2015-05-291-0/+474
AVFoundation on iOS lacks the ability to use AVCaptureVideoDataOutput and AVCaptureMovieFileOutput simultaneously. Right now viewfinder stops working as soon as we add movie file output. The only workaround we have now is to write video/audio 'maually' - creating asset writer and feeding it with audio/video samples. Change-Id: I33a63546783279c545f0433b5051287269825d3f Task-number: QTBUG-37655 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>