summaryrefslogtreecommitdiffstats
path: root/src/plugins/common
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.12' into ↵v5.15.12-lts-lgplTarja Sundqvist2023-10-116-16/+60
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I6a330e383bb573bd7ba6cfea7e8bce3e88de2d7a
| * Windows: Fix cropping for HEVC-encoded videosAndré de la Rocha2022-09-286-16/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cropping info associated with HEVC-encoded video files was not being applied and as a result some videos could show garbage on the borders of the actual video contents, since instead of the source frames width and height, the sizes in pixels of the buffers used by the encoding algorithm, which are padded to multiples of some power of two, were used. Root cause seems to be a bug in Media Foundation or incompatibility with the Windows HEVC decoder, as the API is returning buffer sizes where sizes of actual video contents should be returned. It works as expected for other video formats. This patch makes the QtMultimedia decoder enforce the actual video dimensions obtained through the file's metadata. Fixes: QTBUG-105381 Change-Id: I2d67c64f07de489edd1d274060eccd5a4d69bafe Reviewed-by: Piotr Srebrny <piotr.srebrny@qt.io> Reviewed-by: Lars Knoll <lars@knoll.priv.no> (cherry picked from commit 65345a04c67c585c4d38d56cb1416a3033434aaf) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-2510-205/+205
|/ | | | | | | | | | | 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-2710-205/+205
| | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-09-123-1/+31
|\ | | | | | | | | | | | | | | Conflicts: src/gsttools/qgstvideorenderersink.cpp src/gsttools/qgstvideorenderersink_p.h Change-Id: I7fe29161d568fa3f7688abfd2f993d1b16ac3fb9
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-09-083-1/+31
| |\ | | | | | | | | | Change-Id: Idc377c82cc1d2bd53069babc7f14618ef46dc67b
| | * DirectShow: Add startTime and endTime to QVideoFrameVal Doroshchuk2019-08-293-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the application seeks to a new position, the Media Session restarts the presentation clock at the specified seek time. The media source might deliver samples with a slightly earlier time stamp if the seek time does not fall on a key-frame boundary. And IMFSample->GetSampleTime will return time that is related to a position when the clock has been restarted, and can be also negative. So if it needs to have times from the beginning, it would require to add seeked position to times from IMFSample. It also reverts c4de056a6aa44567cdbf2ce91a464e597ad4af8f Fixes: QTBUG-77849 Change-Id: I1a7cb7bd18aee73087a61d2ed2c3d644ad0fbd50 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
| | * DirectShow: Fix crash when there is no surface on flush()Val Doroshchuk2019-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QDeclarativeRendererBackend is being destroyed, it clears the surface and postpones releasing IMediaControl, which is done on worker thread. It also calls flush() where null surface is used. Fixes: QTBUG-77829 Change-Id: I327583c1f8fb7585dbec3c3fb7e80d0155cc4819 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Port from QMutex::Recursive to QRecursiveMutexMarc Mutz2019-08-012-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | Also port from QMutexLocker to std::lock_guard or std::unique_lock, as the former will not support QRecursiveMutex going forward. Change-Id: I1ed1a129e2b9b77aa0a729e8cab03c673566a345 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* | | Eradicate all but one Q_FOREACH loopMarc Mutz2019-07-111-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Q_FOREACH is going to be deprecated, or at the very least banned from use in Qt code. All these are trivial in the sense that the loop body clearly doesn't modify the container over which we iterate, and that the container is const, or trivially marked as such. In one case, replaced Q_FOREACH + delete + clear() with qDeleteAll(qExchange()), in three others, replaced Qt containers with statically-known content with plain C arrays. Change-Id: I718821811370f0cfefac3893283572d39a7d957d Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-06-031-10/+0
|\| | | | | | | | | | | | | Conflicts: src/plugins/directshow/player/directshowplayerservice.cpp Change-Id: I6b7edc312ecfadf84653ce24321ec55da41e131a
| * EVR: Remove setting of start/end times in QVideoFrameVal Doroshchuk2019-05-141-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to unknown bug in IMFTransform->ProcessOutput() when after seeking sample times are not set correctly to provided IMFSample. This causes current playback position to be not respected in video samples. Even if you seeked to higher/lower position, sample time is always counted from beginning. Which makes no sense to use this feature because video frame's sample times are not related to current position. To test it, need just seek to arbitrary position and check how startTime is not correlated to new position. Fixes tst_QMediaPlayerBackend::seekPauseSeek Task-number: QTBUG-65574 Change-Id: I897d75c055347cdcca38a84dc18f91800d070c09 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-04-101-1/+1
|\| | | | | | | | | | | | | | | Conflicts: tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp Done-with: Val Doroshchuk <valentyn.doroshchuk@qt.io> Change-Id: I745dd948c1e98180115f85c17bef802351bbdb6b
| * EVR: Don't repaint with black until the surface is activeVal Doroshchuk2019-04-101-1/+1
| | | | | | | | | | | | | | | | | | | | A frame must be presented until pause/play is called. Fixes tst_QMediaPlayerBackend::seekPauseSeek Task-number: QTBUG-65574 Change-Id: I6946c5a5977c44fed80abce364a4222845898016 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-042-2/+5
|\| | | | | | | Change-Id: I5394a9d75850771068d43d2509b14a3ac4efcf83
| * DirectShow: Restart not active surface when frame is receivedVal Doroshchuk2018-11-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | If playback is not stopped but EndOfMedia is received, it would be still possible to seek to previous position and start playback again which will cause empty video output because the surface has been already stopped and should be restarted. Task-number: QTBUG-42057 Change-Id: I5ca496ba3af5c27c0ad61edb35d758e201061595 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * Windows: Repaint QVideoWidget when WM_PAINT or WM_ERASEBKGND receivedVal Doroshchuk2018-11-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since updates are disabled, and no paint events will be sent to QVideoWidget, need to somehow repaint the video window. When BeginPaint is called outside of the expose event, the window might not be refreshed. So moved calling the repainting within the expose event. Also added repainting when the display rect is changed to immediate refreshing. Task-number: QTBUG-71326 Change-Id: I7c29b3f8ad35e33590c7b138a5141546ce3c1a42 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-241-1/+2
|\| | | | | | | Change-Id: Iab78b2e3bac2b107273068dca2d9130133486b62
| * EVR: Prevent redefinition of MFVideoNormalizedRectMarius Kittler2018-11-181-1/+2
| | | | | | | | | | | | | | | | | | | | This establishes compatibility with MinGW-w64 headers 6.0 where MFVideoNormalizedRect has been added to evr.h. Task-number: QTBUG-70630 Change-Id: I49ac49bf9eda8ea281d9da799785e56373ae8f01 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io> Reviewed-by: Marius Kittler <mariuskittler@gmx.de>
* | DirectShow: Stop surface on EndOfStreamVal Doroshchuk2018-11-221-0/+2
|/ | | | | | | | Surface should be stopped to flush video frame. Task-number: QTBUG-71610 Change-Id: I1d7b4e0c1c04ebfbf764ffc8621a7028dd88f22d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12v5.12.0-beta2Qt Forward Merge Bot2018-10-052-31/+16
|\ | | | | | | Change-Id: I70b363e614391ecce15ed55ef1267973c8b21355
| * EVR: Fix crash when no resources createdVal Doroshchuk2018-10-042-31/+16
| | | | | | | | | | | | | | | | | | Saved a copy of texture id in IMFSampleVIdeoBuffer and init it on first call. Task-number: QTBUG-70672 Change-Id: Iaf8ff4f3faa952846eca5a764c88e57807d4d211 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * EVR: Fix crash when video source is changed and ANGLE is usedVal Doroshchuk2018-09-251-1/+1
| | | | | | | | | | | | Task-number: QTBUG-70672 Change-Id: I38c1e868dd05835489a49e6c29d9ad1a36a5f7a9 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | DirectShow: Fix clang-tidy warnings about else after returnFriedemann Kleint2018-09-052-17/+15
| | | | | | | | | | | | | | | | | | - Unindent the code or replace by switch () - Smaller fixups when reindenting (nullptr, use QStringView for comparison against wchar_t) Change-Id: I249cb00b9ebe375b089d8d53b10c2d16d5771680 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | DirectShow: Fix clang-tidy warnings about loopsFriedemann Kleint2018-09-051-17/+10
| | | | | | | | | | | | | | - Replace by range-based for Change-Id: Ie73bf5b6e1ebd90e4db653af0791ec88b68ed883 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | DirectShow: Fix clang-tidy warnings about C-style castsFriedemann Kleint2018-09-052-16/+28
| | | | | | | | | | | | | | Replace by reinterpret_cast<>. Change-Id: Iebcac7858d875e2d6f53db21489d86beb19ba947 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | DirectShow: Fix clang-tidy warnings about class definitionsFriedemann Kleint2018-09-055-60/+59
|/ | | | | | | | | | | | - Use ' = default' for trivial constructors/destructors - replace virtual by override or add override where applicable - Replace trivial constructors by member initialization for simple structs - Add Q_DISABLE_COPY where applicable - Mark move assignment/move constructors as noexcept - Remove unused member variables Change-Id: I579fb69ebcd945b94de32b827d93e5a4dab4df97 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-061-73/+86
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I3d6e69f3f99b2f0a0e2c29ffdd02176e1f22304e
| * Windows: Fix EVR's rendering of GLTextureHandle framesVal Doroshchuk2017-11-301-73/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | When ANGLE is used and video frames have GLTextureHandle handle type black screen is shown while audio is working correctly. Fixed a bug when opengl texture has not been ever creating. Fixed a crash when releasing resources due to empty QOpenGLContext. Also moved gl initialization related code to OpenGLResources. Task-number: QTBUG-61407 Change-Id: Ifc92a4a2fa2e769494ef962203446a9b3e7dd86d Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | DirectShow: Use pixel aspect ratioVal Doroshchuk2017-12-082-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally pixel aspect ratio was clearing (set to 1,1) within renegotiating the media type. Which caused samples with not standard pixel aspect ratio (1,1) to be rendered with black squares on the top and the bottom. (Original size was kept but PAR cleared) Added a fix to keep PAR while adjusting the media type to optimal one and set original PAR to QVideoSurfaceFormat. Task-number: QTBUG-64438 Change-Id: I6d1a5c441b89bbd5cea86667cc570bb7eb19068b Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* | Fix Clang warnings about unused fieldsFriedemann Kleint2017-11-022-3/+0
| | | | | | | | | | | | | | | | | | | | evrcustompresenter.h(371,16): warning: private field 'm_sampleToPresent' is not used [-Wunused-private-field] qwindowsaudiooutput.h(119,10): warning: private field 'resuming' is not used [-Wunused-private-field] qwindowsaudiooutput.h(142,14): warning: private field 'result' is not used [-Wunused-private-field] ^ qwindowsaudiooutput.h(143,13): warning: private field 'header' is not used [-Wunused-private-field] Change-Id: Iaf9e422678e6e53aeb3a0c0f7c1c52c1301a0b9d Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Fix Clang warningsFriedemann Kleint2017-11-021-1/+1
|/ | | | | | | | evrd3dpresentengine.cpp(52,11): warning: non-portable path to file '<QtGui/qguiapplication.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path] mfstream.cpp(233,13): warning: enumeration value 'msoBegin' not handled in switch [-Wswitch] Change-Id: I5aeb253a11de964090123b1d2c61435e31d488f6 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* DirectShow: Change parameter of qt_evr_pixelFormatFromD3DFormat() to DWORDFriedemann Kleint2017-06-203-3/+3
| | | | | | | | | | | | Fixes g++ warnings: ..\common\evr\evrhelpers.cpp: In function 'QVideoFrame::PixelFormat qt_evr_pixelFormatFromD3DFormat(D3DFORMAT)': ..\common\evr\evrhelpers.cpp:143:5: warning: case value '842094158' not in enumerated type 'D3DFORMAT {aka _D3DFORMAT}' [-Wswitch] case D3DFMT_NV12: ..\common\evr\evrhelpers.cpp:145:5: warning: case value '842094169' not in enumerated type 'D3DFORMAT {aka _D3DFORMAT}' [-Wswitch] case D3DFMT_YV12: Change-Id: I11869144b34d848bd68434d3a062852608518978 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* DirectShow: Fix namespaced build with MinGWFriedemann Kleint2017-04-267-11/+27
| | | | | | | | | | | | | | | | | | | | | | Remove QT_USE_NAMESPACE from headers and enclose headers/sources in QT_BEGIN/END_NAMESPACE. Fixes MinGW build error: qtbase/src/corelib/global/qtypeinfo.h:246:7: error: specialization of 'template<class T> class tn::QTypeInfo' in different namespace [-fpermissive] class QTypeInfo<TYPE > \ ^ qtbase/src/corelib/global/qtypeinfo.h:265:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO_BODY' Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS) ^ helpers\directshowmediatype.h:92:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO' Q_DECLARE_TYPEINFO(DirectShowMediaType, Q_MOVABLE_TYPE); ^ qtbase/src/corelib/global/qtypeinfo.h:57:7: error: from definition of 'template<class T> class tn::QTypeInfo' [-fpermissive] class QTypeInfo ^ Task-number: QTBUG-60118 Change-Id: Idfe7a49b50a0046a5cb17630a3ec99615ec6150a Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Only update the texture if the m_glResources are validAndy Shaw2017-01-131-1/+1
| | | | | Change-Id: Ifa0c768e2f0299d31d3d52db975c896bdb2aab5e Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-212-12/+12
|\ | | | | | | Change-Id: Ieb1a3081907093e31e8c8b7f95993bb3b2173672
| * DirectShow: Fix MinGW warnings about signedness of comparison.Friedemann Kleint2016-03-211-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a switch on int instead of else if. common\evr\evrcustompresenter.cpp: In member function 'virtual bool EVRCustomPresenter::event(QEvent*)': common\evr\evrcustompresenter.cpp:1882:22: warning: comparison between 'enum QEvent::Type' and 'enum EVRCustomPresenter::PresenterEvents' [-Wenum-compare] if (e->type() == StartSurface) { ^ common\evr\evrcustompresenter.cpp:1885:29: warning: comparison between 'enum QEvent::Type' and 'enum EVRCustomPresenter::PresenterEvents' [-Wenum-compare] } else if (e->type() == StopSurface) { ^ common\evr\evrcustompresenter.cpp:1888:29: warning: comparison between 'enum QEvent::Type' and 'enum EVRCustomPresenter::PresenterEvents' [-Wenum-compare] } else if (e->type() == PresentSample) { Change-Id: I8533e2c6d9b0a01b7b95e1d8bb119b50d4aabd25 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * fix case of included filesMark Brand2016-03-181-2/+2
| | | | | | | | | | | | | | | | | | Cross-compiling for mingw requires lowercase filenames. Change-Id: I135deca455ca2ff6bb3969aca990fe9d1c2dd345 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Windows EVR: show frames when pausing from stopped state.Yoann Lopes2016-03-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | The QAbstractVideoSurface was started only when calling play(), causing frames received before (e.g. when pausing from stopped state) to not be rendered. The surface is now started as soon as a media type is agreed between the EVR and the upstream element. Conversely, the surface is stopped whenever the media type is cleared. Change-Id: Ia96a07dbd277adce67de5a9cfbf9acc0d33b6497 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-alpha1Liang Qi2016-02-152-23/+9
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: If5d9ea0fb6187bb6f74881289ebb15a57eb82e0c
| * Windows EVR: fix EndOfStream event never being sent.Yoann Lopes2016-02-042-23/+9
| | | | | | | | | | | | | | | | This was causing QMediaPlayer to never go into the EndOfMedia state. Task-number: QTBUG-50814 Change-Id: I8920cf93db37a834f67b9e0b4abcf5a4934dfe0e Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-261-3/+4
|\| | | | | | | Change-Id: I2e4e9cca01d63ed0d1e7f71c7a58322390696036
| * Windows: fix build with -opengl desktop.Yoann Lopes2016-01-181-3/+4
| | | | | | | | | | | | Task-number: QTBUG-50510 Change-Id: Ide1b58061d0fcdd5caf8597af8cfaec2483d712b Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* | Updated license headersAntti Kokko2016-01-1910-140/+200
|/ | | | | | | | | | | 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>
* Windows: Improve EVR presenter.Yoann Lopes2016-01-127-582/+683
| | | | | | | | | | | | | | Removed hard dependency to Angle; it's now required only when rendering to a texture. If Angle is not used, the buffers are now mappable to system memory. This enables HW-accelerated video decoding in QML for non-ANGLE builds. Note that the frame data have to do a round-trip through system memory, which is not ideal but still faster than SW decoding. Task-number: QTBUG-45593 Change-Id: Icc3503142df4e8dbb53b4e11f409b161fd2f9bde Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* DirectShow: use the EVR in the renderer control.Yoann Lopes2016-01-1210-5/+3655
| | | | | | | | | | | As for the window control, the existing code from the WMF plugin has been refactored out and is now shared for both plugins. This enables HW-accelerated video decoding in QML, QGraphicsVideoItem and custom QAbstractVideoSurfaces (Angle is required). Task-number: QTBUG-45593 Change-Id: I1d4dbf5695cdd4dbee93f9f4a957fa4d813aa85d Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* DirectShow: use the EVR in the window control.Yoann Lopes2015-11-054-0/+591
Reuse existing code from the WMF plugin, which already uses the EVR. This enables HW-accelerated video decoding when using QMediaPlayer with a QVideoWidget. Task-number: QTBUG-45593 Change-Id: I757e4d53cd2c648aee6ba33a4851a8c6adc62843 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>