summaryrefslogtreecommitdiffstats
path: root/src/qtmultimediaquicktools/qdeclarativevideooutput_render.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Avoid initializing QFlags with 0 or nullptrFriedemann Kleint2019-11-251-2/+2
| | | | | | | It is being deprecated. Change-Id: I26b871fe9b989972ab1d2c18de344dc9c9275e9f Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* Introduce QVideoFrame::image()VaL Doroshchuk2019-10-311-2/+1
| | | | | | | | | | | | | Since QVideoFrame::pixelFormat's do not 100% match QImage::Format's, introducing converstion function. Returns an image based on current frame. Converts data if needed to supported QImage format. Change-Id: I3331578c01cf9c999a380efc4a83bf9eddb07901 (cherry picked from commit 93f966335e1ed8ed47b7e8b32452d43c2f8a7bb1) Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix leaking QVideoFilterRunnable when window is closedVal Doroshchuk2019-10-011-2/+1
| | | | | | | | | | | | | When QDeclarativeVideoOutput::releaseResources() is called, means the window is going to be destroyed and it is too late to use scheduleRenderJob() to clear filters. This beforeSynchronizingJobs will not be handled in this case. Which produces a leak of filter's runnable. Fixes: QTBUG-51588 Change-Id: I71ec351463a2c4136d8b7e241d61e628a1b0c64b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix crash when VideoOutput.sourceRect is requested but playback is stoppedVaL Doroshchuk2019-09-041-2/+2
| | | | | | | | | | | | | | | | | When the playback is stopped, QAbstractVideoSurface::stop is called where current surface format is reset. And when sourceRect is requested before QAbstractVideoSurface::surfaceFormatChanged() is handled, it produces an ASSERT. Suggesting to use cached surfaceFormat instead of removing the ASSERT. To reproduce: MediaPlayer { onStatusChanged: console.log(output.sourceRect) } Change-Id: I73ad72f1e4968fe45266827ec5c7e3b36333ee30 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* VideoOutput: Download data of flush video frame if it has a handleVal Doroshchuk2018-11-291-9/+12
| | | | | | | | | | | | | | Flush video frame is used to be shown when flush or stop is requested. In case if the video frame is gl texture based just copying handle will not copy actual data and flush frame will be always the last seen frame. Needs to convert gl based frame to QImage and keep it in within QVideoFrame. Task-number: QTBUG-71610 Change-Id: I3e5aa1deb56313e6c6b97cde3e94dead6dec1b76 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* VideoOutput: Introduce flushMode propertyVaL Doroshchuk2018-11-061-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | Added flushMode property to QML VideoOutput element to define what should be shown when flush is requested. Takes affect only for QDeclarativeVideoRendererBackend and when QSGVideoItemSurface is already started. Flushing (passing empty video frame to the surface) is usually performed when EndOfMedia or playback is stopped. Which caused disappearing the content and blinking if playlist is used. Using this property now possible to define what frame (last, first or empty) should be shown when playback is stopped or finished. By default shows empty frame (clears the video output). To show a frame it requires to keep QVideoFrame and thus its data. Task-number: QTBUG-37301 Task-number: QTBUG-49446 Change-Id: I3be5309217b9f543da804e3b616dee9d97fba65f Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-061-2/+2
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I5acdc7e0bd3729b80522dfff0f388cf2507fb111
| * Fix precision loss in QDeclarativeVideoRendererBackend::adjustedViewportVaL Doroshchuk2017-12-201-2/+2
| | | | | | | | | | | | | | | | Applied casting to keep precision. Task-number: QTBUG-64044 Change-Id: If3cb29b5c049302de38e5417811792405c896334 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-201-1/+8
|\| | | | | | | Change-Id: Icaf645e271b21320c4cb6269178d9e722092a263
| * Don't discard the surface format when creating a video nodeVaL Doroshchuk2017-10-271-1/+8
| | | | | | | | | | | | | | | | All relevant properties from the surface are now copied Task-number: QTBUG-53268 Change-Id: I7f18f0e6a623c8c7c5be68e912b298e0b4b130b7 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-221-1/+1
|/ | | | | Change-Id: I17b3650a3df5688274151c1f2c4629e4a5062028 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-101-10/+0
|\ | | | | | | | | | | | | Conflicts: src/plugins/winrt/qwinrtcameracontrol.cpp Change-Id: I45d3042adf19577a72794610fa1c310cb22e26c4
| * QNX: Avoid reading frames faster than they're renderedDan Cape2016-04-271-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous code would capture frames with a 60Hz timer into two pixmaps alternating pixmaps with each successive frame. Rendering was somewhat disconnected from this, if rendering was unable to occur at 60fps, multiple frames might be copied for each frame rendered. This meant that it might try copying a video frame into a pixmap that was currently being used by the GPU with bad effects. The primary effect being severe flicker on i.mx6 targets. The change is to ensure that we don't read the window data until we're just about to make use of it. This means we don't ever get ahead of ourselves and read the video window once for every frame rendered. The code has been significantly refactored. There is now a class that manages the pixmaps and egl images. This is created on demand and the images are created and destroyed when sizes change. Since this all now occurs in the proper thread, much of the nonsense of setting _q_GLThreadCallback to arrange a call from the render thread is avoided. Remove BlackBerry ifdefs that are no longer used. Change-Id: I4bf5efa4c39c8170e3f55499c167ee10e521e100 Reviewed-by: James McDonnell <jmcdonnell@qnx.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* | Updated license headersAntti Kokko2016-01-191-15/+21
| | | | | | | | | | | | | | | | | | | | | | 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>
* | QtMultimediaQuickTools: replace foreach with range-based forAnton Kudryavtsev2016-01-151-4/+5
|/ | | | | Change-Id: I729375c1de712f1fb7915c95ce9eb7dcd00fe757 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Add new property to QVideoSurfaceFormat.Yoann Lopes2015-08-071-0/+6
| | | | | | | | | | | | The 'mirrored' property indicates the QVideoFrames need to be mirrored along their vertical axis. This is typically needed for video frames coming from a front camera on a mobile device. This is implemented as a string-based property. In Qt 5.6, this should be replaced by a new public function. Change-Id: Ideb7de81e83f66826f4efb5f2951c4beec13546b Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* Add an env var to disable OpenGL texture-based video frames.Laszlo Agocs2015-06-031-0/+11
| | | | | | | | | | | | | | | | | | Right now we will always use GLTextureHandle frames with Quick. This is great in many cases, but not always. Applications that wish to examine the frames (e.g. via video filters) will sometimes prefer frames in system memory, even if this is slower to display. Add QT_QUICK_NO_TEXTURE_VIDEOFRAMES which can be used to disable texture-based video frames. [ChangeLog] The environment variable QT_QUICK_NO_TEXTURE_VIDEOFRAMES can now be used to disable OpenGL texture based video frames. This can be useful in applications that wish to filter and process the video frames and are not GPU based. Change-Id: I5ca6f6d485d5bc6c2da8d47db563cd910c238ac9 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Don't error out when presenting empty frames in QSGVideoItemSurface.Yoann Lopes2015-04-071-4/+0
| | | | | | | | | There's no good reason to do so. Backends can actually provide empty frames, for example when flushing the pipeline or after stopping playback. Change-Id: I687c12b667e31b25e91c3201f59c52a8969d8e05 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* 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>
* Add video filtering support to VideoOutputLaszlo Agocs2015-02-031-5/+109
| | | | | | | | | | | | | | | | | | | | | | | | | Add the QAbstractVideoFilter base class and integrate it with VideoOutput. This can be used to perform arbitrary filtering or image processing on the frames of a video stream of a VideoOutput element right before the OpenGL texture is provided to the scenegraph by the video node. This opens up the possibility to integrate computer vision frameworks or accelerated image processing with Qt Quick applications that display video streams using Qt Multimedia. Conceptually it is somewhat similar to QVideoProbe, this approach however allows modifying the frame, in real time with tight integration to the scenegraph node, and targets Qt Quick meaning setting up the filter and processing the results of the computations happen completely in QML. [ChangeLog] Added QAbstractVideoFilter that serves as a base class for QML video filtering elements that integrate compute, vision, and image processing frameworks with VideoOutput. Change-Id: Ice1483f8c2daec5a43536978627a7bbb64549480 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Migrate to categorized logging in Quick 2 video outputLaszlo Agocs2015-01-091-15/+10
| | | | | | | | | | Enable qt.multimedia.video to get the logs. Also enhance the printing when creating the video node implementation. It is essential to have an easy way to figure out what handle and formats the node in use supports. Change-Id: Idf3a9f076ba03b5e613c19f2347204c841850b45 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Fix bogus videonode plugin handlingv5.4.0-rc1Laszlo Agocs2014-11-181-4/+19
| | | | | | | | | | | | | | | | Each plugin must provide its own unique key. Otherwise we will only ever see one single plugin. Right now running on i.MX6 is often broken because the imx6 videonode plugin is not picked up since only the egl one is seen by the system. With the fix both plugins provide their own unique key so both become visible. Additionally, introduce a QT_VIDEONODE environment variable. This is useful to specify which plugin to use. This is necessary in case multiple custom videonode plugins support the same formats. Change-Id: Iaa1988f8436dcb938cb9a95e2e0d68a4e92e113c Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Update license headers and add new license filesAntti Kokko2014-08-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: Ied06887225df341064c12bcc14c259ae74116f2e Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Add an EGLImageKHR video node.Andrew den Exter2014-07-181-1/+1
| | | | | | | | [ChangeLog] Added a VideoNode plugin which allows direct rendering of EGLImageKHR backed video frames. Change-Id: I36fb6fd27680dbe9c71a446bbd54df95488725f8 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* QNX: Remove most of the CPU overhead for video renderingFabian Bumberger2014-04-011-0/+10
| | | | | | | | | | | | | | This patch uses the GL_OES_EGL_image extension to create a OpenGL Texture handle for a libscreen pixmap. If the extension is not available it uses the "old" technique as fallback where the image data is copied into a QImage. This reduces the CPU load by more than 70% and allows HD videos to be played jitter-free. Task-number: QTBUG-37752 Change-Id: I4cad22c39390e4cf9eb5be5f0bfe446544a11b9e Reviewed-by: Bernd Weimer <bweimer@blackberry.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Allow plugins to override the QML VideoOutput type.Andrew den Exter2014-01-201-0/+351
Move QDeclarativeVideoOutput to the private QtMultimediaQuickTools library to make the QDeclarativeVideoOutputBackend interface implementable by a plugin. Change-Id: I763c483a1fc9ec56dc7b8be0bc71523f029a36ee Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>