moved some methods to MP42FileImporter.

This commit is contained in:
Damiano Galassi authored and Damiano Galassi committed 2015-09-18 08:26:29 +02:00
1 parent 24d215fda9
commit 0dec3963f6
2 files changed
+5 -20

No files matched your search

+4 -3
View File
@@ -8,13 +8,14 @@
#import "MP42MediaFormat.h"
NS_ASSUME_NONNULL_BEGIN
NSString * StringFromTime(long long time, long timeScale);
MP42Duration TimeFromString(NSString *SMPTE_string, MP42Duration timeScale);
NSArray *supportedFileFormat();
BOOL isFileFormatSupported(NSString *fileExt);
BOOL isTrackMuxable(NSString * formatName);
BOOL trackNeedConversion(NSString * formatName);
int isHdVideo(uint64_t width, uint64_t height);
NS_ASSUME_NONNULL_END
+1 -17
View File
@@ -43,26 +43,10 @@ MP42Duration TimeFromString(NSString *time_string, MP42Duration timeScale)
return timeval;
}
NSArray *supportedFileFormat()
{
return [NSArray arrayWithObjects:@"scc", @"smi", @"txt", @"m4v", @"mp4", @"m4a", @"m4a", @"mov", @"ts", @"mts", @"m2ts",
@"mkv", @"mka", @"mks", @"h264", @"264", @"idx", @"aac", @"ac3", @"srt", nil];
}
BOOL isFileFormatSupported(NSString * fileExt) {
NSArray *supportedFormat = supportedFileFormat();
for (NSString *type in supportedFormat)
if ([fileExt caseInsensitiveCompare:type] == NSOrderedSame)
return YES;
return NO;
}
BOOL isTrackMuxable(NSString *formatName)
{
NSArray *supportedFormats = @[MP42VideoFormatH264, MP42VideoFormatMPEG4Visual, MP42AudioFormatAAC, MP42AudioFormatALAC,
MP42AudioFormatAC3, MP42AudioFormatDTS, MP42SubtitleFormatTx3g, MP42SubtitleFormatText,
MP42AudioFormatAC3, MP42AudioFormatEAC3, MP42AudioFormatDTS, MP42SubtitleFormatTx3g, MP42SubtitleFormatText,
MP42ClosedCaptionFormatCEA608, MP42VideoFormatJPEG, MP42SubtitleFormatVobSub];
return [supportedFormats containsObject:formatName];