summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoris Verria <doris.verria@qt.io>2021-09-10 14:56:59 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-13 12:09:22 +0000
commit21475678b7532e30979df28576f32584b2d21bef (patch)
tree407a88eddbfba519a15396cd7c5e3f81ea6f3785
parentbff50b075e9a0b4d8018e6a398e6a818ca2def10 (diff)
QDarwinFormatInfo: Remove unsupported audio codecs for encoding
From the Apple docs, AVFoundation can only support encoding to AAC, ALAC, and WAV from our list of codecs. Remove the rest of the audio codecs from the list of encoders. Fixes: QTBUG-96376 Change-Id: I4ceba470f5267212dd7088a15cc311ff2d07512f Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 4241af760259211cc52b6817b3a28c4dbf450dbf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/multimedia/platform/darwin/qdarwinformatsinfo.mm23
1 files changed, 3 insertions, 20 deletions
diff --git a/src/multimedia/platform/darwin/qdarwinformatsinfo.mm b/src/multimedia/platform/darwin/qdarwinformatsinfo.mm
index 58b973ea9..9d27a843d 100644
--- a/src/multimedia/platform/darwin/qdarwinformatsinfo.mm
+++ b/src/multimedia/platform/darwin/qdarwinformatsinfo.mm
@@ -85,7 +85,7 @@ static struct {
{ "; codecs=\"ac-3\"", QMediaFormat::AudioCodec::AC3 },
{ "; codecs=\"ec-3\"", QMediaFormat::AudioCodec::EAC3 },
{ "; codecs=\"flac\"", QMediaFormat::AudioCodec::FLAC },
- { "; codecs=\"alac\"", QMediaFormat::AudioCodec::FLAC },
+ { "; codecs=\"alac\"", QMediaFormat::AudioCodec::ALAC },
{ "; codecs=\"opus\"", QMediaFormat::AudioCodec::Opus },
{ nullptr, QMediaFormat::AudioCodec::Unspecified },
};
@@ -117,7 +117,6 @@ QDarwinFormatInfo::QDarwinFormatInfo()
while (a->name) {
QByteArray extendedMimetype = m->name;
extendedMimetype += a->name;
-// qDebug() << "audio" << extendedMimetype << [AVURLAsset isPlayableExtendedMIMEType:[NSString stringWithUTF8String:extendedMimetype.constData()]];
if ([AVURLAsset isPlayableExtendedMIMEType:[NSString stringWithUTF8String:extendedMimetype.constData()]])
audio << a->value;
++a;
@@ -133,29 +132,14 @@ QDarwinFormatInfo::QDarwinFormatInfo()
}
}
-// #if 1
-// // ### Verify that this is correct
-// encoders = decoders;
-// #else
- // ### Haven't seen a good way to figure this out.
// seems AVFoundation only supports those for encoding
encoders = {
{ QMediaFormat::MPEG4,
- { QMediaFormat::AudioCodec::AAC, QMediaFormat::AudioCodec::MP3, QMediaFormat::AudioCodec::ALAC, QMediaFormat::AudioCodec::AC3, QMediaFormat::AudioCodec::EAC3, },
+ { QMediaFormat::AudioCodec::AAC, QMediaFormat::AudioCodec::ALAC },
{ QMediaFormat::VideoCodec::H264, QMediaFormat::VideoCodec::H265, QMediaFormat::VideoCodec::MotionJPEG } },
{ QMediaFormat::QuickTime,
- { QMediaFormat::AudioCodec::AAC, QMediaFormat::AudioCodec::MP3, QMediaFormat::AudioCodec::ALAC, QMediaFormat::AudioCodec::AC3, QMediaFormat::AudioCodec::EAC3, },
+ { QMediaFormat::AudioCodec::AAC, QMediaFormat::AudioCodec::ALAC },
{ QMediaFormat::VideoCodec::H264, QMediaFormat::VideoCodec::H265, QMediaFormat::VideoCodec::MotionJPEG } },
- // seems AVFoundation does not support directly encoding to an AAC and MP3 file
- // { QMediaFormat::AAC,
- // { QMediaFormat::AudioCodec::AAC },
- // {} },
- // { QMediaFormat::MP3,
- // { QMediaFormat::AudioCodec::MP3 },
- // {} },
- // { QMediaFormat::FLAC,
- // { QMediaFormat::AudioCodec::FLAC },
- // {} },
{ QMediaFormat::Mpeg4Audio,
{ QMediaFormat::AudioCodec::AAC },
{} },
@@ -163,7 +147,6 @@ QDarwinFormatInfo::QDarwinFormatInfo()
{ QMediaFormat::AudioCodec::Wave },
{} },
};
-// #endif
// ###
imageFormats << QImageCapture::JPEG;