Hook up Opus and MP1/MP2 audio decoder.
This commit is contained in:
1 parent
20c26a5db6
commit
e2adc70d63
6 files changed
+24
-2
No files matched your search
@@ -79,7 +79,6 @@ static const struct {
|
|||||||
{ kAudioFormatMPEGLayer1, AV_CODEC_ID_MP1 },
|
{ kAudioFormatMPEGLayer1, AV_CODEC_ID_MP1 },
|
||||||
{ kAudioFormatMPEGLayer2, AV_CODEC_ID_MP2 },
|
{ kAudioFormatMPEGLayer2, AV_CODEC_ID_MP2 },
|
||||||
{ kAudioFormatMPEGLayer3, AV_CODEC_ID_MP3 },
|
{ kAudioFormatMPEGLayer3, AV_CODEC_ID_MP3 },
|
||||||
{ 'ms\0\0' + 0x50, AV_CODEC_ID_MP2 },
|
|
||||||
{ kAudioFormatAC3, AV_CODEC_ID_AC3 },
|
{ kAudioFormatAC3, AV_CODEC_ID_AC3 },
|
||||||
{ kAudioFormatEnhancedAC3, AV_CODEC_ID_EAC3 },
|
{ kAudioFormatEnhancedAC3, AV_CODEC_ID_EAC3 },
|
||||||
{ 'XiFL', AV_CODEC_ID_FLAC },
|
{ 'XiFL', AV_CODEC_ID_FLAC },
|
||||||
|
|||||||
@@ -92,6 +92,14 @@
|
|||||||
else if ([format isEqualToString:MP42AudioFormatDTS]) {
|
else if ([format isEqualToString:MP42AudioFormatDTS]) {
|
||||||
asbd.mFormatID = 'DTS ';
|
asbd.mFormatID = 'DTS ';
|
||||||
}
|
}
|
||||||
|
else if ([format isEqualToString:MP42AudioFormatMP1]) {
|
||||||
|
asbd.mFormatID = kAudioFormatMPEGLayer1;
|
||||||
|
asbd.mFramesPerPacket = 1152;
|
||||||
|
}
|
||||||
|
else if ([format isEqualToString:MP42AudioFormatMP2]) {
|
||||||
|
asbd.mFormatID = kAudioFormatMPEGLayer2;
|
||||||
|
asbd.mFramesPerPacket = 1152;
|
||||||
|
}
|
||||||
else if ([format isEqualToString:MP42AudioFormatMP3]) {
|
else if ([format isEqualToString:MP42AudioFormatMP3]) {
|
||||||
asbd.mFormatID = kAudioFormatMPEGLayer3;
|
asbd.mFormatID = kAudioFormatMPEGLayer3;
|
||||||
asbd.mFramesPerPacket = 1152;
|
asbd.mFramesPerPacket = 1152;
|
||||||
@@ -99,6 +107,9 @@
|
|||||||
else if ([format isEqualToString:MP42AudioFormatTrueHD]) {
|
else if ([format isEqualToString:MP42AudioFormatTrueHD]) {
|
||||||
asbd.mFormatID = 'trhd';
|
asbd.mFormatID = 'trhd';
|
||||||
}
|
}
|
||||||
|
else if ([format isEqualToString:MP42AudioFormatOpus]) {
|
||||||
|
asbd.mFormatID = 'Opus';
|
||||||
|
}
|
||||||
else if ([format isEqualToString:MP42AudioFormatPCM]) {
|
else if ([format isEqualToString:MP42AudioFormatPCM]) {
|
||||||
AudioStreamBasicDescription temp = [track.muxer_helper->importer audioDescriptionForTrack:track];
|
AudioStreamBasicDescription temp = [track.muxer_helper->importer audioDescriptionForTrack:track];
|
||||||
if (temp.mFormatID) {
|
if (temp.mFormatID) {
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ extern NSString *const MP42VideoFormatFairPlay;
|
|||||||
// Audio Format
|
// Audio Format
|
||||||
extern NSString *const MP42AudioFormatAAC;
|
extern NSString *const MP42AudioFormatAAC;
|
||||||
extern NSString *const MP42AudioFormatHEAAC;
|
extern NSString *const MP42AudioFormatHEAAC;
|
||||||
|
extern NSString *const MP42AudioFormatMP1;
|
||||||
|
extern NSString *const MP42AudioFormatMP2;
|
||||||
extern NSString *const MP42AudioFormatMP3;
|
extern NSString *const MP42AudioFormatMP3;
|
||||||
extern NSString *const MP42AudioFormatVorbis;
|
extern NSString *const MP42AudioFormatVorbis;
|
||||||
extern NSString *const MP42AudioFormatFLAC;
|
extern NSString *const MP42AudioFormatFLAC;
|
||||||
@@ -59,6 +61,7 @@ extern NSString *const MP42AudioFormatAC3;
|
|||||||
extern NSString *const MP42AudioFormatEAC3;
|
extern NSString *const MP42AudioFormatEAC3;
|
||||||
extern NSString *const MP42AudioFormatDTS;
|
extern NSString *const MP42AudioFormatDTS;
|
||||||
extern NSString *const MP42AudioFormatTrueHD;
|
extern NSString *const MP42AudioFormatTrueHD;
|
||||||
|
extern NSString *const MP42AudioFormatOpus;
|
||||||
extern NSString *const MP42AudioFormatAMR;
|
extern NSString *const MP42AudioFormatAMR;
|
||||||
extern NSString *const MP42AudioFormatPCM;
|
extern NSString *const MP42AudioFormatPCM;
|
||||||
extern NSString *const MP42AudioFormatFairPlay;
|
extern NSString *const MP42AudioFormatFairPlay;
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ NSString *const MP42VideoFormatFairPlay = @"FairPlay Video";
|
|||||||
// Audio Format
|
// Audio Format
|
||||||
NSString *const MP42AudioFormatAAC = @"AAC";
|
NSString *const MP42AudioFormatAAC = @"AAC";
|
||||||
NSString *const MP42AudioFormatHEAAC = @"HE-AAC";
|
NSString *const MP42AudioFormatHEAAC = @"HE-AAC";
|
||||||
|
NSString *const MP42AudioFormatMP1 = @"MP1";
|
||||||
|
NSString *const MP42AudioFormatMP2 = @"MP2";
|
||||||
NSString *const MP42AudioFormatMP3 = @"MP3";
|
NSString *const MP42AudioFormatMP3 = @"MP3";
|
||||||
NSString *const MP42AudioFormatVorbis = @"Vorbis";
|
NSString *const MP42AudioFormatVorbis = @"Vorbis";
|
||||||
NSString *const MP42AudioFormatFLAC = @"FLAC";
|
NSString *const MP42AudioFormatFLAC = @"FLAC";
|
||||||
@@ -53,6 +55,7 @@ NSString *const MP42AudioFormatAC3 = @"AC-3";
|
|||||||
NSString *const MP42AudioFormatEAC3 = @"E-AC-3";
|
NSString *const MP42AudioFormatEAC3 = @"E-AC-3";
|
||||||
NSString *const MP42AudioFormatDTS = @"DTS";
|
NSString *const MP42AudioFormatDTS = @"DTS";
|
||||||
NSString *const MP42AudioFormatTrueHD = @"True HD";
|
NSString *const MP42AudioFormatTrueHD = @"True HD";
|
||||||
|
NSString *const MP42AudioFormatOpus = @"Opus";
|
||||||
NSString *const MP42AudioFormatAMR = @"AMR Narrow Band";
|
NSString *const MP42AudioFormatAMR = @"AMR Narrow Band";
|
||||||
NSString *const MP42AudioFormatPCM = @"PCM";
|
NSString *const MP42AudioFormatPCM = @"PCM";
|
||||||
NSString *const MP42AudioFormatFairPlay = @"FairPlay Sound";
|
NSString *const MP42AudioFormatFairPlay = @"FairPlay Sound";
|
||||||
|
|||||||
@@ -414,10 +414,16 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t
|
|||||||
return MP42VideoFormatMPEG2;
|
return MP42VideoFormatMPEG2;
|
||||||
else if (!strcmp(track->CodecID, "A_DTS"))
|
else if (!strcmp(track->CodecID, "A_DTS"))
|
||||||
return MP42AudioFormatDTS;
|
return MP42AudioFormatDTS;
|
||||||
|
else if (!strcmp(track->CodecID, "A_OPUS"))
|
||||||
|
return MP42AudioFormatOpus;
|
||||||
else if (!strcmp(track->CodecID, "A_VORBIS"))
|
else if (!strcmp(track->CodecID, "A_VORBIS"))
|
||||||
return MP42AudioFormatVorbis;
|
return MP42AudioFormatVorbis;
|
||||||
else if (!strcmp(track->CodecID, "A_FLAC"))
|
else if (!strcmp(track->CodecID, "A_FLAC"))
|
||||||
return MP42AudioFormatFLAC;
|
return MP42AudioFormatFLAC;
|
||||||
|
else if (!strcmp(track->CodecID, "A_MPEG/L1"))
|
||||||
|
return MP42AudioFormatMP1;
|
||||||
|
else if (!strcmp(track->CodecID, "A_MPEG/L2"))
|
||||||
|
return MP42AudioFormatMP2;
|
||||||
else if (!strcmp(track->CodecID, "A_MPEG/L3"))
|
else if (!strcmp(track->CodecID, "A_MPEG/L3"))
|
||||||
return MP42AudioFormatMP3;
|
return MP42AudioFormatMP3;
|
||||||
else if (!strcmp(track->CodecID, "A_TRUEHD"))
|
else if (!strcmp(track->CodecID, "A_TRUEHD"))
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ BOOL isTrackMuxable(NSString *formatName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOL trackNeedConversion(NSString *formatName) {
|
BOOL trackNeedConversion(NSString *formatName) {
|
||||||
NSArray *supportedConversionFormats = @[MP42AudioFormatVorbis, MP42AudioFormatFLAC, MP42AudioFormatMP3,
|
NSArray *supportedConversionFormats = @[MP42AudioFormatVorbis, MP42AudioFormatFLAC, MP42AudioFormatMP1, MP42AudioFormatMP2, MP42AudioFormatMP3, MP42AudioFormatOpus,
|
||||||
MP42AudioFormatTrueHD, MP42SubtitleFormatSSA, MP42SubtitleFormatText, MP42SubtitleFormatPGS];
|
MP42AudioFormatTrueHD, MP42SubtitleFormatSSA, MP42SubtitleFormatText, MP42SubtitleFormatPGS];
|
||||||
|
|
||||||
return [supportedConversionFormats containsObject:formatName];
|
return [supportedConversionFormats containsObject:formatName];
|
||||||
|
|||||||
Reference in new issue
Block a user