summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Rename conflicting targetAlexandru Croitor2021-06-211-1/+1
| | | | | | | | | | | A test of the same name exists in qt3d. Fixes: QTBUG-94609 Change-Id: I496c658e7705e0f428f8eee2ada5f639dcbfd86c Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 49f8de39c1604c51e42fd6522377a608f52cb5c0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix qmediarecorder autotestLars Knoll2021-06-171-1/+1
| | | | | | | | Regression after change 00f89c1ab92ffb9c2c61bcb5e89b813214f45ac7 Change-Id: I4de35b3abac582b37956e7fec94d562ee274e847 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix compiler warning about unused variableLars Knoll2021-06-171-1/+1
| | | | | | Change-Id: I7379a4addd1cb1f1f13befb44a513423ddd05f95 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix the QAudioDecoder APILars Knoll2021-06-173-259/+65
| | | | | | | | | | | | | | | | Adjust API after code review. Remove the audioFormat property. QAudioDecoder will now always decode to the native format used in the encoded file. QAudioBuffer will have the correct format set, and it's up to the app to handle this correctly. Remove state() and replace by isDecoding(). Change-Id: I6f2ac375d98b2d7c36aebaa729599f78699b1c7b Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Rename QCameraImageCapture to QImageCaptureLars Knoll2021-06-1711-87/+87
| | | | | | | | Fixup the backend class and file names while we're at it. Change-Id: Ib0928dfebb6f127b7a43683b2907420c95af6599 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove QCamera::StatusLars Knoll2021-06-174-56/+9
| | | | | | | | The enum is not really useful. Instead isActive() and error() provide all the information required. Change-Id: I2856c833745e79f74bb2a9d95f0ef65eafd24413 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make setOutputLocation behavior consistent across supported platformsPiotr Srebrny2021-06-161-9/+2
| | | | | | | | | | | | | | | outputLocation is always set regardless of whether is it valid or not, unless platform does not support encoding. If the output location is not writable an errorOccured signal is emitted. QNX and Android stored outputLocation in the capture session object. This has been removed and instead a recording(QUrl location) call is used to provide location information for the recording session. Reset m_mediaRecorder after deleting in QAndroidCaptureSession::start Change-Id: Ib1048410945aaf36532eb8606a4f9eb47460daf7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix media codecs resolver when switching between audio and audio/videoPiotr Srebrny2021-06-163-0/+76
| | | | | | | | | | | | Removing isSupported condition as it is true when audio only format is selected while flags indicate that video codec is required. The same occurs when going from audio/video format to audio format. Reset format if it does not support video while required. Change-Id: I2c056d935351cfc7a471a7376fa51da320cdb353 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* QMediaPlayer API cleanupsLars Knoll2021-06-162-3/+3
| | | | | | | | | | Remove the autoPlay property, and split up the setSource() method into setSource(QUrl) and setSourceDevice(QIODevice) for more clarity. Change-Id: I3e973fb5b6aa50f192af898f1b07769a201c6845 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Rename shutterSpeed() to exposureTime()Lars Knoll2021-06-163-18/+18
| | | | | | | | | | That's really what it is, and how all other frameworks name it. Shutter speed is a name that really only works for old analog cameras. Change-Id: I52fc5619dd9a853cabd3abef2ddec2e2b8cba119 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Rename QCamera::cameraInfo to cameraDeviceLars Knoll2021-06-163-24/+24
| | | | | | | | And take the opportunity to clean up variable naming as well. Change-Id: I510cc8295b8d35554534a3c2ac9d83bf6f5a9d65 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Get rid of QAudio::RoleLars Knoll2021-06-162-48/+0
| | | | | | | | | This was only ever implemented to some extent for Android. Remove for now, as it's not really an important feature and can't be implemented properly on many of our platforms. Change-Id: Idc4d21c857380088ca6d10d59a0e05d192899534 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of QMediaEncoderSettingsLars Knoll2021-06-162-597/+105
| | | | | | | | | | As per API review, fold this class into QMediaRecorder as that's the only place where it is being used. This removes one level of indirection from the API and also makes it possible to use from QML. Change-Id: Id9157df04512382cce28e89b082433ec67d36b28 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename QMediaEncoder to QMediaRecorderLars Knoll2021-06-168-125/+119
| | | | | | | | As per API review, this is the better name. Since we removed the old QMediaRecorder class, the name is free as well. Change-Id: I1ec9af3876af8b6957e20c13f9e225bf1e5032d5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Kill QMediaEncoderBaseLars Knoll2021-06-162-14/+14
| | | | | | | | | | The class was only needed because of QMediaRecorder. Now that that class is gone, we can move the enums into QMediaEncoder. Also rename the State enum to RecorderState as per API review. Change-Id: I2e0811e2c29f922265ac5a719226b647236e52b9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Kill the current QMediaRecorder classLars Knoll2021-06-162-5/+5
| | | | | | | | The class provides only minimal convenience over using QMediaCaptureSession directly. Change-Id: I706bb6821fbf8a7cc79a86819001ee1fd669733e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of QImageEncoderSettingsLars Knoll2021-06-162-101/+4
| | | | | | | | | | | Move the API for setting file format, quality and resolution into QCameraImageCapture and get rid of the separate QImageEncoderSettings class. This simplifies our API and makes the QML integration easier. Change-Id: Iaac2a6e3ff50c7379c44d70001db7c52d8cb0c90 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Move the QAudio::Mode enum inside QAudioDeviceLars Knoll2021-06-161-20/+1
| | | | | | | | QAudioDevice is the only class using that enum, so it makes more sense for the enum to live there. Change-Id: I11e6768d1114d63e68d1956f7d6e62786524c291 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Implement QPlatformAudioDecoder for macOS/iOSDoris Verria2021-06-141-2/+5
| | | | | Change-Id: I43fa28f43f6717ea408d677b021db7a90ec1df1d Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Add test case for invalid source file/device to audiodecoder testDoris Verria2021-06-141-0/+94
| | | | | | | | | Check that the appropriate errors are set on the decoder when media sources can not be resolved. Change-Id: Ie9bcc1298bf561a4ee4a90e4d6d74869541a1c6e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QAudioOutput in QMediaPlayerLars Knoll2021-06-118-110/+212
| | | | | | | | | | | | | | Adjust QMediaPlayer to the new audio output architecture. One now needs to explicitly add a QAudioOutput to the media player to get audio playback. While this requires two more lines of code to set up the media player, it does make the API consistent between audio and video and also consistent with what we have in QMediaCaptureSession. Adjusted auto tests where required and ported all platforms. Change-Id: I247e915e4862dee6d6bce367b83664b1d1d69726 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QAudioInput in QMediaCaptureSessionLars Knoll2021-06-111-33/+3
| | | | | | | | | | | | | | | | | | | | | | Convert the audioInput property to use a pointer to a QAudioInput in line with the API changes planned. Not setting up a QAudioInput implies that you do not get any audio. Move the volume and muted properties over to QAudioInput, they should really not be part of the QMediaCaptureSession. Adjust the platform API accordingly and adjust implementations. The Android adaptation is incomplete, but that was the case before as well. This needs some refactoring to properly support setting devices and adjusting volume/muted. Dynamically adjusting to changes of the audio input device is not yet implemented on Windows. Change-Id: I2fb63b9e57908d6dc02130b8d534ef7ac1a1ac85 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove the CaptureMode argument from the createCaptureSession() methodLars Knoll2021-06-082-3/+2
| | | | | | | | | The argument has not been used since quite a while. Change-Id: If62ee3ad7f93b49d1a8c19fd8fbd084f67c43033 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>
* Rename QCameraInfo/QAudioDeviceInfo to QCamera/AudioDeviceLars Knoll2021-06-0818-135/+135
| | | | | | | | | Those classes represent the physical device and it's properties, thus that name fits best. Change-Id: I0f45fc875ae6110452c1f2fb17f32adbe5155d01 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename tst_qcamera CMake targetUlf Hermann2021-06-041-1/+1
| | | | | | | It clashes with a target of equal name in qt3d. Change-Id: I6078c78b9557a45aa1888c2c379c1a51e3f06d57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rename QAudioOutput to QAudioSinkLars Knoll2021-06-047-58/+55
| | | | | Change-Id: If852737b85d3ca95d55a852a3c50f80a5a09c61e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename QAudioInput to QAudioSourceLars Knoll2021-06-046-57/+55
| | | | | | | | | | | | | | | | | | | | | | | | | The renaming is a part of some changes coming from an API review that tries to solve the problem of not having API symmetry between QCameraInfo/QCamera and QAudioDeviceInfo where QAudioDevice is missing (so you can't select a nullptr as the input/output device to disable it). One issue is that QAudioInput/QAudioOutput are there for reading and writing low level PCM data from an audio device. They as such are not quite suitable as classes to use together with QMediaPlayer or QMediaCaptureSession, as they allow direct writing of data bypassing the player or capture pipeline. To solve this, we renamve those classes to QAudioSource/Sink (making it a bit more symmetric with QVideoSink). That opens up our API space for a QAudioDevice class avoiding names that feel like they are doing the same thing. The patch also renames things on the backend side to keep API and implementation consistent. Change-Id: I9f6b4892d3eee4e252cb3782e681b0c3824f27e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove the inheritance between QMediaEncoderSettings and QMediaFormatLars Knoll2021-06-041-36/+36
| | | | | | | | | | Inheriting from value classes is not a good principle for our APIs, and it doesn't work for the QML side neither. Instead, simply give QMediaEncoderSettings a QMediaFormat member. Change-Id: Ib2cd8b04c09e89f8f57a91898ce987c199d66c75 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add support for still image capture on WindowsAndré de la Rocha2021-06-031-6/+0
| | | | | | Change-Id: I08356a59d2d0b02dd4074b370a5230015bc7b62b Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix a test failure and an intermittent crash on WindowsAndré de la Rocha2021-05-311-3/+0
| | | | | | | | | In the camera backend. Change-Id: I7bb11b81a8c370772a7635c2a8ffc4097d2946a6 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix issues with namespaced buildLars Knoll2021-05-286-15/+31
| | | | | | | | Change-Id: I34c0492765dcc348c8766b53b389884535d00c54 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> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Remove usage of old compatibility CMake APIAlexandru Croitor2021-05-2731-38/+38
| | | | | | Task-number: QTBUG-86815 Change-Id: I576c52bfa41db5b52defd39615d944a05953b540 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Attempt to make the qcamerabackend test passLars Knoll2021-05-262-0/+11
| | | | | | | | | | | | | 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>
* Stabilize the qaudioinput autotest on WindowsLars Knoll2021-05-261-4/+4
| | | | | | | | | | 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>
* Implement support for QCamera::Features on darwinDoris Verria2021-05-261-1/+0
| | | | | | | | 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>
* Some smaller test fixesDoris Verria2021-05-262-1/+2
| | | | | Change-Id: If35ad376f2ca96e740117c71d0e5cc950da9302c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix some logic errors in QWindowsAudioDeviceInfoLars Knoll2021-05-251-1/+1
| | | | | | | | | | 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-252-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-253-23/+26
| | | | | | | | | | | | | | * 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-251-2/+2
| | | | | | | | 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-233-18/+45
| | | | | | | | | | | | - 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 the qaudioinput test failures on macOSLars Knoll2021-05-212-4/+5
| | | | | | | | | | | 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>
* Make the QAudioFormat autotest pass on macOSLars Knoll2021-05-211-2/+5
| | | | | | | | | | QWaveDecoder can only write Int16 based formats, so skip the preferred format if it is not Int16 based (macOS seems to prefer Float). Also ensure that all formats are valid by giving them a valid channel count. Change-Id: I0cf4c040eb28b4dbf1faebd1293fe035c8144dc6 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Correctly resolve the actual output file for QMediaEncoderLars Knoll2021-05-211-24/+26
| | | | | | | | | | | 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 V4L2 supportLars Knoll2021-05-211-6/+22
| | | | | | | | | | | 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>
* Clean up the videoOutput() APILars Knoll2021-05-218-453/+126
| | | | | | | | | | | | | | | | | | | | 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>
* Fixes for qaudiooutput on gstreamerLars Knoll2021-05-201-1/+0
| | | | | | | | | | | | 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-207-136/+42
| | | | | | | | | | | | 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>
* Remove contrast/brightness/hue/saturation properties from QCameraLars Knoll2021-05-192-49/+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-197-285/+98
| | | | | | | | | | 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>