diff options
author | Doris Verria <doris.verria@qt.io> | 2021-09-10 14:56:59 +0200 |
---|---|---|
committer | Doris Verria <doris.verria@qt.io> | 2021-09-13 13:06:41 +0200 |
commit | 4241af760259211cc52b6817b3a28c4dbf450dbf (patch) | |
tree | c8e745bcac234cfd86e1e125f076807258c91a41 /src/multimedia | |
parent | 4c9bc796051f9fc72969445c9c45478cc8efdf7a (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
Pick-to: 6.2.0 6.2
Change-Id: I4ceba470f5267212dd7088a15cc311ff2d07512f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimedia')
-rw-r--r-- | src/multimedia/platform/darwin/qdarwinformatsinfo.mm | 23 |
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; |