diff --git a/MP42/MP42AVFImporter.m b/MP42/MP42AVFImporter.m index b836202..f10f7fe 100644 --- a/MP42/MP42AVFImporter.m +++ b/MP42/MP42AVFImporter.m @@ -20,6 +20,8 @@ #import #import +#import +#import @interface AVFDemuxHelper : NSObject { @public @@ -45,7 +47,7 @@ } + (NSArray *)supportedFileFormats { - return @[@"mov", @"qt", @"mp4", @"m4v", @"m4a", @"mp3", @"m2ts", @"ts", @"mts", + return @[@"mov", @"qt", @"mp4", @"m4v", @"m4a", @"mxf", @"mp3", @"m2ts", @"ts", @"mts", @"ac3", @"eac3", @"ec3", @"webvtt", @"vtt", @"caf", @"aif", @"aiff", @"aifc", @"wav", @"flac"]; } @@ -82,6 +84,10 @@ - (instancetype)initWithURL:(NSURL *)fileURL error:(NSError * __autoreleasing *)outError { if ((self = [super initWithURL:fileURL])) { + + VTRegisterProfessionalVideoWorkflowVideoDecoders(); + MTRegisterProfessionalVideoWorkflowFormatReaders(); + _localAsset = [AVAsset assetWithURL:self.fileURL]; _helpers = [NSMutableArray array]; diff --git a/MP42/MP42MediaFormat.h b/MP42/MP42MediaFormat.h index 5efaae3..ad1b810 100644 --- a/MP42/MP42MediaFormat.h +++ b/MP42/MP42MediaFormat.h @@ -101,6 +101,8 @@ enum : MP42VideoCodecType kMP42VideoCodecType_DVCPROHD1080p30 = 'dvh3', kMP42VideoCodecType_DVCPROHD1080p25 = 'dvh2', + kMP42VideoCodecType_XAVC_Long_GOP = 'xalg', + kMP42VideoCodecType_FairPlay = 'drmi', }; diff --git a/MP42/MP42MediaFormat.m b/MP42/MP42MediaFormat.m index 2b32586..8aba6a0 100644 --- a/MP42/MP42MediaFormat.m +++ b/MP42/MP42MediaFormat.m @@ -190,6 +190,10 @@ NSString *localizedVideoDisplayName(FourCharCode mediaSubtype) result = NSLocalizedString(@"DVC Pro PAL", nil); break; + case kMP42VideoCodecType_XAVC_Long_GOP: + result = NSLocalizedString(@"XAVC Long GOP", nil); + break; + case kMP42VideoCodecType_FairPlay: result = NSLocalizedString(@"FairPlay Video", nil); break; diff --git a/MP42Foundation.xcodeproj/project.pbxproj b/MP42Foundation.xcodeproj/project.pbxproj index 8335b43..580c815 100644 --- a/MP42Foundation.xcodeproj/project.pbxproj +++ b/MP42Foundation.xcodeproj/project.pbxproj @@ -225,6 +225,8 @@ A9B9C2E3182397E700416A4E /* libuniversaldetector.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A9B9C2C11823944700416A4E /* libuniversaldetector.a */; }; A9B9C4931823986200416A4E /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9B9C4921823986200416A4E /* Quartz.framework */; }; A9BA1AE91DBF7DBE00FD0B38 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A9BA1AEB1DBF7DBE00FD0B38 /* Localizable.strings */; }; + A9D6CD641F9E3A7F00CCEE3E /* MediaToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9D6CD611F9E3A7F00CCEE3E /* MediaToolbox.framework */; }; + A9D6CD661F9E3A8500CCEE3E /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9D6CD651F9E3A8500CCEE3E /* VideoToolbox.framework */; }; A9D764311E278B8100ED2F78 /* MP42MetadataUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = A9D764301E278B8100ED2F78 /* MP42MetadataUtilities.m */; }; A9D764321E278B8100ED2F78 /* MP42MetadataUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = A9D764301E278B8100ED2F78 /* MP42MetadataUtilities.m */; }; A9DFBDA1195FF5BA00410060 /* MP42Heap.h in Headers */ = {isa = PBXBuildFile; fileRef = A9DFBD9F195FF5BA00410060 /* MP42Heap.h */; }; @@ -452,6 +454,8 @@ A9BA1ACD1DBF76FD00FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/InfoPlist.strings; sourceTree = ""; }; A9BA1AEA1DBF7DBE00FD0B38 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = ""; }; A9D599BA1D4885E0001C22BD /* libswresample.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libswresample.a; path = contrib/ffmpeg/lib/libswresample.a; sourceTree = ""; }; + A9D6CD611F9E3A7F00CCEE3E /* MediaToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaToolbox.framework; path = System/Library/Frameworks/MediaToolbox.framework; sourceTree = SDKROOT; }; + A9D6CD651F9E3A8500CCEE3E /* VideoToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VideoToolbox.framework; path = System/Library/Frameworks/VideoToolbox.framework; sourceTree = SDKROOT; }; A9D764301E278B8100ED2F78 /* MP42MetadataUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MP42MetadataUtilities.m; sourceTree = ""; }; A9D764351E278B9C00ED2F78 /* MP42MetadataUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MP42MetadataUtilities.h; sourceTree = ""; }; A9DFBD9F195FF5BA00410060 /* MP42Heap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MP42Heap.h; sourceTree = ""; }; @@ -515,6 +519,8 @@ A9B9C2D81823970E00416A4E /* AVFoundation.framework in Frameworks */, A9B9C2DE1823973200416A4E /* CoreMedia.framework in Frameworks */, A9B9C1F1182391DF00416A4E /* Cocoa.framework in Frameworks */, + A9D6CD661F9E3A8500CCEE3E /* VideoToolbox.framework in Frameworks */, + A9D6CD641F9E3A7F00CCEE3E /* MediaToolbox.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -554,6 +560,8 @@ A9B9C1EF182391DF00416A4E /* Frameworks */ = { isa = PBXGroup; children = ( + A9D6CD651F9E3A8500CCEE3E /* VideoToolbox.framework */, + A9D6CD611F9E3A7F00CCEE3E /* MediaToolbox.framework */, A90801051D4B830A002B6950 /* libavfilter.a */, A90801061D4B830A002B6950 /* libavformat.a */, A9D599BA1D4885E0001C22BD /* libswresample.a */,