summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix crashes on Linuxwip/qt6Friedemann Kleint2021-05-262-6/+19
| | | | | | | Check for videosink and QPlatformMediaFormatInfo in QMediaFormat. Change-Id: I9603dae66fc4eb6a4433f43d2464e9f97916235f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix a deadlock when changing the video outputLars Knoll2021-05-262-0/+6
| | | | | | | | | | | | | | | | | Changing the videooutput and deleting the mediaplayer directly afterwards could lead to a deadlock, as the videosink was blocking on a pad and then calling a slot on the main thread using a blocking queued connection. If the main thread was changing the state of the gst pipeline at the same time, this could lead to a deadlock. Avoid it by pausing the pipeline before changing the video output. Change-Id: I0d0cbad0ab97a4eb83dd3c66c664c01de3b0ea90 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Code cleanup in qwindowsaudiooutput.*Lars Knoll2021-05-262-55/+55
| | | | | | | Use categorized logging and clean up the code. Change-Id: I5ff4efda9814567b4e042cb81977350ba1f90781 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Attempt to make the qcamerabackend test passLars Knoll2021-05-261-2/+3
| | | | | | | | | | | | | Blacklist things that are not yet implemented. Fix a nullptr dereference. There is still some race condition in testCameraStartParallel() that leads to occasional crashes. Change-Id: I35242bc88853870386d09fd6150d7bb8bd137674 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMediaEncoder: Fully qualify enumerations of QMediaEncoderBaseFriedemann Kleint2021-05-261-1/+1
| | | | | | | | Amends 520850e77332f6a341b40ad954de98c86c9f34b9. Task-number: PYSIDE-1570 Change-Id: Ic04fd8abf4ac6a843ceb47ce7e09ac1bf5a1228f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix crash in qsoundeffect autotest on WindowsLars Knoll2021-05-261-2/+0
| | | | | | | | | | These lines were added to fix an issue on gstreamer, that does not exist anymore. Remove them, as they cause recursion back into QWindowsAudioOutput that lead to accessing freed memory. Change-Id: Ibd3607d12ae8118f50538364a8b3f01112da8b73 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix crashes in the mediaplayerbackend autotest on windowsLars Knoll2021-05-264-23/+23
| | | | | | | | | Fix crashes on windows. There are still a couple of tests failing for now, those will get fixed in a separate change. Change-Id: Ifca7ae713929e33abbdf58a9952f79ed12333f31 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Stabilize the qaudioinput autotest on WindowsLars Knoll2021-05-261-5/+7
| | | | | | | | | | Unfortunately, the only way to get reliable results for the failing test is to increase the time spent sampling, so that the inherent jitter contributes less to the measured timings. Change-Id: Ie6bb97174d30b38a911519f73af0ae0881ed3536 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove SINGLETON word from QMediaDevices to enable on..Changed signalsPiotr Srebrny2021-05-261-1/+0
| | | | | Change-Id: I1f035cd8b33cd1daae8d288b14cb2f133b96b526 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Implement support for QCamera::Features on darwinDoris Verria2021-05-265-15/+23
| | | | | | | | Add FocusDistance and CustomFocusPoint to QCamera::Features. Set supported featurues upon camera change for AVFCamera. Change-Id: Ia2b89dce2770b3c0f0909fbe3df2fb10e05ee507 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix some logic errors in QWindowsAudioDeviceInfoLars Knoll2021-05-251-8/+15
| | | | | | | | | | With these changes, the qaudiodeviceinfo auto test passes on Windows. Change-Id: Ic139d0213a5ec797dfabd3bfde6b4d00decd0cc1 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix a bunch of compiler warnings on MSVCLars Knoll2021-05-253-3/+3
| | | | | | | Change-Id: I9065fba658c506cf2737d922f77f67e27f8ae634 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Some QCamera API cleanupsLars Knoll2021-05-258-54/+142
| | | | | | | | | | | | | | * Add QCamera::Features flags to determine supported features. * Rename (manual)shutterSpeed to (manual)ExposureTime, as digital cameras don't have a shutter anymore. Implement support for those feature flags on gstreamer, and add support for querying iso sensitivity, exposure time and setting a manual iso value. Change-Id: I776aa4bc11b02e4de4b02fe33aaccfb83e220ef7 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix the remaining failures for tst_qmediaplayerbackend in macOSDoris Verria2021-05-253-21/+14
| | | | | | | | Use QTimer to update playback position, fix a crash, and use QTRY_COMPARE when testing the player position. Change-Id: I44840eefb6f90ffc04084fe2743238400ee7a73e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix tst_qcamerabackend failures for macOS and iOSDoris Verria2021-05-231-1/+1
| | | | | | | | | | | | - Blacklist testCameraStartParallel on iOS as it doesn't seem to support two active capture sessions at the same time. - Fix some erroneous values. - Add some missing keys to the Info.plist. * Blacklist testCameraCaptureMetaData for macOS/iOS for now as it's not yet implemented. Change-Id: If889b7e4537c4f08ea810926420da59bd985e8e1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix use-after-free errorsLars Knoll2021-05-232-0/+2
| | | | | | | | | Make sure we tell the QVideoSink if it's source is being deleted. Change-Id: Iac7541d47167b56eb1567e656e9717b035010e33 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Fix the qaudioinput test failures on macOSLars Knoll2021-05-212-27/+51
| | | | | | | | | | | There was a race condition in the code as the audio samples can be read read the device from a separate thread. Also the buffer to write to needs to be opened. Change-Id: I89896a8e3258999d51e1415f75df979405306937 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Reduce the timeout for sync state changes in gstreamer to 1 secLars Knoll2021-05-211-2/+2
| | | | | | | | | | Waiting for 10 secs was ok for development, but we should really never have to wait that long. Change-Id: Ie10b22984948df6ccd7a1004ba10e50f415fe69e Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Correctly resolve the actual output file for QMediaEncoderLars Knoll2021-05-213-8/+7
| | | | | | | | | | | The gstreamer media encoder remembered the last location as something that could be re-used for the next encoding run. Fix that and ensure it'll pick a new file name if the requested output location is empty. Change-Id: I02077c8632fc106701e8c5081ee8b5e1361b18df Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Improve gstreamer capture pipelineLars Knoll2021-05-213-13/+20
| | | | | | | | | | | Avoid sync state changes that can not happen synchronously, leading to very slow timeouts on the pipeline. This makes the whole capture experience on Linux snappy. Change-Id: Ib49d4d3962c861515a883fe61505e0d3f3178428 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Improve V4L2 supportLars Knoll2021-05-212-26/+92
| | | | | | | | | | | Check for exposure times and adjustments and implement support for setting those if the camera supports them. Check for those in the camerabackend test. Change-Id: I860b2e7b94ef27e64a62e800cb6c05bfa6134250 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix more test failures for tst_qmediaplayerbackend on macOSDoris Verria2021-05-213-1/+16
| | | | | Change-Id: Ife42f4671cafa6423257665cefe6e01f5b5f072d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix camera not showing up on gstreamerLars Knoll2021-05-212-5/+8
| | | | | | | | | | Apparently, the gstreamer encodebin needs an encoding to be set up very early on. Fixes a regression after change 3e913c0814464bd9b09307d2e3d7c6763a1481b3. Change-Id: I7cb223a46ff2934dbffe30cc2a803eb52cb297a8 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clean up the videoOutput() APILars Knoll2021-05-2111-116/+120
| | | | | | | | | | | | | | | | | | | | The current API was rather messy, with multiple overloads. Change this and make the videoOutput a QObject * based property. To account for QVideoSink, add a videoSink()/setVideoSink() overload. This also helps identifying the correct sink in all cases. Add some code to protect against deletion of the videoOutput or videoSink from somewhere else. Adjust autotests and fix the qquickvideooutput autotests. With this change we are now passing all existing autotests again on Linux/gstreamer. Change-Id: I77b9863e88a7863abf27ab465fadd9c24f486502 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QSampleCache: Don't start the loader thread unless we need toLars Knoll2021-05-201-3/+2
| | | | | | | | | | | Starting the loader thread was causing some instability in the auto test for QSampleCache and leads to doing unnecessary work if the sample is already loaded. Change-Id: I31fef1b0e7348f0397999be113f8516e8985ade3 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix a crash on macOS when running the qquickvideooutput autotestLars Knoll2021-05-202-2/+1
| | | | | | | | Just requires a nullptr check. Change-Id: I0e5b0cd75079bbce94529835e6512d99aace08f0 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix iOS compilation after latest changes in camera APIDoris Verria2021-05-201-29/+27
| | | | | Change-Id: I3586d52e685dbf517aeb1b2b8a7a0a75446da31c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fixes for qaudiooutput on gstreamerLars Knoll2021-05-203-4/+17
| | | | | | | | | | | | Add a queue element into the pipeline to decouple things between input and output. Add ability to suspend/resume the QGstAppSrc. This finally makes the autotest pass consistently. Change-Id: Ib20d1f9e6932aa9459085ad46fe78fdd03749723 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge QPlatformCameraImageProcessing into QPlatformCameraLars Knoll2021-05-2031-1554/+494
| | | | | | | | | | | | Clean up the API while wer're at it, and rename manualWhiteBalance to colorTemperature. Simplify the backend API now that we only have white balance and color temperature in there. Change-Id: Ied8702b0c68a8fbea08d314d96c0261049db5b4d Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Correct maxlen computationPiotr Srebrny2021-05-201-1/+1
| | | | | Change-Id: I643d4d2933eee41beab49d8d8134897ccf6f0dd7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove contrast/brightness/hue/saturation properties from QCameraLars Knoll2021-05-196-211/+0
| | | | | | | | | | | Those methods are only supported on gstreamer (they don't exist on macOS/iOS). They are probably better implemented as a postprocessing effect anyway, so remove the from QCamera to keep the API smaller and more manageable. Change-Id: Ic203b3cac3384cdb0b6648366d47f6254f299197 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Move QPlatformCameraExposure API into QPlatformCameraLars Knoll2021-05-1929-2658/+1151
| | | | | | | | | | Clean up the internal API while we're at it and get rid of the multiplexing API. Instead have virtual methods for each property. Change-Id: I62cb178ff8360edbd11abb3fc5a0cfd7d8abdb2b Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Fix compilation on AndroidLars Knoll2021-05-191-3/+3
| | | | | | Change-Id: I77117c75b718ce46ac76f9b4fc77d059e3c33954 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Cleanup the QMediaEncoder backend architectureLars Knoll2021-05-1917-206/+177
| | | | | | | | | | | QPlatformMediaEncoder should not be a QObject, as with the other backend classes. Instead, the class now tracks some state to simplify the implementation of the platform dependent code and emits the signals for the frontend. Change-Id: Iec45638de4333cb9e88f89c448194b49a5de0e1e Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix test failures in tst_qaudioinput on macOSDoris Verria2021-05-191-0/+1
| | | | | | | | | | Skip recording wav files for not supported formats (only 16-bit sample sizes supported). Set the QAudioFormat's channel count to 1 for mono formats. Blacklist reset test case for now, signal emmission fails some times. Change-Id: Id26519ec313a8b2ab1e65ce08604d207dfea312e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix test failures for tst_qmediaplayerbackend on macOSDoris Verria2021-05-191-2/+4
| | | | | Change-Id: Icbd402e06941316c240e09bc409cafd68e14b459 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge the QPlatformCameraFocus class into QPlatformCameraLars Knoll2021-05-1829-1713/+583
| | | | | | | | | | Adjust the backend API while we're at it, so that the base class does some of the state management and signal emissions. Slight cleanups of the code in the different backends. Change-Id: Ie246da060260c5aeb6af54e7414deb0395b0cdf1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove QCamera::aperture() and friendsLars Knoll2021-05-188-124/+2
| | | | | | | | | None of the backends implemented support for it, and most cameras today don't allow you to change aperture anyway. Change-Id: Iad820c0a333e23e8a12d36ac2dd511b4ea5fc047 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Merge QCameraImageProcessing into QCameraLars Knoll2021-05-1819-721/+349
| | | | | | | | | | | At the same time remove the colorFilter property. Color filters are at most a post-processing effect and should not be part of QCamera itself. The support for the filters was in any case missing pretty much everywhere (except gst-photography, which is not supported by most cameras today). Change-Id: I59306cc75470b11490feeb910c26a414d796f9f1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Merge QCameraExposure into QCameraLars Knoll2021-05-1821-1057/+828
| | | | | | | As per API review, let's only have one class for QCamera. Change-Id: I663e238e93ffd83708821e46f8f154c1fdc07731 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Merge the QCameraFocus API into QCameraLars Knoll2021-05-1822-647/+397
| | | | | | | | | After API review, we decided that one large API in QCamera is easier than having separate sub-objects that are only trying to structure the API. Change-Id: I5f820a580db1ddb3f47e11b88ca86215997f96ce Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix a memory leak in gstreamerLars Knoll2021-05-181-1/+7
| | | | | | Change-Id: I663c1f1de4fe6ca25f4f6aa353084701d2c9751d Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix a crash in QGstAppSrc when using pull modeLars Knoll2021-05-181-6/+6
| | | | | | | | | In this case m_stream is a nullptr, make sure we never access it. Change-Id: I095d18fc99a60bc9b5cd9fe1bc33b7879f109c8a Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Fix some code that was not thread safeLars Knoll2021-05-182-18/+35
| | | | | | | | | | | new_sample() could get called from a different thread, but would write into the object living on the main thread without any protection. Fix that by posting the GstSample to the main thread and processing it there. Change-Id: I6e8b8cb84c956794aac3ac00e89178d03bbf3f92 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Fix a crash in the gstreamer audio outputLars Knoll2021-05-182-26/+37
| | | | | | | | | | | Closing the audio output would delete the pipeline, and would lead to deleting the GstAppSrc from within QGstAppSrc::pushData(). Speed up the qsoundeffect autotest (this uncovered the issue). Change-Id: I3c5843854f5a74d563eb271df553c8a1a5854f63 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc improvementsLars Knoll2021-05-1825-852/+444
| | | | | | | | | | | | | | | | | | | Try to add at least a short class overview to every C++ class and document most properties there. Some API cleanups in QMediaRecorder. Some rough cleanups in the overview documentation, removing mentions of features and APIs that do not exist anymore and adjust the ones that have changed. Updated the changes.qdoc file to now reflect the changes from Qt 5 to Qt 6, not from Qt 4 to Qt 5 anymore. Change-Id: I42f4994d3af4d35ab5e51afe351afa653964bea8 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Android: Use public Jni APIs as possibleAssam Boudjelthia2021-05-1825-621/+477
| | | | | | | | | | | | * Update usage of JNI APIs (QJniObject, QJniEnvironment) * Avoid usage of QtAndroidPrivate as possible by using QNativeInterface Some instances still use native JNI APIs, because they don't yet have an alternative with the Qt public APIs, those can be fixed later. Task-number: QTBUG-93800 Change-Id: Iae0f18ef450c11a0f93133d948e78dc013c7ff3b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Windows: Fix the suffix of video filesAndre de la Rocha2021-05-171-1/+1
| | | | | | | Currently, only video is supported. Change-Id: Ib6a8f84fcddc88b0c37f223d1815a6cba44a89a3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Windows: Fix slowdown while recording videoAndre de la Rocha2021-05-172-1/+26
| | | | | | | | Emitting the durationChanged() signal from the OnReadSample callback was causing a major slowdown while recording video. Change-Id: Ie1e26507b4381ed8b7da9f43914fc627a0c0b063 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* gstreamer: fix compilation without gstreamer_glSamuli Piippo2021-05-171-1/+4
| | | | | | | Add ifdef guards to compile correctly when gstreamer_gl is not available. Change-Id: I483081db018e45068b720f41c3a418d943891873 Reviewed-by: Lars Knoll <lars.knoll@qt.io>