From 5f2fd7dd4a415a0b680a718fc5dd1f5906bb276e Mon Sep 17 00:00:00 2001 From: Artem Dyomin Date: Fri, 26 May 2023 15:45:00 +0200 Subject: Add missing qml properties to MediaRecorder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Users asked for videoResolution, but it makes sense to fix all missing ones. Task-number: QTBUG-113621 Change-Id: I8c1314c9e00038cbddb92165b2d0f52d41fbda1a Reviewed-by: Tor Arne Vestbø --- src/multimedia/recording/qmediarecorder.cpp | 50 +++++++++++++++++++++++++++++ src/multimedia/recording/qmediarecorder.h | 9 +++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/multimedia/recording/qmediarecorder.cpp b/src/multimedia/recording/qmediarecorder.cpp index 2d0cc71be..c3cdf67e4 100644 --- a/src/multimedia/recording/qmediarecorder.cpp +++ b/src/multimedia/recording/qmediarecorder.cpp @@ -632,6 +632,14 @@ void QMediaRecorder::setMediaFormat(const QMediaFormat &format) emit mediaFormatChanged(); } +/*! + + \qmlproperty MediaRecorder::EncodingMode QtMultimedia::MediaRecorder::encodingMode + \since 6.6 + \brief This property holds the encoding mode. + \sa EncodingMode +*/ + /*! Returns the encoding mode. @@ -691,6 +699,15 @@ void QMediaRecorder::setQuality(Quality quality) emit qualityChanged(); } +/*! + \qmlproperty Size QtMultimedia::MediaRecorder::videoResolution + \since 6.6 + \brief This property holds the resolution of the encoded video. + + Set an empty Size to make the recorder choose an optimal resolution based + on what is available from the video source and the limitations of the codec. +*/ + /*! Returns the resolution of the encoded video. @@ -728,6 +745,15 @@ void QMediaRecorder::setVideoResolution(const QSize &size) \overload */ +/*! + \qmlproperty real QtMultimedia::MediaRecorder::videoFrameRate + \since 6.6 + \brief This property holds the video frame rate. + + A value of 0 indicates the recorder should make an optimal choice based on what is available + from the video source and the limitations of the codec. +*/ + /*! Returns the video frame rate. */ @@ -757,6 +783,12 @@ void QMediaRecorder::setVideoFrameRate(qreal frameRate) emit videoFrameRateChanged(); } +/*! + \qmlproperty int QtMultimedia::MediaRecorder::videoBitRate + \since 6.6 + \brief This property holds the bit rate of the compressed video stream in bits per second. +*/ + /*! Returns the bit rate of the compressed video stream in bits per second. */ @@ -783,6 +815,12 @@ void QMediaRecorder::setVideoBitRate(int bitRate) emit videoBitRateChanged(); } +/*! + \qmlproperty int QtMultimedia::MediaRecorder::audioBitRate + \since 6.6 + \brief This property holds the bit rate of the compressed audio stream in bits per second. +*/ + /*! Returns the bit rate of the compressed audio stream in bits per second. */ @@ -809,6 +847,12 @@ void QMediaRecorder::setAudioBitRate(int bitRate) emit audioBitRateChanged(); } +/*! + \qmlproperty int QtMultimedia::MediaRecorder::audioChannelCount + \since 6.6 + \brief This property holds the number of audio channels. +*/ + /*! Returns the number of audio channels. */ @@ -838,6 +882,12 @@ void QMediaRecorder::setAudioChannelCount(int channels) emit audioChannelCountChanged(); } +/*! + \qmlproperty int QtMultimedia::MediaRecorder::audioSampleRate + \since 6.6 + \brief This property holds the audio sample rate in Hz. +*/ + /*! Returns the audio sample rate in Hz. */ diff --git a/src/multimedia/recording/qmediarecorder.h b/src/multimedia/recording/qmediarecorder.h index c067df913..c181e8ea0 100644 --- a/src/multimedia/recording/qmediarecorder.h +++ b/src/multimedia/recording/qmediarecorder.h @@ -36,7 +36,14 @@ class Q_MULTIMEDIA_EXPORT QMediaRecorder : public QObject Q_PROPERTY(QMediaRecorder::Error error READ error NOTIFY errorChanged) Q_PROPERTY(QString errorString READ errorString NOTIFY errorChanged) Q_PROPERTY(QMediaFormat mediaFormat READ mediaFormat WRITE setMediaFormat NOTIFY mediaFormatChanged) - Q_PROPERTY(Quality quality READ quality WRITE setQuality) + Q_PROPERTY(Quality quality READ quality WRITE setQuality NOTIFY qualityChanged) + Q_PROPERTY(QMediaRecorder::EncodingMode encodingMode READ encodingMode WRITE setEncodingMode NOTIFY encodingModeChanged) + Q_PROPERTY(QSize videoResolution READ videoResolution WRITE setVideoResolution NOTIFY videoResolutionChanged) + Q_PROPERTY(qreal videoFrameRate READ videoFrameRate WRITE setVideoFrameRate NOTIFY videoFrameRateChanged) + Q_PROPERTY(int videoBitRate READ videoBitRate WRITE setVideoBitRate NOTIFY videoBitRateChanged) + Q_PROPERTY(int audioBitRate READ audioBitRate WRITE setAudioBitRate NOTIFY audioBitRateChanged) + Q_PROPERTY(int audioChannelCount READ audioChannelCount WRITE setAudioChannelCount NOTIFY audioChannelCountChanged) + Q_PROPERTY(int audioSampleRate READ audioSampleRate WRITE setAudioSampleRate NOTIFY audioSampleRateChanged) public: enum Quality { -- cgit v1.2.3