Hook up Opus and MP1/MP2 audio decoder.

This commit is contained in:
Damiano Galassi committed 2016-07-27 11:37:35 +02:00
1 parent 20c26a5db6
commit e2adc70d63
6 files changed
+24 -2

No files matched your search

-1
View File
@@ -79,7 +79,6 @@ static const struct {
{ kAudioFormatMPEGLayer1, AV_CODEC_ID_MP1 },
{ kAudioFormatMPEGLayer2, AV_CODEC_ID_MP2 },
{ kAudioFormatMPEGLayer3, AV_CODEC_ID_MP3 },
{ 'ms\0\0' + 0x50, AV_CODEC_ID_MP2 },
{ kAudioFormatAC3, AV_CODEC_ID_AC3 },
{ kAudioFormatEnhancedAC3, AV_CODEC_ID_EAC3 },
{ 'XiFL', AV_CODEC_ID_FLAC },
+11
View File
@@ -92,6 +92,14 @@
else if ([format isEqualToString:MP42AudioFormatDTS]) {
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]) {
asbd.mFormatID = kAudioFormatMPEGLayer3;
asbd.mFramesPerPacket = 1152;
@@ -99,6 +107,9 @@
else if ([format isEqualToString:MP42AudioFormatTrueHD]) {
asbd.mFormatID = 'trhd';
}
else if ([format isEqualToString:MP42AudioFormatOpus]) {
asbd.mFormatID = 'Opus';
}
else if ([format isEqualToString:MP42AudioFormatPCM]) {
AudioStreamBasicDescription temp = [track.muxer_helper->importer audioDescriptionForTrack:track];
if (temp.mFormatID) {
+3
View File
@@ -51,6 +51,8 @@ extern NSString *const MP42VideoFormatFairPlay;
// Audio Format
extern NSString *const MP42AudioFormatAAC;
extern NSString *const MP42AudioFormatHEAAC;
extern NSString *const MP42AudioFormatMP1;
extern NSString *const MP42AudioFormatMP2;
extern NSString *const MP42AudioFormatMP3;
extern NSString *const MP42AudioFormatVorbis;
extern NSString *const MP42AudioFormatFLAC;
@@ -59,6 +61,7 @@ extern NSString *const MP42AudioFormatAC3;
extern NSString *const MP42AudioFormatEAC3;
extern NSString *const MP42AudioFormatDTS;
extern NSString *const MP42AudioFormatTrueHD;
extern NSString *const MP42AudioFormatOpus;
extern NSString *const MP42AudioFormatAMR;
extern NSString *const MP42AudioFormatPCM;
extern NSString *const MP42AudioFormatFairPlay;
+3
View File
@@ -45,6 +45,8 @@ NSString *const MP42VideoFormatFairPlay = @"FairPlay Video";
// Audio Format
NSString *const MP42AudioFormatAAC = @"AAC";
NSString *const MP42AudioFormatHEAAC = @"HE-AAC";
NSString *const MP42AudioFormatMP1 = @"MP1";
NSString *const MP42AudioFormatMP2 = @"MP2";
NSString *const MP42AudioFormatMP3 = @"MP3";
NSString *const MP42AudioFormatVorbis = @"Vorbis";
NSString *const MP42AudioFormatFLAC = @"FLAC";
@@ -53,6 +55,7 @@ NSString *const MP42AudioFormatAC3 = @"AC-3";
NSString *const MP42AudioFormatEAC3 = @"E-AC-3";
NSString *const MP42AudioFormatDTS = @"DTS";
NSString *const MP42AudioFormatTrueHD = @"True HD";
NSString *const MP42AudioFormatOpus = @"Opus";
NSString *const MP42AudioFormatAMR = @"AMR Narrow Band";
NSString *const MP42AudioFormatPCM = @"PCM";
NSString *const MP42AudioFormatFairPlay = @"FairPlay Sound";
+6
View File
@@ -414,10 +414,16 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t
return MP42VideoFormatMPEG2;
else if (!strcmp(track->CodecID, "A_DTS"))
return MP42AudioFormatDTS;
else if (!strcmp(track->CodecID, "A_OPUS"))
return MP42AudioFormatOpus;
else if (!strcmp(track->CodecID, "A_VORBIS"))
return MP42AudioFormatVorbis;
else if (!strcmp(track->CodecID, "A_FLAC"))
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"))
return MP42AudioFormatMP3;
else if (!strcmp(track->CodecID, "A_TRUEHD"))
+1 -1
View File
@@ -46,7 +46,7 @@ BOOL isTrackMuxable(NSString *formatName)
}
BOOL trackNeedConversion(NSString *formatName) {
NSArray *supportedConversionFormats = @[MP42AudioFormatVorbis, MP42AudioFormatFLAC, MP42AudioFormatMP3,
NSArray *supportedConversionFormats = @[MP42AudioFormatVorbis, MP42AudioFormatFLAC, MP42AudioFormatMP1, MP42AudioFormatMP2, MP42AudioFormatMP3, MP42AudioFormatOpus,
MP42AudioFormatTrueHD, MP42SubtitleFormatSSA, MP42SubtitleFormatText, MP42SubtitleFormatPGS];
return [supportedConversionFormats containsObject:formatName];