summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* ffmpeg: silence deprecation warningHEADdevTim Blechmann7 hours1-1/+1
| | | | | | Pick-to: 6.8 Change-Id: Idde3fbd75e8c1330fca70b55a7eabb497a3e655f Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: metadata - support for 2-letter language codesTim Blechmann33 hours1-1/+1
| | | | | | | | | 2-letter language codes seem to appear in video metadata. At least ffmpeg `-metadata:s:a:0 language=eng` results in an `en` language code. Pick-to: 6.5 6.7 6.8 Change-Id: I27e62dec0b1324a41f924da748afa112b87368e0 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Fix wrong frame rate and frame count when encoding custom video framesJøger Hansegård44 hours2-0/+29
| | | | | | | | | | | | | | | | | | This patch sets duration of AVPackets before they are sent from video encoding to muxer. This fixes issues where single-frame videos could not be played in ffplay and QMediaPlayer. It also fixes issues with lost frames and incorrect media duration. It is not clear why FFmpeg muxer is unable to produce valid video files without duration estimates, but internal muxer function guess_pkt_duration appears to be assuming that either duration is already set, or avg_frame_rate is set on the stream before avformat_write_header is called. Fixes: QTBUG-125957 Pick-to: 6.8 Change-Id: Ibb6853a356242271be404f26715095be835a1924 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Avfcamera: Fix comparison error when adding camera formatsLars Sutterud47 hours1-2/+3
| | | | | | | | | | | | A comparison between float and double prevented Qt from adding camera formats for certain cameras, due to small differences between the values. This change fixes that by adding/subtracting 0.001 to hide the fuzziness. Pick-to: 6.8 6.7 6.5 Task-number: QTBUG-124725 Change-Id: I87d05b57e60667fef1569a5087d3d88897798de8 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Fix emitting 'reday to send' signals if mediaRecorder.autoStop enabledArtem Dyomin2 days11-26/+72
| | | | | | | | | Media frame inputs shouldn't emit 'ready to send signals' after sending the last frame if mediaRecorder.autoStop is enabled. Pick-to: 6.8 Change-Id: Ib99f579b4b75ba7d6c8a08c11ae17eb2c1db2533 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* QAVFCamera - skip any resolution adjustments on macOSTimur Pocheptsov3 days1-0/+4
| | | | | | | | | | | | Apparently videoOrientation can be reported as portrait, even though the resolution we want to use is landscape, transposing we end up with errors coming from hwaccell (where the resolution is not transposed). Pick-to: 6.8 6.7 6.7.2 6.5 Fixes: QTBUG-119102 Change-Id: I8aa367ccc5e45902244e0393aa0fc0da0b19d920 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: improve duration/position queriesTim Blechmann3 days7-27/+81
| | | | | | | | | | * move position/duration queries to QGstElement * reuse GstQuery element for querying position * report errors when queries fail Pick-to: 6.5 6.7 6.8 Change-Id: Ie4116bf4307a36ff07ed603f928435ffe2d07a5e Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* QSoundEffect: fix memory corruptionTim Blechmann4 days1-2/+1
| | | | | | | | | | | `QSample::release` was called multiple times: once from `QSoundEffect::setSource` and once from `SampleDeleter`. This caused asan failures. Fixes: QTBUG-125213 Pick-to: 6.5 6.7 6.8 Change-Id: Iaede2ca3c13143d468159097b312535f5dd4d085 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Remove useless code: format.setMirroredArtem Dyomin4 days1-5/+1
| | | | | | | | | | | The code sets 'mirrored' to a copy of QVideoFrameFormat, it doesn't make any sense as the 'detach' is called on in the setter, and the original format will not be changed. Pick-to: 6.7 6.5 Change-Id: Ie54f9d4dca3096da347d49988b21bec54df2ae0b Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: QGstreamerVideoSink - prefix members with m_Tim Blechmann4 days2-46/+48
| | | | | | | | No functional change Pick-to: 6.5 6.7 6.8 Change-Id: I7862b1bcd18a8915436ce41d06e3efeccb4d5ea8 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: video output - simplify implementationTim Blechmann4 days2-34/+32
| | | | | | | | | | Instead of creating convert/scale elements explicitly, we create a bin containing both elements. This simplifies both detection and pipeline management logic. Pick-to: 6.5 6.7 6.8 Change-Id: I902f1993e1a059b168118e7252c42a745c608601 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* PlatformMediaPlayer - silence clang-tidy warningsTim Blechmann5 days2-5/+5
| | | | | | Pick-to: 6.5 6.7 6.8 Change-Id: Id25ea00d1eab5e557cf4d170464ec791b0c4280e Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: QGstreamerVideoOutput - prefix members with m_Tim Blechmann5 days2-82/+82
| | | | | | | | No functional change. Pick-to: 6.5 6.7 6.8 Change-Id: Ib481de320d327941d9d25bb7ead77fe7239705d6 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Backends: fix `emit` keywordsTim Blechmann8 days3-14/+14
| | | | | | | | thanks to clazy Pick-to: 6.5 6.7 Change-Id: I994f3ba61f5b0e806839da6c63b35023120bd1e2 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: Audio Decoder - fix durationsTim Blechmann8 days1-2/+2
| | | | | | | | invalid duration/position is -1 according to the unit tests. Pick-to: 6.5 6.7 Change-Id: I5f65f2086f0dd8a5ccf4fe6a482bce18a8b55c1a Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* wasm: fix video play on FirefoxLorn Potter8 days2-2/+2
| | | | | | | | | | | For whatever reason, the Qt global static was failing to return true or false and returned the pointer instead. Pick-to: 6.7 Fixes: QTBUG-125632 Change-Id: If07fc1c19ca34870f1529ab352d47a9939d93b65 Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* GStreamer: Media player - improve duration handlingTim Blechmann8 days2-18/+18
| | | | | | | | | * introduce `updateDurationFromPipeline` * use cached duration during EOS Pick-to: 6.5 6.7 Change-Id: Idfb1e38e07964e9fb5a592603c6d21eb0b4eb394 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Fix startTime of created audio buffers upon playbackArtem Dyomin9 days4-30/+31
| | | | | | | | | | | The resampler should consider a time point upon the initialization in order to get proper startTime to users. Change-Id: Ia7e58794dd540c1cc1b7a3d2b8631ef4571a287b Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Harden the logic of emitting frames by QAudioBufferOutputArtem Dyomin9 days2-17/+41
| | | | | | | | | | | | | We need to define explicitly that only the first (not repeated) frame should be pushed to QAudioBufferOutput to get round potential duplications. Task-number: QTBUG-111094 Change-Id: I0f50e59154decc83905ef12af40a7975bba43eb5 Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Implement QAudioBufferOutput, as a custom output for QMediaPlayerArtem Dyomin9 days14-33/+312
| | | | | | | | | | | | | | | | | | | | | | Users want to be able to visualize output audio data from QMediaPlayer. The current patch implements a mechnism allowing getting decoded audio data, so that users could visualize what they want. The class is a part of programmatic IO that we add in 6.8. The functionality will allow us to harden QtMM integration tests. [ChangeLog] Added QAudioBufferOutput allowing to get the decoded audio data from QMediaPlayer Task-number: QTBUG-111094 Change-Id: I5f83e7835965f1e7e47b138da0ce82f650abaa4b Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io> Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Add the property QMediaRecorder::autoStopArtem Dyomin9 days14-4/+119
| | | | | | | | | | | | | | | | | The property is supposed to help users to write a well-structured code. It means that users could just take care of pushing media frames to inputs and handling the end of the source streams. Thus, the user code that controls media inputs will only send frames there, and don't call QMediaRecorder::stop after all streams has been finished. The same qml property will allow users to follow a good declarative style instead of calling calling MediaRecorder::stop. [ChangeLog] Added the property QMediaRecorder::autoStop making the media recorder to stop at the and of input streams. Change-Id: Ifa136f6e125f039bf8b0667bf205f8686a201a89 Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Implement support of different input audio buffer size in the recorderArtem Dyomin9 days2-43/+142
| | | | | | | | | | | | Many of FFmpeg codecs support only fixed buffer size, that is defined in the codec variables. The patch applies writing of AVFrames of fixed sizes if FFmpeg requires it. The fix is need for correct working of QAudioBufferInput Change-Id: I40681e7c4b8781577f98fbc49f8ee609307d7f16 Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Expose QAbstractVideoBuffer in public APIArtem Dyomin9 days19-99/+164
| | | | | | | | | | | | | | | | | | QAbstractVideoBuffer is needed for users to be able to provide custom data to QVideoFrame. We already have QAbstractVideoBuffer as a private implementation, and QAbstractVideoBuffer was public in Qt5. Currently, the video buffer doesn't provide any functionality to work with hw textures directly. If a user works with GPU textures, they will need to map/unmap it by overriding matching methods. [ChangeLog] Added QAbstractVideoBuffer that allows to provide custom data to QVideoFrame. Added a QVideoFrame's constructor taking QAbstractVideoBuffer. Change-Id: Iba5658f228a2373124c571ff8cf71595ef970b43 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
* Fix documentation of QVideoFrame's constructorArtem Dyomin9 days1-8/+10
| | | | | | | | Fixed description of a policy of pixel data copying. Change-Id: If6cb3cc075e9625d7a7edba587027976617d3722 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
* Enhance mapping of QImageVideoBuffer: don't detach in read only modeArtem Dyomin9 days1-1/+4
| | | | | | | | | | | | We shouldn't detach image in read only mode to get round potential pixel copies if the user still hold the original image. The same approach already works for QMemoryVideoBuffer Pick-to: 6.7 6.5 Change-Id: I5334d69d1013178760ff535db8dda5fca1e7fd3e Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
* FFmpeg: Skip changing state/status if playbackengine was recreatedLars Sutterud9 days1-3/+8
| | | | | | | | | | | | | Temporary fix in to make sure we don't change the PlaybackState or MediaStatus if new media has already been loaded, e.g. as a response to positionChanged signal emitted from endOfStream(). The fix prevents a bug where this assert in setMediaAsync() failed: Q_ASSERT(mediaStatus() == QMediaPlayer::LoadingMedia); Task-number: QTBUG-124586 Change-Id: I7bdfdc40a2a71ee53b9beaf0d8bd1d989a256906 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: player - improve metadata handlingTim Blechmann9 days1-9/+10
| | | | | | | | | * don't handle `GST_MESSAGE_DURATION_CHANGED` during preroll * move Duration/Url retrieval out of `parseStreamsAndMetadata` Pick-to: 6.5 6.7 Change-Id: I5e9b3d985ca7761cd5cc7f67ce85d19ba163eda1 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: custom camera - add factory to create camera from elementTim Blechmann9 days5-5/+58
| | | | | | | | | | | Adding a new factory that allows application code to fully manage the `GstElement*` used in the QCaptureSession. Task-number: QTBUG-123495 Task-number: QTBUG-112999 Pick-to: 6.5 6.7 Change-Id: Ia37227e31102f62cf78562dca283b0bce7823720 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Rename MapData::nPlane => planeCount, size => dataSizeArtem Dyomin10 days15-77/+77
| | | | | | | | | | Preparation for exposing QAbstractVideoBuffer to the public API. New naming seems to be more consistent with the purpose of the variables. Change-Id: Iab1b45e52abf57508327034e2fef2134a30ef372 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Tim Blechmann <tim@klingt.org>
* GStreamer: QGstreamerVideoSink - improve conversion element overrideTim Blechmann10 days1-14/+28
| | | | | | | | | | | | | By using `gst_parse_launch` one can inject more than one element and set element properties via a gst-launch string. this is closer to `QT_GSTREAMER_PLAYBIN_CONVERT` from the qt-5 days. [ChangeLog] QVideoSink: GStreamer - allow override of conversion element via environment variable Pick-to: 6.5 6.7 Change-Id: I086bddb4962c216823d7b6a19523f0af74c767e9 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Move MapMode debug output operator from qabstractvideobuffer_p.hArtem Dyomin11 days4-28/+24
| | | | | | | | | Preparation for exposing QAbstractVideoBuffer. The debug operator mustn't be in qabstractvideobuffer_p.h. Change-Id: I225f63debd9f6adffa04df4e043443feaf15bb08 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Tim Blechmann <tim@klingt.org>
* Android: doc update of deprecating the Android back-endRami Potinkara11 days1-0/+2
| | | | | | | | | [ChangeLog][Multimedia][Android] Deprecated MediaCodec Android back-end Task-number: QTBUG-125370 Change-Id: I4909d5d968b9aaeeaed6cda98ac5063e79d0dd98 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
* GStreamer: clean up metadata handlingTim Blechmann11 days4-77/+140
| | | | | | | | | | | * simplify qgstreamerformatinfo.cpp using string_views * move caps->metadata parsing out of qgstreamermediaplayer.cpp * add methods to extend QMediaMetaData rather than creating/merging them * unit test Pick-to: 6.5 6.7 Change-Id: I011629ef149f4a0b4deaef8ee07283b847b93099 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: more qDebug support for gstreamer typesTim Blechmann11 days2-8/+67
| | | | | | Pick-to: 6.5 6.7 Change-Id: I73d0e579beb97c3b1352dee23087d5247b332490 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: silence deprecation warningTim Blechmann11 days1-6/+6
| | | | | Change-Id: Ib7932e907477b67561ad2e846f824f4df0639e27 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Deprecate internal methods of QVideoFrameArtem Dyomin12 days30-71/+144
| | | | | | | | | | | | | | | | | | We're going to expose QAbstractVideoBuffer, and the internal methods of QVideoFrame doesn't work well with it. - QVideoFrame::videoBuffer() is not needed as we don't want to get users access to it. - The constructor (QAbstractVideoBuffer*, QVideoFrameFormat) is not needed as we'll add a new one with unique_ptr instead. Let's use private API instead of the internal methods. The private construction also allows to avoid dynamic cast upon the construction. After adding public API, some of changes, especially in tests, might be reverted to use the new QVideoFrame's constructor. Change-Id: Id25d9e7faf9e88ce7f57492ba173dd168d6cf1de Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Move QHwVideoBuffer to a separate fileArtem Dyomin12 days16-63/+90
| | | | | | | Preparation for exposing QAbstractVideoBuffer Change-Id: I46e8bc095f39a2166baa9d34a6eb27cac6496377 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Add method format to QAbstractVideoBufferArtem Dyomin12 days8-0/+17
| | | | | | | | QAbstractVideoBuffer will hold the format instead of passing it to QVideoFrame's constructor. Change-Id: Ib75be337832f979aa2a4fac0193ab1c0918a3148 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Add QtVideo::MapMode, deprecate QVideoFrame::MapModeArtem Dyomin12 days33-147/+249
| | | | | | | | | | | | | | | QAbstractVideoBuffer is going to be exposed in the public API, and it will use MapMode, so the enum should be in a common namespace. The only drawback of the deprecation is that QVideoFrame::mapMode() still returns QVideoFrame::MapMode. However, calling the method will not cause deprecation warnings, because enum values are deprecated, not the enum as is. [ChangeLog] Added the namespace QtVideo::MapMode, deprecated QVideoFrame::MapMode. Change-Id: I5248c76c01f07a33f0f5a67e7db2d5072af5383d Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Decouple QAbstractVideoBuffer from hw related interfaceArtem Dyomin12 days26-127/+107
| | | | | | | It's a preparation to expose QAbstractVideoBuffer in the public API. Change-Id: I5c445b16120b45a3667b1359a1a171d1a227dd01 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: improve buffer progress handlingTim Blechmann12 days2-11/+15
| | | | | | | | | | | * avoid duplicate `bufferProgressChanged` messages for the same value * stopOrEOS should change the buffer progress to zero (according to the processEOS untit tests) Pick-to: 6.5 6.7 Change-Id: I64c6308cab7135f65d3f4aadb1c789b2b2cc9350 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io>
* Improve logging of loaded stubsArtem Dyomin2024-05-243-12/+22
| | | | | | | | | | | | VAAPI symbols can be loaded by plugin and by shared stub; Let's distinguish between logs in these cases. Amends 1f2171249486fdf6cb1f136e125aa54693e5f846 Pick-to: 6.7 6.5 Change-Id: Iac462dd7908210ee0f8896c13ab1858e5f932367 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io>
* Implement QAudioBufferInput and QVideoFrameInputArtem Dyomin2024-05-248-25/+380
| | | | | | | | | [ChangeLog] Added classes QAudioBufferInput and QVideoFrameInput allowing to send custom media data to QMediaRecorder. Task-number: QTBUG-125401 Change-Id: I8792f84e39f44eabb9349e3ea1d90c1b4cc971ca Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* Plugins: avoid allocationsTim Blechmann2024-05-242-5/+7
| | | | | | | | | | `QPlatformNativeInterface` uses `QByteArray` in the interface. The plugins use string literals, which result in memory allocations. We can avoid them by use bytearray literals. Pick-to: 6.5 6.7 Change-Id: I6160231fc651b8eb524e6026b04584df219b083f Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: improve element availability checksTim Blechmann2024-05-2419-152/+153
| | | | | | | | | | | | We move the element availability checks out to a separate function. This allows us to * test for element availability of elements that are dynamically created * use the ctor to construct all necessary objects instead of going through a separate `create` step. This improves code consistency Pick-to: 6.5 6.7 Change-Id: I5b58decef1a865eaa7edad62ed9f4c6ff02f56a9 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: introduce `QGstElement::findFactory`Tim Blechmann2024-05-246-22/+24
| | | | | | | | Small convenience function to find element factory. Pick-to: 6.5 6.7 Change-Id: I054092bc8b81e543c4d46e72015531dd413819c9 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: move more functionality into helper objectsTim Blechmann2024-05-2413-92/+118
| | | | | | | | | | | * rename `QGstStructure` to `QGstStructureView` and remove all memory management functionality * implement `caps` and `tags` for `QGstStructureView` to move it out of application code. * implement `tags` for `QGstPad` to simplify application code. Change-Id: I8621aff9d06217c15fc2db736876f1f7d384a2e5 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: QMediaPlayer - improve `position` handlingTim Blechmann2024-05-242-10/+20
| | | | | | | | | | | | Do not override `QPlatformMediaPlayer::position`, so that we won't always query the pipeline, but instead return the last value from a timer-based position update. While this gives us more granular position updates, it will ensure that we obtain the correct positions for begin/end. Pick-to: 6.5 6.7 Change-Id: Ie637df2c63b2ae2fe9d0e0bc6823d907a10bad7f Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* GStreamer: introduce custom cameraTim Blechmann2024-05-245-1/+71
| | | | | | | | | | Adding support for custom cameras to QCaptureSession via `makeCustomGStreamerCamera`. Task-number: QTBUG-123495 Pick-to: 6.5 6.7 Change-Id: I2c9bfad1b1279de15e3b7a67cf41323ecf8c4983 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* GStreamer: better getter for QGStreamerPlatformSpecificInterfaceTim Blechmann2024-05-242-1/+8
| | | | | | Pick-to: 6.5 6.7 Change-Id: I57118ef632af4e409b4fbeb99113dad2d566bedc Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>