summaryrefslogtreecommitdiffstats
path: root/src/multimedia/video
Commit message (Collapse)AuthorAgeFilesLines
* Fix crashes on Linuxwip/qt6Friedemann Kleint2021-05-261-3/+5
| | | | | | | Check for videosink and QPlatformMediaFormatInfo in QMediaFormat. Change-Id: I9603dae66fc4eb6a4433f43d2464e9f97916235f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Clean up the videoOutput() APILars Knoll2021-05-212-0/+29
| | | | | | | | | | | | | | | | | | | | 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>
* Doc improvementsLars Knoll2021-05-183-122/+142
| | | | | | | | | | | | | | | | | | | 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>
* Fix a number of compiler warnings/errors when using gccLars Knoll2021-05-141-6/+4
| | | | | | Change-Id: Ifa7bcd4507948cd61909a11af203852ee1586787 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make sure Qt Multimedia compiles against 6.1Lars Knoll2021-05-141-2/+16
| | | | | | | | | | | | | | To keep Qt Multimedia compiling against 6.1 will help people that want to test the module using a released version of Qt. This disables usage of the P010 and P016 video formats on gstreamer, as RHI doesn't yet support the texture types we need to render them correctly. Change-Id: I009f0b37951072b1d6e671dbdd4bb7b33767226a Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rename QMediaDeviceManager to QMediaDevicesVolker Hilsheimer2021-05-071-0/+11
| | | | | | | | | | Reflect that also in the plugins, where classes are renamed from e.g. QXXXDeviceManager to QXXXMediaDevices. This is for consistency with QPlatformMediaDevices, and because QDarwinDevices would be too generic. Change-Id: I78f63f0b8c2aa68aa3f8fb4936e0838281b3222a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QVideoFrame(Format) movable, smaller API cleanupsVolker Hilsheimer2021-05-074-39/+78
| | | | | | | Rename nPlanes to planeCount, remove QVideoFrameFormat::sizeHint. Change-Id: Ib176934f4960d01f6bec5258e552e41140dc101a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make getter constVolker Hilsheimer2021-05-072-2/+2
| | | | | Change-Id: I905baa8b52b4155baa91c9c565aaa3b70d03ea28 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix sizeHint() of QVideoWidget/QVideoGraphicsItemLars Knoll2021-04-282-0/+10
| | | | | | | | | Doesn't yet fix all test failures, but it's an improvement. Change-Id: I775857f1fb580b78ae137dc71ee445a15eafd0a7 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Re-enable tst_qvideowidget and fix most errors in the testLars Knoll2021-04-282-2/+20
| | | | | | Change-Id: I77bf951d9e334d92b65d0f9f5c37c22033e91060 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Fix tst_qvideoframe test failuresLars Knoll2021-04-283-32/+41
| | | | | | Change-Id: I25bceb948518ba49053ae87484bdd8375b616b20 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove qmake files from the repositoryLars Knoll2021-04-231-30/+0
| | | | | | Change-Id: I1131b555014a57e3224a8871de4cb1d01c406fd1 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Fix signature of newVideoFrame() signalLars Knoll2021-04-161-1/+1
| | | | | | | | Signals shouldn't return anything. Change-Id: Iae87f470093504d8a711a57ac9adf9af80f47b2c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Remove QVideoFrame(QImage) constructorLars Knoll2021-04-166-213/+69
| | | | | | | | | It doesn't make a lot of sense and only ever worked for some image formats. In addition, it's never used except for some auto tests. Change-Id: I6a32eabca8c36646ffc11d728e9cdf9b2f74d758 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove the graphicsType enum from QVideoSinkLars Knoll2021-04-162-21/+0
| | | | | | | | | This is redundant, as we can determine the type from whether we have a native window id or an RHI handle set on the sink. Change-Id: I7795e2f1d504fb7df107d1a402ae55adff33d05b Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clean up QVideoSink and it's platform implementationLars Knoll2021-04-162-39/+51
| | | | | | | | | | | | * Normalize ranges of brightness and friends to [-1, 1] and use floating point numbers. * Remove getters for values from the platform API, rather store them in the frontend. This simplifies the work that needs to be done on the backend side. Change-Id: I8d63dacaa6b2873b33e17fcd7831e41173109a7e Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Rename QVideoSurfaceFormat to QVideoFrameFormatLars Knoll2021-04-1411-267/+267
| | | | | | | | | The class is used exclusively together with video frames to describe their format, so the name should reflect that. Change-Id: I10bec7a0556b22c69ac790a99282e1376ce4af97 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove QAbstractVideoFilterLars Knoll2021-04-143-412/+0
| | | | | | | | | | | | | | The API covers a relatively rare use case, and is far from ideal, as it doesn't cooperate very well with HW accerlerated rendering. Since QVideoFrame and the QML VideoOutput item offer the option to get a texture for the frame, it's probably better to use that as the basis for further processing. Change-Id: I89deb915f660312fb3a83b066a5371f5454346da Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add some very basic and incomplete docs for QVideoSinkLars Knoll2021-04-121-0/+64
| | | | | | Change-Id: I41a48e3175802ff444639dd2ceacee202b32ff89 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Cleanups in QVideoSinkLars Knoll2021-04-122-43/+1
| | | | | | | | | | | | Remove render() and the transform and opacity properties. render() because it won't work that way, and the other two properties because they aren't needed. Those properties can be set up before drawing and QVideoSink doesn't need to know about that. Change-Id: Ib4e45336a59bd1c5b6d95448dbbf858571e8e0ea Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove the notifyInterval() functionalityLars Knoll2021-04-081-0/+34
| | | | | | | | | This was nothing else than a timer, something you can just as well implement on top of Qt Multimedia if required. Change-Id: I1ef362f1f4ad5a5f85e92bfbb1d73b7710271e5c Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove 16bit RGB pixel formatsLars Knoll2021-04-086-147/+0
| | | | | | | | | | We can't handle them efficiently on old OpenGL 2 based hardware. As YUV formats are usually preferred, we should not have problems simply removing those. Change-Id: Ibee483302cdada9d4d46c18196c6cee5d9945ae2 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Various fixes to the shader codeLars Knoll2021-04-081-19/+24
| | | | | | | | | | | | | | | Tested all formats that could be tested through gstreamer and ensured our shaders to the right thing. Required adding a width uniform, so we can pick the correct Y value for YUYV non planar formats. The IMC formats should work, but are untested as gstreamer does not support them. Change-Id: Ib0fe0a7c7d97eb81a75f636c752a85f51a327183 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Cleanups in the shadersLars Knoll2021-04-081-44/+5
| | | | | | | | | | Unify the vertex shaders, we only need one for now. Unify the P010 pixel shader with NV12, as they have the same layout. Change-Id: I74dcd400b9219297470cbd01c0d0491933cbf25c Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add support for HW rendering of Y8 and Y16 video formatsLars Knoll2021-04-081-9/+11
| | | | | | Change-Id: I00f9fdcc489a18658574642df49336861aa3a14d Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add a colorMatrix to the rgb shadersLars Knoll2021-04-081-11/+9
| | | | | | | | | | | | This unifies the uniform layout for all pixel formats, and has the advantage that we can now use the color matrix to do brightness adjustments if required by the sink. Fix the rgb pixel shaders and add a missing one for ABGR. Change-Id: I545b4e0f0c067501903ee5f7af1f0f1f80b2b0bb Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove the plane width code from the shadersLars Knoll2021-04-081-24/+5
| | | | | | | | | | This wasn't used at all. We always assume plane texture coords are correct. If anything else should be required, it can be fixed in a special shader. Change-Id: Idfdd428fc5a267f6ad68683b369fb95f5e42d918 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove endian specific surface formatsLars Knoll2021-04-085-67/+24
| | | | | | | | | For 16bit data, we only support the platforms native endianness. Change-Id: Ic04097125622715e6847d568551d572cd317b674 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use the new RHI texture formats for 16bit texturesLars Knoll2021-04-081-2/+2
| | | | | | | | | Use R16 and RG16 to handle rendering of P010 and P016 pixel formats. Change-Id: I96d2c44aea405d24ab4a6e88c42b6a5eff89166f Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove packed pixel formats that can't be HW acceleratedLars Knoll2021-04-086-196/+0
| | | | | | | | | | | Remove 24bit packed pixel formats, as those would require unpacking on the CPU to be able to be processed efficiently on the GPU side. As such, they are not really formats that should be used for uncompressed video. Change-Id: I29c8b87aeaf97aee13ea2b93afd5115741198eee Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add a dependency to Qt Shader ToolsLars Knoll2021-04-072-13/+13
| | | | | | | | And build our shaders at compile time. Change-Id: I49db464826c51c6d9b3aba5d3f9551df9e6ba7dd Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move the texture uploading code into Qt MultimediaLars Knoll2021-04-075-242/+603
| | | | | | | | | | Qt Multimedia has now some generic helper functions to upload the video data into textures. This way, we can greatly simplify the rendering code in qtmultimediaquicktools. Change-Id: I5b0e3eb96cbcf79fe5e9757697f11b0183132b17 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use the infra in QVideoSurfaceFormat to get shaders and uniformsLars Knoll2021-04-072-10/+7
| | | | | | | | | | frame mapping is still done in qtmultimediaquicktools, but once that's moved as well, we can radically simplify the rendering code there. Change-Id: Ia56c8b62c5726f1bfea0b0c4c46a81e103141e9e Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move the shaders from the quick tools into QtMultimediaLars Knoll2021-04-072-0/+223
| | | | | | | | | | | | | The shader layout is pretty generic, and QVideoSurfaceFormat can give us both the shaders and uniform data that we need to render the video. All the user needs to do then is to provide geometry with a 2D texture coordinate to render the video onto any surface. Change-Id: I95006eaf4a6f039006b8a5da0f53143da03e1ecb Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* More work to enable HW decoding for Qt QuickLars Knoll2021-04-075-25/+15
| | | | | | | | | | | | | | | | | Request GL textures from the pipeline for now. Some initial code to also use the texture upload meta functionality in gstreamer, but that will require some more work so we don't make the GL context current in the wrong thread. The gstreamer VAAPI elements on AMD hardware (or in general...) seem to have some bugs. Converting a VASurface to a GL texture using the texture upload meta doesn't create an ARGB texture as promised, but does write some YUV data into the texture. And trying to map a SW buffer received from the VAAPI decoders fails. Change-Id: I9b629eb84f3f32adc23ae2e2fd1cd3e42e6afbc0 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix compilation errorsShawn Rutledge2021-04-062-0/+2
| | | | | | | | | | - unused arguments - comparison always true - functions with undefined return values - missing includes Change-Id: I6caa92de2c08ed597c42290dba1f22ec709ea6ca Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Start adding infrastructure to retrieve video frames as textureLars Knoll2021-04-067-18/+82
| | | | | | | | | | | | | | | We're using RHI here, as that's what we need for Qt Quick anyway. You can now set a QRhi object on QVideoSink. This can then be used internally to create textures of the required format instead of memory buffers. QVideoSurfaceFormat will now tell you how many planes are required for the format, and you can retrieve the textures for each plane from QVideoFrame. Change-Id: I86430db60a8f1aba07ec3b38e22b977cdaefaa0a Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of QAbstractVideoSurfaceLars Knoll2021-04-064-638/+0
| | | | | | | | We're not using it anymore, QVideoSink is the replacement. Change-Id: I6b29838c39db421d5bca281b28e97e0e0b72caad Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Smaller API cleanups in QVideoFrameLars Knoll2021-04-063-9/+3
| | | | | | | | | | | | Get rid of the buffer method. It's not used, and QAbstractVideoBuffer is private anyway. Use map() to access the data. Rename image() to toImage() to make it explicit that we're doing a conversion here. Change-Id: Ie2735bc1a5131c09098fa80c9df7bf5b165b557c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Move the PixelFormat enum from QVideoFrame to QVideoSurfaceFormatLars Knoll2021-04-0610-301/+305
| | | | | | Change-Id: Ifa888c74c397c640b19387a9ce624dfcf8269c2c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* QVideoFrame should be constructed with a QSurfaceFormatLars Knoll2021-04-062-26/+34
| | | | | | | | | | | | | This was inconsistent so far. QVideoFrame had half the properties of QVideoSurfaceFormat, but was missing some parts that are required to render the frame properly. Giving it a QVideoSurfaceFormat means that the QVideoFrame is self describing and can be rendered without additional information. Change-Id: Idb2757ee6a29020bd72c9c50891309ee8d8a8bfc Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove the handle type from QVideoSurfaceFormatLars Knoll2021-04-063-25/+6
| | | | | | | | | This is a property of the individual QVideoFrame, and doesn't belong here. Change-Id: I85f180ff46023f6a48ef856a356d9c45c3f6be1b Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Remove metaData from QVideoFrameLars Knoll2021-04-062-45/+0
| | | | | | | | We never used this feature for anything. Change-Id: I1597c49486dd155c4ef49da483536639affb0cbf Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Clean up most QAbstractVideoSurface usagesLars Knoll2021-04-062-3/+2
| | | | | | | | | | The class is scheduled to be removed, once all it's usages are gone. QVideoSink is the replacement going forward. Change-Id: Idc0a4133496839bf9f95aa9bcf7d6d37cacd549b Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Kill QVideoFrame::PixmapHandleLars Knoll2021-04-064-7/+1
| | | | | | | | | This didn't make sense since Qt 5.0, as a pixmap is the same as an image in Qt 5/6. It was also completely unused. Change-Id: I97d548ca288c9aebb580f0fbaf9fbbba488e197a Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Fix Windowed playback on macOSLars Knoll2021-04-061-0/+1
| | | | | | | | | | | | Windowed playback works again, and we're now using the new QVideoSink for that. Next step is to merge in the code for non windowed mode and ensure we can handle both. Change-Id: Ieaaad3adaa6c8964324ea55623380c630faea61b Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Get rid of QPainterVideoSurfaceLars Knoll2021-04-062-1849/+0
| | | | | | | | | | | The class was now unused. QVideoSink can paint in software, and the GL specific code needs to be replaced by RHI based anyway. Change-Id: I24fc065678204e38bda1e463ed94d34a06046adc Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix QML video renderingLars Knoll2021-04-061-0/+1
| | | | | | | | | | | Use the new QVideoSink class to get the video frames. Fix some APIs, so that we correctly connect VideoOutput and MediaPlayer. Change-Id: I65a0d045988c46a917f70dfb922c1bbdb32f6511 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Convert QGraphicsVideoItem to use QVideoSinkLars Knoll2021-04-062-1/+15
| | | | | | Change-Id: Id9af7457f590ed6387c36473e73c244ef44f8f8a Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Doris Verria <doris.verria@qt.io>
* Various improvements to QVideoFrame->QImage conversionLars Knoll2021-04-064-113/+384
| | | | | | | | | | | * Implement support for missing pixel formats, we are now able to convert all supported pixel formats to a QImage. * Ensure we always convert to a RGB32 or ARGB32_Premultiplied image * Add missing mappings to gstreamer formats Change-Id: I8816e0a42ced73c96dfff03f131d7a749b55ae36 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>