diff options
author | André de la Rocha <andre.rocha@qt.io> | 2021-06-20 20:55:38 +0200 |
---|---|---|
committer | André de la Rocha <andre.rocha@qt.io> | 2021-06-21 12:44:26 +0200 |
commit | 0117b273c0abe3f847e0c17d1ee8c302cb8d61cf (patch) | |
tree | 34675b816a5ca4a2889e869f963cb58b235ac36f | |
parent | 97b8ac7c682c1af2c0583055e255bafe470a271c (diff) |
Windows: Fix Windows Media Audio encoding bitrate
Otherwise, encoding would fail. WMA/WMV support still needs
to be enabled elsewhere.
Change-Id: If12a1054a5b525c160da8597453d09fd2f488fb9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
-rw-r--r-- | src/multimedia/platform/windows/mediacapture/qwindowsmediadevicesession.cpp | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/multimedia/platform/windows/mediacapture/qwindowsmediadevicesession.cpp b/src/multimedia/platform/windows/mediacapture/qwindowsmediadevicesession.cpp index a13d272c0..0be027ed9 100644 --- a/src/multimedia/platform/windows/mediacapture/qwindowsmediadevicesession.cpp +++ b/src/multimedia/platform/windows/mediacapture/qwindowsmediadevicesession.cpp @@ -295,8 +295,9 @@ quint32 QWindowsMediaDeviceSession::estimateAudioBitRate(const GUID &audioFormat return 160000; case QMediaRecorder::Quality::VeryHighQuality: return 192000; + default: + return 128000; } - return 128000; } else if (audioFormat == MFAudioFormat_MP3) { // Bitrates supported by the MP3 encoder are // 32K, 40K, 48K, 56K, 64K, 80K, 96K, 112K, 128K, 160K, 192K, 224K, 256K, 320K. @@ -311,8 +312,41 @@ quint32 QWindowsMediaDeviceSession::estimateAudioBitRate(const GUID &audioFormat return 224000; case QMediaRecorder::Quality::VeryHighQuality: return 320000; + default: + return 128000; + } + } else if (audioFormat == MFAudioFormat_WMAudioV8) { + // Bitrates supported by the Windows Media Audio 8 encoder + switch (quality) { + case QMediaRecorder::Quality::VeryLowQuality: + return 32000; + case QMediaRecorder::Quality::LowQuality: + return 96000; + case QMediaRecorder::Quality::NormalQuality: + return 192000; + case QMediaRecorder::Quality::HighQuality: + return 256016; + case QMediaRecorder::Quality::VeryHighQuality: + return 320032; + default: + return 192000; + } + } else if (audioFormat == MFAudioFormat_WMAudioV9) { + // Bitrates supported by the Windows Media Audio 9 encoder + switch (quality) { + case QMediaRecorder::Quality::VeryLowQuality: + return 32000; + case QMediaRecorder::Quality::LowQuality: + return 96000; + case QMediaRecorder::Quality::NormalQuality: + return 192000; + case QMediaRecorder::Quality::HighQuality: + return 256016; + case QMediaRecorder::Quality::VeryHighQuality: + return 384000; + default: + return 192000; } - return 128000; } return 0; // Use default for format } |