diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-05-14 11:07:51 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-05-14 17:52:23 +0000 |
commit | f4890761767f911c4a8fb33dae088d44436a6032 (patch) | |
tree | 0776985012b83f7923625ce70f447422a9e74c31 | |
parent | 5c55197f7bda409a390fa50e0887fef013c6b5bb (diff) |
Re-add QtMultimedia/Widgets
Fix it to build with
qtmultimedia/9a4822037def3b9d48abea8bbfd7ea20fd19849b (wip/qt6).
Remove typesystem_multimedia_forward_declarations.xml as the forward
declarations of QVideoWidget and QGraphicsVideoItem no longer exist.
Fix the tests.
Fix the player example to run/crash.
Task-number: PYSIDE-1482
Change-Id: I340693e3510347f95b55395985bd2b0f294769a1
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit 812fa2f59853fa693b77c04d4afaaee722931029)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
9 files changed, 170 insertions, 529 deletions
diff --git a/examples/multimedia/player/player.py b/examples/multimedia/player/player.py index b2adebb5c..44df8853b 100644 --- a/examples/multimedia/player/player.py +++ b/examples/multimedia/player/player.py @@ -43,7 +43,7 @@ import sys from PySide6.QtCore import QStandardPaths, Qt -from PySide6.QtGui import QAction, QIcon, QKeySequence +from PySide6.QtGui import QAction, QIcon, QKeySequence, QScreen from PySide6.QtWidgets import (QApplication, QDialog, QFileDialog, QMainWindow, QSlider, QStyle, QToolBar) from PySide6.QtMultimedia import QMediaPlayer, QMediaPlaylist @@ -100,7 +100,7 @@ class MainWindow(QMainWindow): self.volumeSlider.setOrientation(Qt.Horizontal) self.volumeSlider.setMinimum(0) self.volumeSlider.setMaximum(100) - self.volumeSlider.setFixedWidth(app.desktop().availableGeometry(self).width() / 10) + self.volumeSlider.setFixedWidth(self.screen().availableGeometry().width() / 10) self.volumeSlider.setValue(self.player.volume()) self.volumeSlider.setTickInterval(10) self.volumeSlider.setTickPosition(QSlider.TicksBelow) @@ -153,7 +153,7 @@ class MainWindow(QMainWindow): if __name__ == '__main__': app = QApplication(sys.argv) mainWin = MainWindow() - availableGeometry = app.desktop().availableGeometry(mainWin) + availableGeometry = mainWin.screen().availableGeometry() mainWin.resize(availableGeometry.width() / 3, availableGeometry.height() / 2) mainWin.show() sys.exit(app.exec()) diff --git a/sources/pyside6/PySide6/QtMultimedia/CMakeLists.txt b/sources/pyside6/PySide6/QtMultimedia/CMakeLists.txt index 763fb5a06..a005667cb 100644 --- a/sources/pyside6/PySide6/QtMultimedia/CMakeLists.txt +++ b/sources/pyside6/PySide6/QtMultimedia/CMakeLists.txt @@ -1,98 +1,37 @@ project(QtMultimedia) set(QtMultimedia_SRC -${QtMultimedia_GEN_DIR}/qabstractaudiodeviceinfo_wrapper.cpp -${QtMultimedia_GEN_DIR}/qabstractaudioinput_wrapper.cpp -${QtMultimedia_GEN_DIR}/qabstractaudiooutput_wrapper.cpp -${QtMultimedia_GEN_DIR}/qabstractvideobuffer_wrapper.cpp -${QtMultimedia_GEN_DIR}/qabstractvideofilter_wrapper.cpp -${QtMultimedia_GEN_DIR}/qabstractvideosurface_wrapper.cpp ${QtMultimedia_GEN_DIR}/qaudiobuffer_wrapper.cpp ${QtMultimedia_GEN_DIR}/qaudiodecoder_wrapper.cpp -${QtMultimedia_GEN_DIR}/qaudiodecodercontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qaudiodeviceinfo_wrapper.cpp -${QtMultimedia_GEN_DIR}/qaudioencodersettingscontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qaudioencodersettings_wrapper.cpp ${QtMultimedia_GEN_DIR}/qaudioformat_wrapper.cpp -${QtMultimedia_GEN_DIR}/qaudioinputselectorcontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qaudioinput_wrapper.cpp -${QtMultimedia_GEN_DIR}/qaudiooutputselectorcontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qaudiooutput_wrapper.cpp -${QtMultimedia_GEN_DIR}/qaudioprobe_wrapper.cpp -${QtMultimedia_GEN_DIR}/qaudiorecorder_wrapper.cpp -${QtMultimedia_GEN_DIR}/qaudiorolecontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qaudio_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcameracapturebufferformatcontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcameracapturedestinationcontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcameracontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcameraexposurecontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qcameraexposure_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcamerafeedbackcontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qcameraformat_wrapper.cpp ${QtMultimedia_GEN_DIR}/qcamerafocus_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcameraflashcontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcamerafocuscontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcamerafocuszone_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcamera_frameraterange_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcameraimagecapturecontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qcameraimagecapture_wrapper.cpp ${QtMultimedia_GEN_DIR}/qcameraimageprocessing_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcameraimageprocessingcontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcamerainfocontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qcamerainfo_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcameralockscontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcameraviewfindersettingscontrol2_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcameraviewfindersettingscontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcameraviewfindersettings_wrapper.cpp ${QtMultimedia_GEN_DIR}/qcamera_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcamerazoomcontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qcustomaudiorolecontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qimageencodercontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qimageencodersettings_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediaaudioprobecontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediaavailabilitycontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediabindableinterface_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediacontainercontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediacontent_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediacontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediagaplessplaybackcontrol_wrapper.cpp -# Causes compile errors: ${QtMultimedia_GEN_DIR}/qmediametadata_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmedianetworkaccesscontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediaobject_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediaplayercontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediacapturesession_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediadevices_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediaencoderbase_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediaencoder_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediaencodersettings_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediaformat_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediametadata_wrapper.cpp ${QtMultimedia_GEN_DIR}/qmediaplayer_wrapper.cpp ${QtMultimedia_GEN_DIR}/qmediaplaylist_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediarecordercontrol_wrapper.cpp ${QtMultimedia_GEN_DIR}/qmediarecorder_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediaresource_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediaservice_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediaservicecamerainfointerface_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediaservicedefaultdeviceinterface_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediaservicefeaturesinterface_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediaserviceproviderhint_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediaservicesupporteddevicesinterface_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediaservicesupportedformatsinterface_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediastreamscontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediatimeinterval_wrapper.cpp ${QtMultimedia_GEN_DIR}/qmediatimerange_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmediavideoprobecontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmetadatareadercontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmetadatawritercontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qmultimedia_wrapper.cpp -${QtMultimedia_GEN_DIR}/qradiodatacontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qradiodata_wrapper.cpp -${QtMultimedia_GEN_DIR}/qradiotunercontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qradiotuner_wrapper.cpp +${QtMultimedia_GEN_DIR}/qmediatimerange_interval_wrapper.cpp ${QtMultimedia_GEN_DIR}/qsoundeffect_wrapper.cpp -${QtMultimedia_GEN_DIR}/qsound_wrapper.cpp -${QtMultimedia_GEN_DIR}/qvideodeviceselectorcontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qvideoencodersettingscontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qvideoencodersettings_wrapper.cpp -${QtMultimedia_GEN_DIR}/qvideofilterrunnable_wrapper.cpp ${QtMultimedia_GEN_DIR}/qvideoframe_wrapper.cpp -${QtMultimedia_GEN_DIR}/qvideoprobe_wrapper.cpp -${QtMultimedia_GEN_DIR}/qvideorenderercontrol_wrapper.cpp -${QtMultimedia_GEN_DIR}/qvideosurfaceformat_wrapper.cpp -${QtMultimedia_GEN_DIR}/qvideowindowcontrol_wrapper.cpp +${QtMultimedia_GEN_DIR}/qvideoframeformat_wrapper.cpp +${QtMultimedia_GEN_DIR}/qvideosink_wrapper.cpp # module is always needed ${QtMultimedia_GEN_DIR}/qtmultimedia_module_wrapper.cpp diff --git a/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia.xml b/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia.xml index 25af801ba..54f440880 100644 --- a/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia.xml +++ b/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia.xml @@ -2,7 +2,7 @@ <!-- /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt for Python. @@ -40,6 +40,148 @@ ****************************************************************************/ --> <typesystem package="PySide6.QtMultimedia"> - <load-typesystem name="QtMultimedia/typesystem_multimedia_common.xml" generate="yes"/> - <load-typesystem name="QtMultimedia/typesystem_multimedia_forward_declarations.xml" generate="yes"/> + <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/> + <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/> + <load-typesystem name="QtNetwork/typesystem_network.xml" generate="no"/> + + <namespace-type name="QAudio"> + <enum-type name="Error"/> + <enum-type name="Mode"/> + <enum-type name="Role" since="5.6"/> + <enum-type name="State"/> + <enum-type name="VolumeScale" since="5.8"/> + </namespace-type> + + <value-type name="QAudioBuffer"/> + <object-type name="QAudioDecoder"> + <enum-type name="Error"/> + <enum-type name="State"/> + </object-type> + <value-type name="QAudioFormat"> + <enum-type name="SampleFormat" since="6.1"/> + </value-type> + <value-type name="QAudioDeviceInfo"/> + + <object-type name="QAudioInput"> + <modify-function signature="start()"> + <modify-argument index="return"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + <modify-function signature="start(QIODevice*)"> + <modify-argument index="1"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + </object-type> + + <object-type name="QAudioOutput"> + <modify-function signature="start()"> + <modify-argument index="return"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + <modify-function signature="start(QIODevice*)"> + <modify-argument index="1"> + <define-ownership class="target" owner="c++"/> + </modify-argument> + </modify-function> + </object-type> + + <object-type name="QCamera"> + <enum-type name="Error"/> + <enum-type name="Status"/> + </object-type> + <object-type name="QCameraExposure"> + <enum-type name="FlashMode"/> + <enum-type name="ExposureMode"/> + <enum-type name="TorchMode" since="6.1"/> + <modify-function signature="supportedApertures(bool*)const" remove="all"/> + <modify-function signature="supportedIsoSensitivities(bool*)const" remove="all"/> + <modify-function signature="supportedShutterSpeeds(bool*)const" remove="all"/> + </object-type> + <value-type name="QCameraFormat" since="6.1"/> + <object-type name="QCameraFocus"> + <enum-type name="FocusMode"/> + </object-type> + <value-type name="QCameraInfo"> + <enum-type name="Position" since="6.1"/> + </value-type> + <object-type name="QCameraImageCapture"> + <enum-type name="Error"/> + </object-type> + <object-type name="QCameraImageProcessing"> + <enum-type name="WhiteBalanceMode"/> + <enum-type name="ColorFilter"/> + </object-type> + + <value-type name="QImageEncoderSettings"> + <enum-type name="FileFormat" since="6.1"/> + <enum-type name="Quality" since="6.1"/> + </value-type> + + <object-type name="QMediaCaptureSession" since="6.1"/> + + <object-type name="QMediaEncoderBase" since="6.1"> + <enum-type name="Error"/> + <enum-type name="State"/> + <enum-type name="Status"/> + </object-type> + <object-type name="QMediaEncoder" since="6.1"/> + + <value-type name="QMediaEncoderSettings" since="6.1"> + <enum-type name="EncodingMode"/> + <enum-type name="Quality"/> + <enum-type name="ResolveFlags"/> + </value-type> + + <object-type name="QMediaDevices" since="6.1"/> + + <value-type name="QMediaFormat" since="6.1"> + <enum-type name="AudioCodec"/> + <enum-type name="ConversionMode"/> + <enum-type name="FileFormat"/> + <enum-type name="VideoCodec"/> + </value-type> + + <value-type name="QMediaMetaData" since="6.1"> + <enum-type name="Key"/> + </value-type> + <object-type name="QMediaPlayer"> + <enum-type name="MediaStatus"/> + <enum-type name="PlaybackState" since="6.1"/> + <enum-type name="Error"/> + </object-type> + <object-type name="QMediaPlaylist"> + <enum-type name="PlaybackMode"/> + <enum-type name="Error"/> + </object-type> + <object-type name="QMediaRecorder"> + <enum-type name="CaptureMode" since="6.1"/> + </object-type> + <value-type name="QMediaTimeRange"> + <value-type name="Interval"/> + </value-type> + + <object-type name="QSoundEffect"> + <enum-type name="Loop"/> + <enum-type name="Status"/> + </object-type> + + <value-type name="QVideoFrame"> + <enum-type name="HandleType"/> + <enum-type name="MapMode" since="6.1"/> + <modify-function signature="bits()"> + <inject-code file="../glue/qtmultimedia.cpp" snippet="qvideoframe-bits"/> + </modify-function> + <modify-function signature="bits(int)" remove="all"/> + <modify-function signature="bits(int)const" remove="all"/> + </value-type> + <value-type name="QVideoFrameFormat" since="6.1"> + <enum-type name="Direction"/> + <enum-type name="PixelFormat"/> + <enum-type name="YCbCrColorSpace"/> + </value-type> + + <object-type name="QVideoSink" since="6.1"/> </typesystem> diff --git a/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia_common.xml b/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia_common.xml deleted file mode 100644 index e4107e2fe..000000000 --- a/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia_common.xml +++ /dev/null @@ -1,372 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt for Python. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ ---> -<typesystem package="PySide6.QtMultimedia"> - <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/> - <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/> - <load-typesystem name="QtNetwork/typesystem_network.xml" generate="no"/> - - <namespace-type name="QAudio"> - <enum-type name="Error"/> - <enum-type name="Mode"/> - <enum-type name="Role" since="5.6"/> - <enum-type name="State"/> - <enum-type name="VolumeScale" since="5.8"/> - </namespace-type> - - <value-type name="QVideoSurfaceFormat"> - <enum-type name="Direction"/> - <enum-type name="YCbCrColorSpace"/> - </value-type> - <object-type name="QAbstractVideoBuffer"> - <enum-type name="HandleType"/> - <enum-type name="MapMode"/> - <modify-function signature="map(QAbstractVideoBuffer::MapMode,int*,int*)" remove="all"/> - <!-- TODO: discuss a way to have this working with the virtual method. - <modify-function signature="map(QAbstractVideoBuffer::MapMode,int*,int*)"> - <modify-argument index="0"> - <replace-type modified-type="PyObject"/> - </modify-argument> - <modify-argument index="2"> - <remove-argument/> - </modify-argument> - <modify-argument index="3"> - <remove-argument/> - </modify-argument> - <inject-code class="target" position="beginning"> - <insert-template name="fix_arg,int*,int*"/> - </inject-code> - </modify-function> - --> - <!-- TODO: PYSIDE-354, arrays are not supported --> - <modify-function signature="mapPlanes(QAbstractVideoBuffer::MapMode,int*,int[4],uchar*[4])" remove="all"/> - </object-type> - <object-type name="QAbstractVideoSurface"> - <enum-type name="Error"/> - </object-type> - <object-type name="QAbstractVideoFilter"> - <modify-function signature="createFilterRunnable()"> - <modify-argument index="return"> - <define-ownership class="native" owner="c++"/> - </modify-argument> - </modify-function> - </object-type> - <value-type name="QVideoFrame"> - <enum-type name="FieldType"/> - <enum-type name="PixelFormat"/> - <modify-function signature="bits()"> - <inject-code file="../glue/qtmultimedia.cpp" snippet="qvideoframe-bits"/> - </modify-function> - <modify-function signature="bits(int)" remove="all"/> - <modify-function signature="bits(int)const" remove="all"/> - </value-type> - - <value-type name="QAudioBuffer"/> - <object-type name="QAudioDecoder"> - <enum-type name="Error"/> - <enum-type name="State"/> - </object-type> - <value-type name="QAudioFormat"> - <enum-type name="Endian"/> - <enum-type name="SampleType"/> - </value-type> - <value-type name="QAudioDeviceInfo"/> - <object-type name="QAbstractAudioDeviceInfo"/> - - <object-type name="QAbstractAudioOutput"> - <modify-function signature="start()"> - <modify-argument index="return"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - <modify-function signature="start(QIODevice*)"> - <modify-argument index="1"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - </object-type> - - <object-type name="QAbstractAudioInput"> - <modify-function signature="start()"> - <modify-argument index="return"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - <modify-function signature="start(QIODevice*)"> - <modify-argument index="1"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - </object-type> - - <object-type name="QAudioDecoderControl"/> - <object-type name="QAudioProbe"/> - <value-type name="QAudioEncoderSettings"/> - <object-type name="QAudioEncoderSettingsControl"> - <modify-function signature="supportedSampleRates(const QAudioEncoderSettings &,bool*)const" remove="all"/> - </object-type> - - <object-type name="QAudioInput"> - <modify-function signature="start()"> - <modify-argument index="return"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - <modify-function signature="start(QIODevice*)"> - <modify-argument index="1"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - </object-type> - <object-type name="QAudioInputSelectorControl"/> - - <object-type name="QAudioOutput"> - <modify-function signature="start()"> - <modify-argument index="return"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - <modify-function signature="start(QIODevice*)"> - <modify-argument index="1"> - <define-ownership class="target" owner="c++"/> - </modify-argument> - </modify-function> - </object-type> - <object-type name="QAudioOutputSelectorControl"/> - <object-type name="QAudioRecorder"/> - <object-type name="QAudioRoleControl"/> - - <object-type name="QCamera"> - <value-type name="FrameRateRange"/> - <enum-type name="CaptureMode" flags="CaptureModes"/> - <enum-type name="Error"/> - <enum-type name="LockChangeReason"/> - <enum-type name="LockStatus"/> - <enum-type name="LockType" flags="LockTypes"/> - <enum-type name="Position"/> - <enum-type name="State"/> - <enum-type name="Status"/> - <modify-function signature="setViewfinder(QVideoWidget*)"> - <modify-argument index="1"> - <replace-type modified-type="QObject*"/> - </modify-argument> - <inject-code class="target" position="beginning" file="../glue/qtmultimedia.cpp" snippet="upcast"/> - </modify-function> - <modify-function signature="setViewfinder(QGraphicsVideoItem*)"> - <modify-argument index="1"> - <replace-type modified-type="QObject*"/> - </modify-argument> - <inject-code class="target" position="beginning" file="../glue/qtmultimedia.cpp" snippet="upcast"/> - </modify-function> - </object-type> - <object-type name="QCameraCaptureBufferFormatControl"/> - <object-type name="QCameraCaptureDestinationControl"/> - <object-type name="QCameraControl"> - <enum-type name="PropertyChangeType"/> - </object-type> - <object-type name="QCameraExposure"> - <enum-type name="FlashMode" flags="FlashModes"/> - <enum-type name="ExposureMode"/> - <enum-type name="MeteringMode"/> - <modify-function signature="supportedApertures(bool*)const" remove="all"/> - <modify-function signature="supportedIsoSensitivities(bool*)const" remove="all"/> - <modify-function signature="supportedShutterSpeeds(bool*)const" remove="all"/> - </object-type> - <object-type name="QCameraExposureControl"> - <enum-type name="ExposureParameter"/> - <modify-function signature="supportedParameterRange(QCameraExposureControl::ExposureParameter,bool*)const" remove="all"/> - </object-type> - <object-type name="QCameraFeedbackControl"> - <enum-type name="EventType"/> - </object-type> - <value-type name="QCameraFocusZone"> - <enum-type name="FocusZoneStatus"/> - </value-type> - <object-type name="QCameraFocus"> - <enum-type name="FocusMode" flags="FocusModes"/> - <enum-type name="FocusPointMode"/> - </object-type> - <object-type name="QCameraFlashControl"/> - <object-type name="QCameraFocusControl"/> - <value-type name="QCameraInfo"/> - <object-type name="QCameraInfoControl"/> - <object-type name="QCameraImageCapture"> - <enum-type name="CaptureDestination" flags="CaptureDestinations"/> - <enum-type name="DriveMode"/> - <enum-type name="Error"/> - <modify-function signature="supportedResolutions(const QImageEncoderSettings &,bool*)const" remove="all"/> - </object-type> - <object-type name="QCameraImageCaptureControl"/> - <object-type name="QCameraImageProcessing"> - <enum-type name="WhiteBalanceMode"/> - <enum-type name="ColorFilter"/> - </object-type> - <object-type name="QCameraImageProcessingControl"> - <enum-type name="ProcessingParameter"/> - </object-type> - <object-type name="QCameraLocksControl"/> - <value-type name="QCameraViewfinderSettings"/> - <object-type name="QCameraViewfinderSettingsControl"> - <enum-type name="ViewfinderParameter"/> - </object-type> - <object-type name="QCameraViewfinderSettingsControl2"/> - <object-type name="QCameraZoomControl"/> - - <value-type name="QImageEncoderSettings"/> - <object-type name="QImageEncoderControl"> - <modify-function signature="supportedResolutions(const QImageEncoderSettings &,bool*)const" remove="all"/> - </object-type> - - <object-type name="QMediaAudioProbeControl"/> - <object-type name="QMediaAvailabilityControl"/> - <object-type name="QMediaBindableInterface"/> - <object-type name="QMediaContainerControl"/> - <value-type name="QMediaContent"/> - <object-type name="QMediaGaplessPlaybackControl"/> - <object-type name="QMediaControl"/> - <object-type name="QCustomAudioRoleControl" since="5.11"/> - <object-type name="QMediaNetworkAccessControl"/> - <!-- Causes compile errors - <namespace-type name="QMediaMetaData"/> - --> - <object-type name="QMediaObject"/> - <object-type name="QMediaPlayer"> - <enum-type name="State"/> - <enum-type name="MediaStatus"/> - <enum-type name="Flag" flags="Flags"/> - <enum-type name="Error"/> - <modify-function signature="setVideoOutput(QVideoWidget*)"> - <modify-argument index="1"> - <replace-type modified-type="QObject*"/> - </modify-argument> - <inject-code class="target" position="beginning" file="../glue/qtmultimedia.cpp" snippet="upcast"/> - </modify-function> - <modify-function signature="setVideoOutput(QGraphicsVideoItem*)"> - <modify-argument index="1"> - <replace-type modified-type="QObject*"/> - </modify-argument> - <inject-code class="target" position="beginning" file="../glue/qtmultimedia.cpp" snippet="upcast"/> - </modify-function> - </object-type> - <object-type name="QMediaPlayerControl"/> - <object-type name="QMediaPlaylist"> - <enum-type name="PlaybackMode"/> - <enum-type name="Error"/> - </object-type> - <object-type name="QMediaRecorder"> - <enum-type name="Error"/> - <enum-type name="State"/> - <enum-type name="Status"/> - <modify-function signature="supportedAudioSampleRates(const QAudioEncoderSettings &,bool*)const" remove="all"/> - <modify-function signature="supportedFrameRates(const QVideoEncoderSettings &,bool*)const" remove="all"/> - <modify-function signature="supportedResolutions(const QVideoEncoderSettings &,bool*)const" remove="all"/> - </object-type> - <object-type name="QMediaRecorderControl"/> - <value-type name="QMediaResource"/> - <object-type name="QMediaService"/> - <interface-type name="QMediaServiceCameraInfoInterface"/> - <interface-type name="QMediaServiceDefaultDeviceInterface"/> - <interface-type name="QMediaServiceFeaturesInterface"/> - <value-type name="QMediaServiceProviderHint"> - <enum-type name="Type"/> - <enum-type name="Feature" flags="Features"/> - </value-type> - <interface-type name="QMediaServiceSupportedDevicesInterface"/> - <interface-type name="QMediaServiceSupportedFormatsInterface"/> - <object-type name="QMediaStreamsControl"> - <enum-type name="StreamType"/> - </object-type> - <value-type name="QMediaTimeInterval"/> - <value-type name="QMediaTimeRange"/> - <object-type name="QMediaVideoProbeControl"/> - - <object-type name="QMetaDataReaderControl"/> - <object-type name="QMetaDataWriterControl"/> - - <namespace-type name="QMultimedia"> - <enum-type name="SupportEstimate"/> - <enum-type name="EncodingQuality"/> - <enum-type name="EncodingMode"/> - <enum-type name="AvailabilityStatus"/> - </namespace-type> - - <object-type name="QRadioData"> - <enum-type name="Error"/> - <enum-type name="ProgramType"/> - </object-type> - <object-type name="QRadioDataControl"/> - <object-type name="QRadioTuner"> - <enum-type name="Band"/> - <enum-type name="Error"/> - <enum-type name="SearchMode"/> - <enum-type name="State"/> - <enum-type name="StereoMode"/> - </object-type> - <object-type name="QRadioTunerControl"/> - <object-type name="QSound"> - <enum-type name="Loop"/> - </object-type> - <object-type name="QSoundEffect"> - <enum-type name="Loop"/> - <enum-type name="Status"/> - </object-type> - - <object-type name="QVideoDeviceSelectorControl"/> - <value-type name="QVideoEncoderSettings"/> - <object-type name="QVideoEncoderSettingsControl"> - <modify-function signature="supportedFrameRates(const QVideoEncoderSettings &,bool*)const" remove="all"/> - <modify-function signature="supportedResolutions(const QVideoEncoderSettings &,bool*)const" remove="all"/> - </object-type> - <object-type name="QVideoFilterRunnable"> - <enum-type name="RunFlag" flags="RunFlags"/> - </object-type> - <object-type name="QVideoProbe"/> - <object-type name="QVideoRendererControl"/> - <object-type name="QVideoWindowControl"/> - - <suppress-warning text="Final class 'QMediaObject' set to non-final, as it is extended by other classes"/> - <suppress-warning text="Pure virtual method 'QAbstractVideoBuffer::map(QAbstractVideoBuffer::MapMode,int*,int*)' must be implement but was completely removed on type system."/> - <suppress-warning text="Pure virtual method 'QImageEncoderControl::supportedResolutions(QImageEncoderSettings,bool*)const' must be implement but was completely removed on type system."/> - <suppress-warning text="Pure virtual method 'QCameraExposureControl::supportedParameterRange(QCameraExposureControl::ExposureParameter,bool*)const' must be implement but was completely removed on type system."/> - <suppress-warning text="Pure virtual method 'QVideoEncoderSettingsControl::supportedFrameRates(QVideoEncoderSettings,bool*)const' must be implement but was completely removed on type system."/> - <suppress-warning text="Pure virtual method 'QVideoEncoderSettingsControl::supportedResolutions(QVideoEncoderSettings,bool*)const' must be implement but was completely removed on type system."/> - <suppress-warning text="Pure virtual method 'QAudioEncoderSettingsControl::supportedSampleRates(QAudioEncoderSettings,bool*)const' must be implement but was completely removed on type system."/> -</typesystem> diff --git a/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia_forward_declarations.xml b/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia_forward_declarations.xml deleted file mode 100644 index 71b0759d6..000000000 --- a/sources/pyside6/PySide6/QtMultimedia/typesystem_multimedia_forward_declarations.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt for Python. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ ---> -<typesystem package="PySide6.QtMultimedia"> - <custom-type name="QVideoWidget"/> - <custom-type name="QGraphicsVideoItem"/> -</typesystem> diff --git a/sources/pyside6/PySide6/QtMultimediaWidgets/CMakeLists.txt b/sources/pyside6/PySide6/QtMultimediaWidgets/CMakeLists.txt index efdab2d1c..94443b496 100644 --- a/sources/pyside6/PySide6/QtMultimediaWidgets/CMakeLists.txt +++ b/sources/pyside6/PySide6/QtMultimediaWidgets/CMakeLists.txt @@ -1,10 +1,8 @@ project(QtMultimediaWidgets) set(QtMultimediaWidgets_SRC -${QtMultimediaWidgets_GEN_DIR}/qcameraviewfinder_wrapper.cpp ${QtMultimediaWidgets_GEN_DIR}/qgraphicsvideoitem_wrapper.cpp ${QtMultimediaWidgets_GEN_DIR}/qvideowidget_wrapper.cpp -${QtMultimediaWidgets_GEN_DIR}/qvideowidgetcontrol_wrapper.cpp # module is always needed ${QtMultimediaWidgets_GEN_DIR}/qtmultimediawidgets_module_wrapper.cpp ) diff --git a/sources/pyside6/PySide6/QtMultimediaWidgets/typesystem_multimediawidgets.xml b/sources/pyside6/PySide6/QtMultimediaWidgets/typesystem_multimediawidgets.xml index 7d3337031..e8d20494e 100644 --- a/sources/pyside6/PySide6/QtMultimediaWidgets/typesystem_multimediawidgets.xml +++ b/sources/pyside6/PySide6/QtMultimediaWidgets/typesystem_multimediawidgets.xml @@ -2,7 +2,7 @@ <!-- /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt for Python. @@ -42,11 +42,9 @@ <typesystem package="PySide6.QtMultimediaWidgets"> <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/> <load-typesystem name="QtGui/typesystem_gui.xml" generate="no"/> - <load-typesystem name="QtMultimedia/typesystem_multimedia_common.xml" generate="no"/> + <load-typesystem name="QtMultimedia/typesystem_multimedia.xml" generate="no"/> <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/> - <object-type name="QCameraViewfinder"/> <object-type name="QGraphicsVideoItem"/> <object-type name="QVideoWidget"/> - <object-type name="QVideoWidgetControl"/> </typesystem> diff --git a/sources/pyside6/PySide6/glue/qtmultimedia.cpp b/sources/pyside6/PySide6/glue/qtmultimedia.cpp index cbe1367cb..ddb63740f 100644 --- a/sources/pyside6/PySide6/glue/qtmultimedia.cpp +++ b/sources/pyside6/PySide6/glue/qtmultimedia.cpp @@ -37,14 +37,6 @@ ** ****************************************************************************/ -// @snippet upcast -%BEGIN_ALLOW_THREADS -QObject * upcastedArg = %CONVERTTOCPP[QObject *](%PYARG_1); -//XXX /|\ omitting this space crashes shiboken! -%CPPSELF.%FUNCTION_NAME(reinterpret_cast< %ARG1_TYPE >(upcastedArg)); -%END_ALLOW_THREADS -// @snippet upcast - // @snippet qvideoframe-bits %BEGIN_ALLOW_THREADS %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(); diff --git a/sources/pyside6/tests/QtMultimedia/audio_test.py b/sources/pyside6/tests/QtMultimedia/audio_test.py index 102e613ac..a6a1ef349 100644 --- a/sources/pyside6/tests/QtMultimedia/audio_test.py +++ b/sources/pyside6/tests/QtMultimedia/audio_test.py @@ -38,42 +38,31 @@ from init_paths import init_test_paths init_test_paths(False) from helper.usesqguiapplication import UsesQGuiApplication -from PySide6.QtCore import * -from PySide6.QtMultimedia import * +from PySide6.QtMultimedia import QAudioDeviceInfo, QAudioFormat, QMediaDevices class testAudioDevices(UsesQGuiApplication): def testListDevices(self): valid = False - devices = QAudioDeviceInfo.availableDevices(QAudio.AudioOutput) + devices = QMediaDevices.audioOutputs() if not len(devices): return valid = True - for devInfo in devices: - if devInfo.deviceName() == 'null': + for dev_info in devices: + if dev_info.id() == 'null': # skip the test if the only device found is a invalid device if len(devices) == 1: return else: continue fmt = QAudioFormat() - for codec in devInfo.supportedCodecs(): - fmt.setCodec(codec) - for frequency in devInfo.supportedSampleRates(): - fmt.setSampleRate(frequency) - for channels in devInfo.supportedChannelCounts(): - fmt.setChannelCount(channels) - for sampleType in devInfo.supportedSampleTypes(): - fmt.setSampleType(sampleType) - for sampleSize in devInfo.supportedSampleSizes(): - fmt.setSampleSize(sampleSize) - for endian in devInfo.supportedByteOrders(): - fmt.setByteOrder(endian) - if devInfo.isFormatSupported(fmt): - return - self.assertTrue(False) + for sample_format in dev_info.supportedSampleFormats(): + fmt.setSampleFormat(sample_format) + fmt.setChannelCount(dev_info.maximumChannelCount()) + fmt.setSampleRate(dev_info.maximumSampleRate()) + self.assertTrue(dev_info.isFormatSupported(fmt)) if __name__ == '__main__': |