summaryrefslogtreecommitdiffstats
path: root/src/plugins/gstreamer/camerabin/camerabinsession.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into ↵v5.15.8-lts-lgplTarja Sundqvist2022-11-111-0/+9
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: Ibcb201720a2949a9c57d8bafc83afcaf5d8e20e5
| * Fix a memory leak in the camerabinsessionLars Knoll2021-11-301-0/+9
| | | | | | | | | | | | | | | | | | | | Properly unref the video and camera source objects when changing the input device. Fixes: QTBUG-93762 Change-Id: Ibaf08978b6915faa668ef0ab54b3bc0903daafad Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-251-20/+20
|/ | | | | | | | | | | This reverts commit 80d46e3a5f64ff2456c40bdba63b6d5c69a32cdd. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I5c64ffa120f916711e5cf01c828774f8456dec06 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* Update commercial license headersTarja Sundqvist2021-01-271-20/+20
| | | | | | | | | | | | | | | | Updated header.COMM to files in tqtc-qtmultimedia. Examples, tests or documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reaso for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4171 Change-Id: I86ebf7c3653b55983cefff246c0cb019cbcda8c4 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* CameraBin: unset GValues after finish using themRatchanan Srirattanamet2020-09-111-0/+3
| | | | | | | | | | | GValue can contain allocated memory. Not unsetting it can cause memory leak. This patch adds g_value_unset() calls to various places that miss ones. Change-Id: I78e0f8f6c558ada0e7828c11094132359c579c2a Reviewed-by: Val Doroshchuk <valentyn.doroshchuk@qt.io> (cherry picked from commit 24ac478e50dab189b53c749b34971a807aa6da4d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* GStreamer: Allow using different resolution for capture and viewfinderVaL Doroshchuk2020-03-031-4/+6
| | | | | | | | | | Currently viewfinder resolution is overridden by image resolution. Fixed to keep it separate. Note, it might be not fully supported by gst camera implementation. Change-Id: Ia04c7819da1410f41aee458d347408f94053170b Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Gstreamer: also remove features when simplifying capsRatchanan Srirattanamet2019-10-021-0/+6
| | | | | | | | | | | | | | | | | | Some element can return caps with same resolution/framerate but different features. gst_simplify_caps() won't de-duplicate this, resulting in duplicated entries for the same resolution/framerate. This commit add calls to also remove features from the caps in addition to setting name to video/x-raw. The GST_CHECK_VERSION macro is added to maintain compatibility with earlier version of Gstreamer without GstCapsFeatures. [ChangeLog][CameraBin] Fixed duplicated entries in supported resolution/ framerate if the underlying element uses caps' features. Change-Id: I15101899eb0369925013ccc1d925afb890a01205 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* CameraBin: do fetch viewfinder settings even after LoadedStatusRatchanan Srirattanamet2019-09-271-1/+1
| | | | | | | | | | | | | | | | Commit 84d0d87699a2a92b3207beae30a52f25e23acb65 (CameraBin: Postpone fetching supported viewfinder settings) checks if the camera is in LoadedStatus before fetching supported viewfinder settings. However, if viewfinder settings is never requested or not (yet) available during LoadedStatus, it won't try to fetch it at e.g. ActiveStatus. In that case, requesting supported viewfinder settings never works. [ChangeLog][CameraBin] CameraBin plugin now fetches supported viewfinder settings at status higher or equal to LoadedStatus if it has not been fetched. Change-Id: Ibd32c25feac9b1a133945e754d26181937190a24 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* Gstreamer: Add support of avfvideosrc for camerabinVaL Doroshchuk2019-02-081-0/+6
| | | | | | | | | Gst Device Provider now can be used for macOS also. Added support of avfvidesrc element to be used within camerabin. Task-number: QTBUG-72125 Change-Id: I69205649c6e75432534e240656d8cb4748ee10cc Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-221-2/+2
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Icf8b9f73c50b16d6f5765040eb7bd918231df94a
| * Gstreamer: Negotiate default settings before encoding container profileVaL Doroshchuk2019-01-111-2/+2
| | | | | | | | | | | | | | | | In case if container format, video and audio codec are not provided, need to fetch default ones. Change-Id: I616fabc7bf9ec7c7a08a4c5dacad87a1748209f3 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Gstreamer: add support for ksvideosrc within camerabinVal Doroshchuk2019-01-171-2/+9
| | | | | | | | | | | | Task-number: QTBUG-72125 Change-Id: I12bc684a796c6abb6af3a51edca52011495f4ac9 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Don't append suggested extension if filename includes extensionChris Adams2019-01-021-3/+8
|/ | | | | | | | | | | | | | | | Commit 6b19a24b581c9c changed the way that the file name is composed for a video recording, so that a suggested extension for the given media format is appended to the file name. That introduced a bug in the case where the correct extension was already part of the output location (filename) set for the sink, by causing a second (and possibly incorrect) extension to be appended to the filename. This commit ensures that if the filename already has a suffix, no suggested extension is appended. Task-number: QTBUG-65402 Change-Id: I0bedf178b7a2aeec89aeb47002e2bae563ed44cd Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* Gstreamer: Set video-profile to CameraBin before GST_STATE_READYVaL Doroshchuk2018-08-221-9/+11
| | | | | | | | | | | | | | | | | | | | CameraBin creates default (application/ogg, video/x-theora) video profile or sets custom defined one, but ONLY on GST_STATE_CHANGE_NULL_TO_READY. If the camera is already loaded then it is not possible to change the video profile. Since a video profile was never defined, video/x-theora was always used to record video. Moved setting video profile before it gets to READY. It fixes an issue with ignoring CameraBinRecorder::applySettings(). This also changes previous behavior when video/x-theora was always used. To apply custom video settings it requires to use QMediaRecorder::setVideoSettings before the camera enters the READY state. Task-number: QTBUG-69895 Change-Id: I3afbf1f8e7c953e2e49e9cad7e96ea0b18a29d1a Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Gstreamer: Fix gst_mini_object_unref: assertion refcount > 0 failedVaL Doroshchuk2018-08-221-1/+0
| | | | | | | | gst_value_get_sample does not return a reference to the sample. Should not call gst_sample_unref. Change-Id: Ibf71e6844b5756d85aac541a68e4e4ae4eefe498 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Gstreamer: Fix crash when resolution or frame rates are requestedVaL Doroshchuk2018-08-221-0/+11
| | | | | | | | When either resolution or frame rates have been requested when the camera is in unloaded state, caps might not have some values. Change-Id: Ie935c62d02e10f762957ecd9f89255ad0e8fbd0b Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Gstreamer: Use gst_parse_launch in QT_GSTREAMER_CAMERABIN_VIDEOSRCVaL Doroshchuk2018-06-201-5/+13
| | | | | | | | | | | QT_GSTREAMER_CAMERABIN_VIDEOSRC can contain pipeline description and not just one video source element. QT_GSTREAMER_CAMERABIN_VIDEOSRC="nvcamerasrc ! nvvidconv" ./app Task-number: QTBUG-60884 Change-Id: Iebf052a6669fd17139b78949ed0bb314f1faef65 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* CameraBin: Postpone fetching supported viewfinder settingsVaL Doroshchuk2018-05-081-38/+42
| | | | | | | | | | | Fetching caps from video source might take sometime and hang ui thread. Currently the caps are fetched when the camera gets ready which produces a hang. Proposed a fix to postpone fetching caps when requested and not when camera loaded. Task-number: QTBUG-67920 Change-Id: I7734ef96c98b2c425714eacc1fd1222fd7ee5c44 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Gstreamer: Emit an error if QCamera::start() failsVaL Doroshchuk2018-03-211-3/+11
| | | | | | | | | | | | | If a camera is not started successfully error() signal has to be emitted. Added emitting an error from video source. Emitted only first error to prevent multiple subsequent errors. Added debug message. Task-number: QTBUG-51825 Change-Id: I6ac936d2728213a4a64f3e4eb25ae2e2f109acca Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Replace deprecated qSort() by std::sort()Friedemann Kleint2018-02-281-2/+4
| | | | | Change-Id: I74ffd5bafaef9ebbe7f12600ad831c8deb58ae64 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Revert "GStreamer: Prevent calling CameraBinSession::setStateHelper twice"v5.10.1VaL Doroshchuk2018-02-051-5/+2
| | | | | | | | | | This reverts commit 9caee039533168fbb546b563859770414e54fc94. Reverted due to GST_STATE_PLAYING is never set. Task-number: QTBUG-66196 Change-Id: I85cf47c747b1e153265f2eee6477124f4683a574 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-061-2/+5
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I3d6e69f3f99b2f0a0e2c29ffdd02176e1f22304e
| * GStreamer: Prevent calling CameraBinSession::setStateHelper twiceVaL Doroshchuk2017-12-141-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since CameraBinSession::setStateHelper() is supposed to handle only pending states, added a fix to prevent calling it twice. Otherwise CameraBinSession::load() can be called few times which might lead an error from gstreamer. Possible call stack: CameraBinSession::setState() CameraBinSession::setStateHelper() CameraBinSession::load() CameraBinSession::setStatus() CameraBinSession::setStateHelper() CameraBinSession::load() << gst_element_set_state is called also twice Task-number: QTBUG-53204 Change-Id: I00c66f91cd3b885c70848245da725ff68943fad2 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | GStreamer: Emit an error if no input device provided for QCameraVaL Doroshchuk2017-12-051-1/+4
|/ | | | | | | | | Prevents building a camera source if no input device name is provided. And emit an error immediately. Task-number: QTBUG-64155 Change-Id: I509bee1df0acb372d26f45fd27057f8b7e141c2a Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Gstreamer: Fix memory leak in CameraBinSessionVaL Doroshchuk2017-11-081-4/+11
| | | | | | | | Created GstElement objects m_cameraSrc and m_videoSrc should be unrefed. Task-number: QTBUG-53204 Change-Id: Ibbfd37d928fe87ea899549da7c12fa2386e214cc Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-101-6/+8
|\ | | | | | | | | | | | | Conflicts: src/plugins/gstreamer/camerabin/camerabincontainer.h Change-Id: I4942d41d69112335fe0c994002f1b32ef3aad051
| * Use QT_CONFIG macro to check for featuresLars Knoll2017-02-271-6/+8
| | | | | | | | | | | | | | 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-10-111-0/+7
|\| | | | | | | Change-Id: I7291f7a3bd5851eafe2bf0a4bd5c5f8e705a90bc
| * GStreamer: Support video probe on QCameraDaniel Nicoletti2016-09-231-0/+7
| | | | | | | | | | Change-Id: I54889a72346da24654c8a0618056c14999ecf71e Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* | GStreamer: move suggestedFileExtension() out of camerabin pluginYoann Lopes2016-08-231-1/+1
|/ | | | | | | Now in QGstUtils, in order to be used from other places. Change-Id: Id8beae1b804fa22bd648e254a1ff2a1f1e455a02 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-101-1/+2
|\ | | | | | | | | | | | | Conflicts: src/plugins/winrt/qwinrtcameracontrol.cpp Change-Id: I45d3042adf19577a72794610fa1c310cb22e26c4
| * GStreamer camerabin: return the proper camera sourceZhang Xingtao2016-04-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | - return m_cameraSrc for function cameraSource() instead of m_videoSrc. m_videoSrc is not always assigned(default 0), it will crash on: if (g_object_class_find_property( G_OBJECT_GET_CLASS(m_session->cameraSource()), "exposure-mode")) { And as the function name says, it would be better to return the value m_cameraSrc. - make sure pointers are not NULL before using them. Change-Id: I8a56db34a805724b428409b87de7d072ee7bfa57 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>
* | Gstreamer plugin: replace foreach with range-based forAnton Kudryavtsev2016-01-151-4/+4
|/ | | | | Change-Id: Ic6d0f9d6b45eae1cdadc46783cb6f5bb7c64ac8c Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Support compiling with GStreamer < 0.10.32 in the camerabin plugin.Yoann Lopes2015-11-191-3/+46
| | | | | | | | | | | | | | | | | | | The documented minimum GStreamer version for Qt Multimedia is 0.10.24, however, the camerabin plugin actually required 0.10.32 to compile successfully. The reason is mainly due to the GstEncodingProfiles API, which is used to implement the audio and video encoding settings controls. There's no hard requirement for that API anymore and the aforementioned controls simply don't do anything when the GStreamer version used to compile is older than 0.10.32. A few other GStreamer calls had to be ifdef'd or replaced in order to compile with 0.10.24. Note that this patch only makes sure it compiles with older versions, running the camerabin plugin with GStreamer < 0.10.32 is currently untested and it might not work as expected. Task-number: QTBUG-48914 Change-Id: I4ce8e932f24a33e919e29326729e12bbae561faf Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* GStreamer: added convenience function in QGstUtils.Yoann Lopes2015-08-131-4/+2
| | | | | | | -> qt_gst_element_get_factory_name(GstElement *elem) Change-Id: Icf806488b49fbcdecdd605b6316bd1ef8796a883 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* GStreamer: use QMediaStorageLocation to generate capture file names.Yoann Lopes2015-08-041-67/+12
| | | | | Change-Id: I2111eb8e28f60ca6305a48a8ee9299bc14ab0df9 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* GStreamer: fix possible integer overflow in comparison.Yoann Lopes2015-08-041-1/+1
| | | | | Change-Id: I6cf4349f89320f72cce4d04cdf909476e583d11f Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* GStreamer: some improvements with the camerabin's capture settings.Yoann Lopes2015-02-181-24/+39
| | | | | | | | | | | | - Don't pretend we support changing the image or video capture settings while the camera is active. The pipeline needs to be restarted in order to renegotiate caps. - Improved retrieving the supported capture resolutions and frame rates when using wrappercamerabinsrc. We now always get the supported values directly from the video source. Change-Id: I107193288e370af105a25d16568a8f5a76022ada Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* GStreamer: improve camerabin audio settings checking.Yoann Lopes2015-02-181-3/+3
| | | | | | | Don't try setting a sample rate or a channel count equal to 0. Change-Id: Ib2e1728f0d9af09df9c4d3fd1322b5cb174a2981 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* GStreamer camerabin: don't recreate camera source on device change.Yoann Lopes2015-02-181-33/+34
| | | | | Change-Id: If62573b11c8e3112d386d93de9a504f49965d597 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* GStreamer: remove unused function and enum.Yoann Lopes2015-02-181-5/+0
| | | | | Change-Id: I67b329784d94e60b94c10d4a8942d02b050e0b2c Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* GStreamer: runtime check for controls that require GstPhotography.Yoann Lopes2015-02-181-8/+35
| | | | | | | | | | | | | | | Exposure, Flash, Focus and Locks controls were always initialized, even when the GstPhotography interface was not available (on desktop for example), causing some warnings and fooling the user in believing that these features were available. These controls are now lazily initialized and only when GstPhotography is available. The zoom control is not compile-checked anymore since it doesn't actually require GstPhotography. Change-Id: I5e8315d796dd920c9c29ccfa4155707f5f0fd7dc Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* GStreamer: implemented QCameraViewfinderSettingsControl2.Yoann Lopes2015-02-181-91/+205
| | | | | Change-Id: I4436e39c152f6c251792c1504d4a7b57db7b9d9a Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* GStreamer: fix camerabin state and status changes.Yoann Lopes2015-02-181-67/+118
| | | | | | | | | | | | | | Not all status changes where reported and setting the QCamera to LoadedState was not actually loading anything. State and status changes have been refactored. Camera status is now reported directly by the camera session. Setting the camera state to LoadedState now sets the camerabin to GST_STATE_READY, that allows to query for camera capabilities without having to start the camera (and have a valid viewfinder). Change-Id: I249b1ad32690679ff34a427410bc709ed3ab461c Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* Update copyright headersAntti Kokko2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I1c6faa4f59f8eca54f01ef20941fa60161dd7872 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devYoann Lopes2015-01-191-0/+35
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/plugins/gstreamer/camerabin/camerabinsession.cpp Change-Id: I66a6f3efc5391013934b6b321073c31f25e1de26
| * Add resolution and fps on mfw_v4lsrcLaszlo Agocs2015-01-121-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for changing resolution and frame rate with mfw_v4lsrc. This is essential for embedded applications that are not happy with the default VGA@30. This makes constructs like the following functional on devices like i.MX6 with MIPI cameras: Camera { viewfinder { resolution: "320x240"; maximumFrameRate: 15 } } Change-Id: Ia297afdb5ca51c6e55ad45dce37fdab7da3a5cfb Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* | GStreamer: port to 1.0.Yoann Lopes2014-11-271-219/+120
|/ | | | | | | | | | | | | | | 0.10 is still used by default. To enable GStreamer 1.0, pass GST_VERSION=1.0 to qmake for qtmultimedia.pro. Contributions from: Andrew den Exter <andrew.den.exter@qinetic.com.au> Ilya Smelykh <ilya@videoexpertsgroup.com> Jim Hodapp <jim.hodapp@canonical.com> Sergio Schvezov <sergio.schvezov@canonical.com> Change-Id: I72a46d1170a8794a149bdb5e20767afcc5b7587c Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Add QT_GSTREAMER_CAMERABIN_VIDEOSRC environment variable.Yoann Lopes2014-10-301-2/+34
| | | | | | | | | It can be used to set which video source element should be used by the camerabin. Change-Id: I8d1cd8c4ba6fe5a89817699f645b0997e713aaca Reviewed-by: Samuli Piippo <samuli.piippo@digia.com> Reviewed-by: Christian Stromme <christian.stromme@digia.com>