Enabled more warnings, switched the deployment target to 10.7 and minor code cleanup
This commit is contained in:
1 parent
efc0e794c0
commit
e5095a611a
31 files changed
+156
-247
No files matched your search
@@ -10,7 +10,8 @@
|
|||||||
#import "MP42FileImporter.h"
|
#import "MP42FileImporter.h"
|
||||||
|
|
||||||
@interface MP42AACImporter : MP42FileImporter {
|
@interface MP42AACImporter : MP42FileImporter {
|
||||||
FILE* inFile;
|
@private
|
||||||
|
FILE *inFile;
|
||||||
int64_t size;
|
int64_t size;
|
||||||
|
|
||||||
NSMutableData *aacInfo;
|
NSMutableData *aacInfo;
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
#import "MP42FileImporter.h"
|
#import "MP42FileImporter.h"
|
||||||
|
|
||||||
@interface MP42AC3Importer : MP42FileImporter {
|
@interface MP42AC3Importer : MP42FileImporter {
|
||||||
FILE* inFile;
|
@private
|
||||||
|
FILE *inFile;
|
||||||
int64_t size;
|
int64_t size;
|
||||||
|
|
||||||
NSMutableData *ac3Info;
|
NSMutableData *ac3Info;
|
||||||
|
|||||||
@@ -8,9 +8,11 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "MP42FileImporter.h"
|
#import "MP42FileImporter.h"
|
||||||
|
|
||||||
@class AVAsset;
|
@class AVAsset;
|
||||||
|
|
||||||
@interface MP42AVFImporter : MP42FileImporter {
|
@interface MP42AVFImporter : MP42FileImporter {
|
||||||
|
@private
|
||||||
AVAsset *_localAsset;
|
AVAsset *_localAsset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -184,7 +184,7 @@
|
|||||||
MP42ChapterTrack *chapters = nil;
|
MP42ChapterTrack *chapters = nil;
|
||||||
|
|
||||||
// Checks if there is a chapter tracks
|
// Checks if there is a chapter tracks
|
||||||
if ([tracks count]) {
|
if (tracks.count) {
|
||||||
for (NSLocale *locale in availableChapter) {
|
for (NSLocale *locale in availableChapter) {
|
||||||
chapters = [[MP42ChapterTrack alloc] init];
|
chapters = [[MP42ChapterTrack alloc] init];
|
||||||
NSArray *chapterList = [_localAsset chapterMetadataGroupsWithTitleLocale:locale containingItemsWithCommonKeys:nil];
|
NSArray *chapterList = [_localAsset chapterMetadataGroupsWithTitleLocale:locale containingItemsWithCommonKeys:nil];
|
||||||
@@ -670,7 +670,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)demux:(id)sender {
|
- (void)demux:(id)sender {
|
||||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
|
||||||
BOOL success = YES;
|
BOOL success = YES;
|
||||||
OSStatus err = noErr;
|
OSStatus err = noErr;
|
||||||
@@ -702,8 +702,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
success = [assetReader startReading];
|
success = [assetReader startReading];
|
||||||
if (!success)
|
|
||||||
|
if (!success) {
|
||||||
localError = [assetReader error];
|
localError = [assetReader error];
|
||||||
|
}
|
||||||
|
|
||||||
for (MP42Track *track in _inputTracks) {
|
for (MP42Track *track in _inputTracks) {
|
||||||
demuxHelper = track.muxer_helper->demuxer_context;
|
demuxHelper = track.muxer_helper->demuxer_context;
|
||||||
@@ -766,8 +768,9 @@
|
|||||||
currentDataLength += sampleSize;
|
currentDataLength += sampleSize;
|
||||||
} else {
|
} else {
|
||||||
// The CMSampleBufferRef contains more than one sample
|
// The CMSampleBufferRef contains more than one sample
|
||||||
if (!CMSampleBufferDataIsReady(sampleBuffer))
|
if (!CMSampleBufferDataIsReady(sampleBuffer)) {
|
||||||
CMSampleBufferMakeDataReady(sampleBuffer);
|
CMSampleBufferMakeDataReady(sampleBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
// A CMSampleBufferRef can contains an unknown number of samples, check how many needs to be divided to separated MP42SampleBuffers
|
// A CMSampleBufferRef can contains an unknown number of samples, check how many needs to be divided to separated MP42SampleBuffers
|
||||||
// First get the array with the timings for each sample
|
// First get the array with the timings for each sample
|
||||||
@@ -918,7 +921,7 @@
|
|||||||
|
|
||||||
AVFDemuxHelper *helper = inputTrack.muxer_helper->demuxer_context;
|
AVFDemuxHelper *helper = inputTrack.muxer_helper->demuxer_context;
|
||||||
|
|
||||||
for (int i = 0; i < helper->editsConstructor.editsCount; i++) {
|
for (uint64_t i = 0; i < helper->editsConstructor.editsCount; i++) {
|
||||||
CMTimeRange timeRange = helper->editsConstructor.edits[i];
|
CMTimeRange timeRange = helper->editsConstructor.edits[i];
|
||||||
CMTime duration = CMTimeConvertScale(timeRange.duration, timescale, kCMTimeRoundingMethod_Default);
|
CMTime duration = CMTimeConvertScale(timeRange.duration, timescale, kCMTimeRoundingMethod_Default);
|
||||||
|
|
||||||
|
|||||||
@@ -182,14 +182,15 @@ OSStatus EncoderDataProc(AudioConverterRef inAudioConverter,
|
|||||||
if (!err && cookieSize) {
|
if (!err && cookieSize) {
|
||||||
char* cookie = (char *) malloc(cookieSize);
|
char* cookie = (char *) malloc(cookieSize);
|
||||||
UInt8* cookieBuffer;
|
UInt8* cookieBuffer;
|
||||||
int size;
|
|
||||||
|
|
||||||
err = AudioConverterGetProperty(converterEnc, kAudioConverterCompressionMagicCookie, &cookieSize, cookie);
|
err = AudioConverterGetProperty(converterEnc, kAudioConverterCompressionMagicCookie, &cookieSize, cookie);
|
||||||
if (err) {
|
if (err) {
|
||||||
NSLog(@"err Get Cookie From AudioConverter");
|
NSLog(@"err Get Cookie From AudioConverter");
|
||||||
}
|
}
|
||||||
ReadESDSDescExt(cookie, &cookieBuffer, &size, 1);
|
|
||||||
outputMagicCookie = [[NSData dataWithBytes:cookieBuffer length:size] retain];
|
int ESDSsize;
|
||||||
|
ReadESDSDescExt(cookie, &cookieBuffer, &ESDSsize, 1);
|
||||||
|
outputMagicCookie = [[NSData dataWithBytes:cookieBuffer length:ESDSsize] retain];
|
||||||
|
|
||||||
free(cookieBuffer);
|
free(cookieBuffer);
|
||||||
free(cookie);
|
free(cookie);
|
||||||
@@ -199,7 +200,7 @@ OSStatus EncoderDataProc(AudioConverterRef inAudioConverter,
|
|||||||
SInt64 outputPos = 0;
|
SInt64 outputPos = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
AudioStreamPacketDescription odesc = {0};
|
AudioStreamPacketDescription odesc = {0, 0, 0};
|
||||||
|
|
||||||
// set up output buffer list
|
// set up output buffer list
|
||||||
AudioBufferList fillBufList;
|
AudioBufferList fillBufList;
|
||||||
@@ -208,8 +209,9 @@ OSStatus EncoderDataProc(AudioConverterRef inAudioConverter,
|
|||||||
fillBufList.mBuffers[0].mDataByteSize = theOutputBufSize;
|
fillBufList.mBuffers[0].mDataByteSize = theOutputBufSize;
|
||||||
fillBufList.mBuffers[0].mData = outputBuffer;
|
fillBufList.mBuffers[0].mData = outputBuffer;
|
||||||
|
|
||||||
while ((sfifo_used(&fifo) < (inputFormat.mBytesPerPacket * encoderFormat.mFramesPerPacket * 4)) && !readerDone)
|
while ((sfifo_used(&fifo) < (inputFormat.mBytesPerPacket * encoderFormat.mFramesPerPacket * 4)) && !readerDone) {
|
||||||
usleep(500);
|
usleep(500);
|
||||||
|
}
|
||||||
|
|
||||||
// convert data
|
// convert data
|
||||||
UInt32 ioOutputDataPackets = 1;
|
UInt32 ioOutputDataPackets = 1;
|
||||||
@@ -401,8 +403,9 @@ OSStatus DecoderDataProc(AudioConverterRef inAudioConverter,
|
|||||||
hb_sample_t *samples = (hb_sample_t *)malloc(samplesBufferSize);
|
hb_sample_t *samples = (hb_sample_t *)malloc(samplesBufferSize);
|
||||||
hb_downmix(downmix, samples, downmix_buffer, ioOutputDataPackets);
|
hb_downmix(downmix, samples, downmix_buffer, ioOutputDataPackets);
|
||||||
|
|
||||||
while (sfifo_space(&fifo) < (samplesBufferSize))
|
while (sfifo_space(&fifo) < (samplesBufferSize)) {
|
||||||
usleep(5000);
|
usleep(5000);
|
||||||
|
}
|
||||||
|
|
||||||
sfifo_write(&fifo, samples, samplesBufferSize);
|
sfifo_write(&fifo, samples, samplesBufferSize);
|
||||||
free(samples);
|
free(samples);
|
||||||
@@ -410,8 +413,9 @@ OSStatus DecoderDataProc(AudioConverterRef inAudioConverter,
|
|||||||
else {
|
else {
|
||||||
UInt32 inNumBytes = fillBufList.mBuffers[0].mDataByteSize;
|
UInt32 inNumBytes = fillBufList.mBuffers[0].mDataByteSize;
|
||||||
|
|
||||||
while (sfifo_space(&fifo) < inNumBytes)
|
while (sfifo_space(&fifo) < inNumBytes) {
|
||||||
usleep(5000);
|
usleep(5000);
|
||||||
|
}
|
||||||
|
|
||||||
sfifo_write(&fifo, outputBuffer, inNumBytes);
|
sfifo_write(&fifo, outputBuffer, inNumBytes);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ void FFInitFFmpeg() {
|
|||||||
if (!sampleBuffer)
|
if (!sampleBuffer)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
int ret, got_sub, i;
|
int ret, got_sub;
|
||||||
uint32_t *imageData;
|
uint32_t *imageData;
|
||||||
BOOL forced = NO;
|
BOOL forced = NO;
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ void FFInitFFmpeg() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < subtitle.num_rects; i++) {
|
for (unsigned i = 0; i < subtitle.num_rects; i++) {
|
||||||
AVSubtitleRect *rect = subtitle.rects[i];
|
AVSubtitleRect *rect = subtitle.rects[i];
|
||||||
NSString *text;
|
NSString *text;
|
||||||
|
|
||||||
@@ -447,7 +447,7 @@ void FFInitFFmpeg() {
|
|||||||
av_freep(&codecData);
|
av_freep(&codecData);
|
||||||
}
|
}
|
||||||
if (subtitle.rects) {
|
if (subtitle.rects) {
|
||||||
for (int i = 0; i < subtitle.num_rects; i++) {
|
for (unsigned i = 0; i < subtitle.num_rects; i++) {
|
||||||
av_freep(&subtitle.rects[i]->pict.data[0]);
|
av_freep(&subtitle.rects[i]->pict.data[0]);
|
||||||
av_freep(&subtitle.rects[i]->pict.data[1]);
|
av_freep(&subtitle.rects[i]->pict.data[1]);
|
||||||
av_freep(&subtitle.rects[i]);
|
av_freep(&subtitle.rects[i]);
|
||||||
|
|||||||
@@ -9,7 +9,5 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "MP42FileImporter.h"
|
#import "MP42FileImporter.h"
|
||||||
|
|
||||||
@interface MP42CCImporter : MP42FileImporter {
|
@interface MP42CCImporter : MP42FileImporter
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
- (MP42TextSample *)chapterAtIndex:(NSUInteger)index;
|
- (MP42TextSample *)chapterAtIndex:(NSUInteger)index;
|
||||||
|
|
||||||
- (NSInteger)chapterCount;
|
- (NSUInteger)chapterCount;
|
||||||
|
|
||||||
- (BOOL)updateFromCSVFile:(NSURL *)URL error:(NSError **)outError;
|
- (BOOL)updateFromCSVFile:(NSURL *)URL error:(NSError **)outError;
|
||||||
|
|
||||||
|
|||||||
@@ -190,12 +190,13 @@
|
|||||||
if (!refTrack)
|
if (!refTrack)
|
||||||
refTrack = 1;
|
refTrack = 1;
|
||||||
|
|
||||||
chapterCount = [chapters count];
|
chapterCount = chapters.count;
|
||||||
|
|
||||||
if (chapterCount) {
|
if (chapterCount) {
|
||||||
// Insert a chapter at time 0 if there isn't one
|
// Insert a chapter at time 0 if there isn't one
|
||||||
MP42TextSample * chapter = [chapters objectAtIndex:0];
|
MP42TextSample *firstChapter = chapters.firstObject;
|
||||||
if (chapter.timestamp != 0) {
|
|
||||||
|
if (firstChapter.timestamp != 0) {
|
||||||
MP42TextSample *st = [[MP42TextSample alloc] init];
|
MP42TextSample *st = [[MP42TextSample alloc] init];
|
||||||
st.timestamp = 0;
|
st.timestamp = 0;
|
||||||
st.title = @"Chapter 0";
|
st.title = @"Chapter 0";
|
||||||
@@ -256,9 +257,9 @@
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSInteger)chapterCount
|
- (NSUInteger)chapterCount
|
||||||
{
|
{
|
||||||
return [chapters count];
|
return chapters.count;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)exportToURL:(NSURL *)url error:(NSError **)error
|
- (BOOL)exportToURL:(NSURL *)url error:(NSError **)error
|
||||||
@@ -281,7 +282,7 @@
|
|||||||
- (BOOL)updateFromCSVFile:(NSURL *)URL error:(NSError **)outError {
|
- (BOOL)updateFromCSVFile:(NSURL *)URL error:(NSError **)outError {
|
||||||
NSArray *csvData = [NSArray arrayWithContentsOfCSVURL:URL];
|
NSArray *csvData = [NSArray arrayWithContentsOfCSVURL:URL];
|
||||||
if (csvData.count == self.chapterCount) {
|
if (csvData.count == self.chapterCount) {
|
||||||
for (NSInteger i = 0; i < csvData.count; ++i) {
|
for (NSUInteger i = 0; i < csvData.count; ++i) {
|
||||||
NSArray *lineFields = csvData[i];
|
NSArray *lineFields = csvData[i];
|
||||||
if (lineFields.count != 2 || [lineFields[0] integerValue] != i + 1) {
|
if (lineFields.count != 2 || [lineFields[0] integerValue] != i + 1) {
|
||||||
if (NULL != outError)
|
if (NULL != outError)
|
||||||
@@ -289,7 +290,7 @@
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (NSInteger i = 0; i < csvData.count; ++i) {
|
for (NSUInteger i = 0; i < csvData.count; ++i) {
|
||||||
MP42TextSample *chapter = self.chapters[i];
|
MP42TextSample *chapter = self.chapters[i];
|
||||||
chapter.title = csvData[i][1];
|
chapter.title = csvData[i][1];
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -500,7 +500,7 @@ static void logCallback(MP4LogLevel loglevel, const char *fmt, va_list ap) {
|
|||||||
MP42MediaTypeAudio,
|
MP42MediaTypeAudio,
|
||||||
MP42MediaTypeSubtitle];
|
MP42MediaTypeSubtitle];
|
||||||
|
|
||||||
for (int i = 0; i < [typeToOrganize count]; i++) {
|
for (NSUInteger i = 0; i < typeToOrganize.count; i++) {
|
||||||
[self organizeAlternateGroupsForMediaType:[typeToOrganize objectAtIndex:i]
|
[self organizeAlternateGroupsForMediaType:[typeToOrganize objectAtIndex:i]
|
||||||
withGroupID:i];
|
withGroupID:i];
|
||||||
}
|
}
|
||||||
@@ -582,7 +582,7 @@ static void logCallback(MP4LogLevel loglevel, const char *fmt, va_list ap) {
|
|||||||
if (noErr && [[[MP42File alloc] initWithExistingFile:tempURL andDelegate:nil] autorelease]) {
|
if (noErr && [[[MP42File alloc] initWithExistingFile:tempURL andDelegate:nil] autorelease]) {
|
||||||
// Replace the original file
|
// Replace the original file
|
||||||
NSURL *result = nil;
|
NSURL *result = nil;
|
||||||
noErr = [fileManager replaceItemAtURL:self.URL withItemAtURL:tempURL backupItemName:nil options:0 resultingItemURL:&result error:&error];
|
noErr = [fileManager replaceItemAtURL:self.URL withItemAtURL:tempURL backupItemName:nil options:NSFileManagerItemReplacementWithoutDeletingBackupItem resultingItemURL:&result error:&error];
|
||||||
if (noErr) {
|
if (noErr) {
|
||||||
self.URL = result;
|
self.URL = result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
CGFloat _progress;
|
CGFloat _progress;
|
||||||
int32_t _cancelled;
|
int32_t _cancelled;
|
||||||
int32_t _done;
|
int32_t _done;
|
||||||
|
|
||||||
|
@private
|
||||||
dispatch_semaphore_t _doneSem;
|
dispatch_semaphore_t _doneSem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,8 +62,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
- (BOOL)cleanUp:(MP42FileHandle)fileHandle;
|
- (BOOL)cleanUp:(MP42FileHandle)fileHandle;
|
||||||
|
|
||||||
@property(readonly) MP42Metadata *metadata;
|
@property(nonatomic, readonly) MP42Metadata *metadata;
|
||||||
@property(readonly) NSArray<MP42Track *> *tracks;
|
@property(nonatomic, readonly) NSArray<MP42Track *> *tracks;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
+8
-11
@@ -59,18 +59,15 @@
|
|||||||
[[fileURL pathExtension] caseInsensitiveCompare: @"idx"] == NSOrderedSame)
|
[[fileURL pathExtension] caseInsensitiveCompare: @"idx"] == NSOrderedSame)
|
||||||
self = [MP42VobSubImporter alloc];
|
self = [MP42VobSubImporter alloc];
|
||||||
#if !__LP64__
|
#if !__LP64__
|
||||||
/*else if ([[fileURL pathExtension] caseInsensitiveCompare: @"mov"] == NSOrderedSame) {
|
else if ([[fileURL pathExtension] caseInsensitiveCompare: @"mov"] == NSOrderedSame) {
|
||||||
self = [MP42QTImporter alloc];
|
self = [MP42QTImporter alloc];
|
||||||
}*/
|
}
|
||||||
#endif
|
#endif
|
||||||
// If we are on 10.7 or later, use the AVFoundation path
|
else if ([[fileURL pathExtension] caseInsensitiveCompare: @"m2ts"] == NSOrderedSame ||
|
||||||
else if (NSClassFromString(@"AVAsset")) {
|
[[fileURL pathExtension] caseInsensitiveCompare: @"ts"] == NSOrderedSame ||
|
||||||
if ([[fileURL pathExtension] caseInsensitiveCompare: @"m2ts"] == NSOrderedSame ||
|
[[fileURL pathExtension] caseInsensitiveCompare: @"mts"] == NSOrderedSame ||
|
||||||
[[fileURL pathExtension] caseInsensitiveCompare: @"ts"] == NSOrderedSame ||
|
[[fileURL pathExtension] caseInsensitiveCompare: @"mov"] == NSOrderedSame) {
|
||||||
[[fileURL pathExtension] caseInsensitiveCompare: @"mts"] == NSOrderedSame ||
|
self = [MP42AVFImporter alloc];
|
||||||
[[fileURL pathExtension] caseInsensitiveCompare: @"mov"] == NSOrderedSame) {
|
|
||||||
self = [MP42AVFImporter alloc];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self) {
|
if (self) {
|
||||||
@@ -162,7 +159,7 @@
|
|||||||
|
|
||||||
- (BOOL)done
|
- (BOOL)done
|
||||||
{
|
{
|
||||||
return _done;
|
return (_done > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setDone:(BOOL)status {
|
- (void)setDone:(BOOL)status {
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ typedef struct
|
|||||||
} h264_dpb_t;
|
} h264_dpb_t;
|
||||||
|
|
||||||
@interface MP42H264Importer : MP42FileImporter {
|
@interface MP42H264Importer : MP42FileImporter {
|
||||||
FILE* inFile;
|
@private
|
||||||
|
FILE *inFile;
|
||||||
int64_t _size;
|
int64_t _size;
|
||||||
|
|
||||||
NSData *avcC;
|
NSData *avcC;
|
||||||
|
|||||||
@@ -37,11 +37,11 @@ int compare_color(rgba_color c1, rgba_color c2);
|
|||||||
|
|
||||||
- (instancetype)initWithStyle:(NSInteger)style type:(NSInteger)type location:(NSUInteger) location color:(rgba_color) color;
|
- (instancetype)initWithStyle:(NSInteger)style type:(NSInteger)type location:(NSUInteger) location color:(rgba_color) color;
|
||||||
|
|
||||||
@property (readwrite) NSInteger style;
|
@property (nonatomic, readwrite) NSInteger style;
|
||||||
@property (readwrite) rgba_color color;
|
@property (nonatomic, readwrite) rgba_color color;
|
||||||
@property (readwrite) NSInteger type;
|
@property (nonatomic, readwrite) NSInteger type;
|
||||||
@property (readwrite) NSUInteger location;
|
@property (nonatomic, readwrite) NSUInteger location;
|
||||||
@property (readwrite) NSUInteger length;
|
@property (nonatomic, readwrite) NSUInteger length;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -53,9 +53,9 @@ int compare_color(rgba_color c1, rgba_color c2);
|
|||||||
rgba_color _defaultColor;
|
rgba_color _defaultColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@property (readonly) NSString *text;
|
@property (nonatomic, readonly) NSString *text;
|
||||||
@property (readonly) NSArray *styles;
|
@property (nonatomic, readonly) NSArray *styles;
|
||||||
@property (readwrite) rgba_color defaultColor;
|
@property (nonatomic, readwrite) rgba_color defaultColor;
|
||||||
|
|
||||||
- (instancetype)initWithString:(NSString *)string;
|
- (instancetype)initWithString:(NSString *)string;
|
||||||
- (NSInteger) parseNextTag;
|
- (NSInteger) parseNextTag;
|
||||||
|
|||||||
+11
-11
@@ -1441,16 +1441,16 @@ static const genreType_t genreType_strings[] = {
|
|||||||
dataFromPropertyList:iTunMovi
|
dataFromPropertyList:iTunMovi
|
||||||
format:NSPropertyListXMLFormat_v1_0
|
format:NSPropertyListXMLFormat_v1_0
|
||||||
errorDescription:nil];
|
errorDescription:nil];
|
||||||
if ([iTunMovi count]) {
|
if (iTunMovi.count) {
|
||||||
MP4ItmfItemList* list = MP4ItmfGetItemsByMeaning(fileHandle, "com.apple.iTunes", "iTunMOVI");
|
MP4ItmfItemList *moviList = MP4ItmfGetItemsByMeaning(fileHandle, "com.apple.iTunes", "iTunMOVI");
|
||||||
if (list) {
|
if (moviList) {
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i = 0; i < list->size; i++) {
|
for (i = 0; i < moviList->size; i++) {
|
||||||
MP4ItmfItem* item = &list->elements[i];
|
MP4ItmfItem *item = &moviList->elements[i];
|
||||||
MP4ItmfRemoveItem(fileHandle, item);
|
MP4ItmfRemoveItem(fileHandle, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MP4ItmfItemListFree(list);
|
MP4ItmfItemListFree(moviList);
|
||||||
|
|
||||||
MP4ItmfItem* newItem = MP4ItmfItemAlloc( "----", 1 );
|
MP4ItmfItem* newItem = MP4ItmfItemAlloc( "----", 1 );
|
||||||
newItem->mean = strdup( "com.apple.iTunes" );
|
newItem->mean = strdup( "com.apple.iTunes" );
|
||||||
@@ -1466,15 +1466,15 @@ static const genreType_t genreType_strings[] = {
|
|||||||
MP4ItmfItemFree(newItem);
|
MP4ItmfItemFree(newItem);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MP4ItmfItemList* list = MP4ItmfGetItemsByMeaning(fileHandle, "com.apple.iTunes", "iTunMOVI");
|
MP4ItmfItemList* moviList = MP4ItmfGetItemsByMeaning(fileHandle, "com.apple.iTunes", "iTunMOVI");
|
||||||
if (list) {
|
if (moviList) {
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
for (i = 0; i < list->size; i++) {
|
for (i = 0; i < moviList->size; i++) {
|
||||||
MP4ItmfItem* item = &list->elements[i];
|
MP4ItmfItem* item = &moviList->elements[i];
|
||||||
MP4ItmfRemoveItem(fileHandle, item);
|
MP4ItmfRemoveItem(fileHandle, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MP4ItmfItemListFree(list);
|
MP4ItmfItemListFree(moviList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#import "MP42FileImporter.h"
|
#import "MP42FileImporter.h"
|
||||||
|
|
||||||
@interface MP42MkvImporter : MP42FileImporter {
|
@interface MP42MkvImporter : MP42FileImporter {
|
||||||
|
@private
|
||||||
struct MatroskaFile *_matroskaFile;
|
struct MatroskaFile *_matroskaFile;
|
||||||
struct StdIoStream *_ioStream;
|
struct StdIoStream *_ioStream;
|
||||||
|
|
||||||
|
|||||||
+10
-10
@@ -590,7 +590,6 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t
|
|||||||
uint32_t Track, FrameSize, FrameFlags;
|
uint32_t Track, FrameSize, FrameFlags;
|
||||||
uint8_t *frame = NULL;
|
uint8_t *frame = NULL;
|
||||||
|
|
||||||
MP42Track *track = nil;
|
|
||||||
MatroskaDemuxHelper *demuxHelper = nil;
|
MatroskaDemuxHelper *demuxHelper = nil;
|
||||||
MatroskaSample *frameSample = nil, *currentSample = nil;
|
MatroskaSample *frameSample = nil, *currentSample = nil;
|
||||||
int64_t offset, minOffset = 0, duration, next_duration;
|
int64_t offset, minOffset = 0, duration, next_duration;
|
||||||
@@ -611,6 +610,8 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t
|
|||||||
_progress = (StartTime / _fileDuration / 10000);
|
_progress = (StartTime / _fileDuration / 10000);
|
||||||
muxer_helper *helper = NULL;
|
muxer_helper *helper = NULL;
|
||||||
|
|
||||||
|
MP42Track *track = nil;
|
||||||
|
|
||||||
for (MP42Track *fTrack in _inputTracks){
|
for (MP42Track *fTrack in _inputTracks){
|
||||||
if (fTrack.sourceId == Track) {
|
if (fTrack.sourceId == Track) {
|
||||||
helper = fTrack.muxer_helper;
|
helper = fTrack.muxer_helper;
|
||||||
@@ -643,23 +644,23 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t
|
|||||||
|
|
||||||
#ifdef VARIABLE_AUDIO_RATE
|
#ifdef VARIABLE_AUDIO_RATE
|
||||||
if (demuxHelper->previousSample) {
|
if (demuxHelper->previousSample) {
|
||||||
uint64_t duration = (sample->timestamp * (double)mkv_TruncFloat(trackInfo->AV.Audio.SamplingFreq) / 1000000000.f) - demuxHelper->current_time;
|
uint64_t sampleDuration = (sample->timestamp * (double)mkv_TruncFloat(trackInfo->AV.Audio.SamplingFreq) / 1000000000.f) - demuxHelper->current_time;
|
||||||
|
|
||||||
// MKV timestamps are a bit random, try to round them
|
// MKV timestamps are a bit random, try to round them
|
||||||
// to make the sample table in the mp4 smaller.
|
// to make the sample table in the mp4 smaller.
|
||||||
|
|
||||||
// Round aac
|
// Round aac
|
||||||
if (duration < 1060 && duration > 990)
|
if (sampleDuration < 1060 && sampleDuration > 990)
|
||||||
duration = 1024;
|
sampleDuration = 1024;
|
||||||
|
|
||||||
// Round ac3
|
// Round ac3
|
||||||
if (duration < 1576 && duration > 1500)
|
if (sampleDuration < 1576 && sampleDuration > 1500)
|
||||||
duration = 1536;
|
sampleDuration = 1536;
|
||||||
|
|
||||||
demuxHelper->previousSample->duration = duration;
|
demuxHelper->previousSample->duration = sampleDuration;
|
||||||
[self enqueue:demuxHelper->previousSample];
|
[self enqueue:demuxHelper->previousSample];
|
||||||
|
|
||||||
demuxHelper->current_time += duration;
|
demuxHelper->current_time += sampleDuration;
|
||||||
} else {
|
} else {
|
||||||
demuxHelper->current_time = sample->timestamp * (double)mkv_TruncFloat(trackInfo->AV.Audio.SamplingFreq) / 1000000000.f;
|
demuxHelper->current_time = sample->timestamp * (double)mkv_TruncFloat(trackInfo->AV.Audio.SamplingFreq) / 1000000000.f;
|
||||||
}
|
}
|
||||||
@@ -957,8 +958,7 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t
|
|||||||
MP4TrackId trackId = track.Id;
|
MP4TrackId trackId = track.Id;
|
||||||
|
|
||||||
if (demuxHelper->minDisplayOffset != 0) {
|
if (demuxHelper->minDisplayOffset != 0) {
|
||||||
int i;
|
for (unsigned int i = 0; i < demuxHelper->samplesWritten; i++)
|
||||||
for (i = 0; i < demuxHelper->samplesWritten; i++)
|
|
||||||
MP4SetSampleRenderingOffset(fileHandle,
|
MP4SetSampleRenderingOffset(fileHandle,
|
||||||
trackId,
|
trackId,
|
||||||
1 + i,
|
1 + i,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#import "mp4v2.h"
|
#import "mp4v2.h"
|
||||||
|
|
||||||
@interface MP42Mp4Importer : MP42FileImporter <MP42FileDelegate> {
|
@interface MP42Mp4Importer : MP42FileImporter <MP42FileDelegate> {
|
||||||
|
@private
|
||||||
MP4FileHandle _fileHandle;
|
MP4FileHandle _fileHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -174,8 +174,8 @@
|
|||||||
&pictheader, &pictheadersize);
|
&pictheader, &pictheadersize);
|
||||||
NSMutableData *seqData = [[NSMutableData alloc] init];
|
NSMutableData *seqData = [[NSMutableData alloc] init];
|
||||||
for (ix = 0 , iy = 0; seqheadersize[ix] != 0; ix++) {
|
for (ix = 0 , iy = 0; seqheadersize[ix] != 0; ix++) {
|
||||||
uint16_t temp = seqheadersize[ix] << 8;
|
uint16_t tempSeqSize = seqheadersize[ix] << 8;
|
||||||
[seqData appendBytes:&temp length:sizeof(uint16_t)];
|
[seqData appendBytes:&tempSeqSize length:sizeof(uint16_t)];
|
||||||
[seqData appendBytes:seqheader[ix] length:seqheadersize[ix]];
|
[seqData appendBytes:seqheader[ix] length:seqheadersize[ix]];
|
||||||
iy++;
|
iy++;
|
||||||
free(seqheader[ix]);
|
free(seqheader[ix]);
|
||||||
@@ -188,8 +188,8 @@
|
|||||||
|
|
||||||
NSMutableData *pictData = [[NSMutableData alloc] init];
|
NSMutableData *pictData = [[NSMutableData alloc] init];
|
||||||
for (ix = 0, iy = 0; pictheadersize[ix] != 0; ix++) {
|
for (ix = 0, iy = 0; pictheadersize[ix] != 0; ix++) {
|
||||||
uint16_t temp = pictheadersize[ix] << 8;
|
uint16_t tempPictSize = pictheadersize[ix] << 8;
|
||||||
[pictData appendBytes:&temp length:sizeof(uint16_t)];
|
[pictData appendBytes:&tempPictSize length:sizeof(uint16_t)];
|
||||||
[pictData appendBytes:pictheader[ix] length:pictheadersize[ix]];
|
[pictData appendBytes:pictheader[ix] length:pictheadersize[ix]];
|
||||||
iy++;
|
iy++;
|
||||||
free(pictheader[ix]);
|
free(pictheader[ix]);
|
||||||
@@ -231,7 +231,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
MP4Timestamp currentTime = 1;
|
MP4Timestamp currentTime = 1;
|
||||||
MP4Duration duration = MP4GetDuration(_fileHandle);
|
MP4Duration totalDuration = MP4GetDuration(_fileHandle);
|
||||||
MP4Duration timescale = MP4GetTimeScale(_fileHandle);
|
MP4Duration timescale = MP4GetTimeScale(_fileHandle);
|
||||||
|
|
||||||
while (tracksDone != tracksNumber) {
|
while (tracksDone != tracksNumber) {
|
||||||
@@ -282,7 +282,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_progress = ((CGFloat)currentTime * timescale / duration) * 100;
|
_progress = ((CGFloat)currentTime * timescale / totalDuration) * 100;
|
||||||
currentTime += 3;
|
currentTime += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+9
-9
@@ -42,10 +42,10 @@
|
|||||||
- (BOOL)canAddTrack:(MP42Track *)track
|
- (BOOL)canAddTrack:(MP42Track *)track
|
||||||
{
|
{
|
||||||
if (isTrackMuxable(track.format)) {
|
if (isTrackMuxable(track.format)) {
|
||||||
return YES;
|
|
||||||
if ([track isMemberOfClass:[MP42AudioTrack class]]) {
|
if ([track isMemberOfClass:[MP42AudioTrack class]]) {
|
||||||
// TO-DO Check if we can initialize the audio converter
|
// TO-DO Check if we can initialize the audio converter
|
||||||
}
|
}
|
||||||
|
return YES;
|
||||||
} else {
|
} else {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
@@ -250,10 +250,10 @@
|
|||||||
|
|
||||||
NSInteger vPlacement = [(MP42SubtitleTrack*)track verticalPlacement];
|
NSInteger vPlacement = [(MP42SubtitleTrack*)track verticalPlacement];
|
||||||
|
|
||||||
for (id track in _workingTracks)
|
for (id workingTrack in _workingTracks)
|
||||||
if ([track isMemberOfClass:[MP42VideoTrack class]]) {
|
if ([workingTrack isMemberOfClass:[MP42VideoTrack class]]) {
|
||||||
videoSize.width = [track trackWidth];
|
videoSize.width = [workingTrack trackWidth];
|
||||||
videoSize.height = [track trackHeight];
|
videoSize.height = [workingTrack trackHeight];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,10 +361,10 @@
|
|||||||
else if ([track isMemberOfClass:[MP42ClosedCaptionTrack class]]) {
|
else if ([track isMemberOfClass:[MP42ClosedCaptionTrack class]]) {
|
||||||
NSSize videoSize = [helper->importer sizeForTrack:track];
|
NSSize videoSize = [helper->importer sizeForTrack:track];
|
||||||
|
|
||||||
for (id track in _workingTracks)
|
for (id workingTrack in _workingTracks)
|
||||||
if ([track isMemberOfClass:[MP42VideoTrack class]]) {
|
if ([workingTrack isMemberOfClass:[MP42VideoTrack class]]) {
|
||||||
videoSize.width = [track trackWidth];
|
videoSize.width = [workingTrack trackWidth];
|
||||||
videoSize.height = [track trackHeight];
|
videoSize.height = [workingTrack trackHeight];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -686,17 +686,18 @@ MP4Duration getTrackDuration(MP4FileHandle fileHandle, MP4TrackId trackId)
|
|||||||
{
|
{
|
||||||
uint32_t trackEditsCount = MP4GetTrackNumberOfEdits(fileHandle, trackId);
|
uint32_t trackEditsCount = MP4GetTrackNumberOfEdits(fileHandle, trackId);
|
||||||
MP4Duration duration = 0;
|
MP4Duration duration = 0;
|
||||||
int i = 1;
|
uint32_t i = 1;
|
||||||
|
|
||||||
while( i <= trackEditsCount) {
|
while (i <= trackEditsCount) {
|
||||||
duration += MP4GetTrackEditDuration(fileHandle, trackId, i);
|
duration += MP4GetTrackEditDuration(fileHandle, trackId, i);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (duration == 0)
|
if (duration == 0) {
|
||||||
duration = MP4ConvertFromTrackDuration(fileHandle, trackId,
|
duration = MP4ConvertFromTrackDuration(fileHandle, trackId,
|
||||||
MP4GetTrackDuration(fileHandle, trackId),
|
MP4GetTrackDuration(fileHandle, trackId),
|
||||||
MP4GetTimeScale(fileHandle));
|
MP4GetTimeScale(fileHandle));
|
||||||
|
}
|
||||||
|
|
||||||
return duration;
|
return duration;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#import <QTKit/QTKit.h>
|
#import <QTKit/QTKit.h>
|
||||||
|
|
||||||
@interface MP42QTImporter : MP42FileImporter {
|
@interface MP42QTImporter : MP42FileImporter {
|
||||||
|
@private
|
||||||
QTMovie *_sourceFile;
|
QTMovie *_sourceFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-6
@@ -8,22 +8,27 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface MP42Ratings : NSObject {
|
@interface MP42Ratings : NSObject {
|
||||||
|
@private
|
||||||
NSMutableArray *ratingsDictionary;
|
NSMutableArray *ratingsDictionary;
|
||||||
NSMutableArray *ratings;
|
NSMutableArray<NSString *> *ratings;
|
||||||
NSMutableArray *iTunesCodes;
|
NSMutableArray<NSString *> *iTunesCodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@property(readonly) NSArray *ratings;
|
@property (atomic, readonly) NSArray<NSString *> *ratings;
|
||||||
@property(readonly) NSArray *iTunesCodes;
|
@property (atomic, readonly) NSArray<NSString *> *iTunesCodes;
|
||||||
|
|
||||||
+ (MP42Ratings *) defaultManager;
|
+ (MP42Ratings *)defaultManager;
|
||||||
|
|
||||||
- (void)updateRatingsCountry;
|
- (void)updateRatingsCountry;
|
||||||
- (NSArray *) ratingsCountries;
|
- (NSArray<NSString *> *) ratingsCountries;
|
||||||
|
|
||||||
- (NSUInteger) unknownIndex;
|
- (NSUInteger) unknownIndex;
|
||||||
- (NSUInteger) ratingIndexForiTunesCode:(NSString *)aiTunesCode;
|
- (NSUInteger) ratingIndexForiTunesCode:(NSString *)aiTunesCode;
|
||||||
- (NSUInteger) ratingIndexForiTunesCountry:(NSString *)aCountry media:(NSString *)aMedia ratingString:(NSString *)aRatingString;
|
- (NSUInteger) ratingIndexForiTunesCountry:(NSString *)aCountry media:(NSString *)aMedia ratingString:(NSString *)aRatingString;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
+2
-2
@@ -105,7 +105,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (NSUInteger) ratingIndexForiTunesCode:(NSString *)aiTunesCode {
|
- (NSUInteger) ratingIndexForiTunesCode:(NSString *)aiTunesCode {
|
||||||
for (int i = 0; i < [iTunesCodes count]; i++) {
|
for (NSUInteger i = 0; i < [iTunesCodes count]; i++) {
|
||||||
if ([[iTunesCodes objectAtIndex:i] isEqualToString:aiTunesCode]) {
|
if ([[iTunesCodes objectAtIndex:i] isEqualToString:aiTunesCode]) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
- (NSUInteger) ratingIndexForiTunesCountry:(NSString *)aCountry media:(NSString *)aMedia ratingString:(NSString *)aRatingString {
|
- (NSUInteger) ratingIndexForiTunesCountry:(NSString *)aCountry media:(NSString *)aMedia ratingString:(NSString *)aRatingString {
|
||||||
NSString *target1 = [[NSString stringWithFormat:@"%@ %@: %@", aCountry, aMedia, aRatingString] lowercaseString];
|
NSString *target1 = [[NSString stringWithFormat:@"%@ %@: %@", aCountry, aMedia, aRatingString] lowercaseString];
|
||||||
NSString *target2 = [[NSString stringWithFormat:@"%@ %@: %@", aCountry, @"movie & TV", aRatingString] lowercaseString];
|
NSString *target2 = [[NSString stringWithFormat:@"%@ %@: %@", aCountry, @"movie & TV", aRatingString] lowercaseString];
|
||||||
for (int i = 0; i < [ratings count]; i++) {
|
for (NSUInteger i = 0; i < [ratings count]; i++) {
|
||||||
if ([[[ratings objectAtIndex:i] lowercaseString] isEqualToString:target1] || [[[ratings objectAtIndex:i] lowercaseString] isEqualToString:target2]) {
|
if ([[[ratings objectAtIndex:i] lowercaseString] isEqualToString:target1] || [[[ratings objectAtIndex:i] lowercaseString] isEqualToString:target2]) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
@class SBSubSerializer;
|
@class SBSubSerializer;
|
||||||
|
|
||||||
@interface MP42SrtImporter : MP42FileImporter {
|
@interface MP42SrtImporter : MP42FileImporter {
|
||||||
|
@private
|
||||||
SBSubSerializer *_ss;
|
SBSubSerializer *_ss;
|
||||||
|
|
||||||
BOOL _verticalPlacement;
|
BOOL _verticalPlacement;
|
||||||
|
|||||||
@@ -271,8 +271,8 @@ NSMutableString *STStandardizeStringNewlines(NSString *str)
|
|||||||
if(str == nil)
|
if(str == nil)
|
||||||
return nil;
|
return nil;
|
||||||
NSMutableString *ms = [NSMutableString stringWithString:str];
|
NSMutableString *ms = [NSMutableString stringWithString:str];
|
||||||
[ms replaceOccurrencesOfString:@"\r\n" withString:@"\n" options:0 range:NSMakeRange(0,[ms length])];
|
[ms replaceOccurrencesOfString:@"\r\n" withString:@"\n" options:NSLiteralSearch range:NSMakeRange(0,[ms length])];
|
||||||
[ms replaceOccurrencesOfString:@"\r" withString:@"\n" options:0 range:NSMakeRange(0,[ms length])];
|
[ms replaceOccurrencesOfString:@"\r" withString:@"\n" options:NSLiteralSearch range:NSMakeRange(0,[ms length])];
|
||||||
return ms;
|
return ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1311,7 +1311,6 @@ Boolean ReadPacketTimes(uint8_t *packet, uint32_t length, uint16_t *startTime, u
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
return NO;
|
return NO;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(i != INT_MAX)
|
if(i != INT_MAX)
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
if (_Id) {
|
if (_Id) {
|
||||||
[super writeToFile:fileHandle error:outError];
|
[super writeToFile:fileHandle error:outError];
|
||||||
|
|
||||||
if (trackWidth && trackHeight) {
|
if (trackWidth > 0 && trackHeight > 0) {
|
||||||
MP4SetTrackFloatProperty(fileHandle, _Id, "tkhd.width", trackWidth);
|
MP4SetTrackFloatProperty(fileHandle, _Id, "tkhd.width", trackWidth);
|
||||||
|
|
||||||
MP4SetTrackFloatProperty(fileHandle, _Id, "tkhd.height", trackHeight);
|
MP4SetTrackFloatProperty(fileHandle, _Id, "tkhd.height", trackHeight);
|
||||||
@@ -146,7 +146,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return _Id;
|
return (_Id > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)defaultName {
|
- (NSString *)defaultName {
|
||||||
@@ -267,11 +267,11 @@
|
|||||||
offsetX = [decoder decodeInt32ForKey:@"offsetX"];
|
offsetX = [decoder decodeInt32ForKey:@"offsetX"];
|
||||||
offsetY = [decoder decodeInt32ForKey:@"offsetY"];
|
offsetY = [decoder decodeInt32ForKey:@"offsetY"];
|
||||||
|
|
||||||
_origProfile = [decoder decodeInt32ForKey:@"origProfile"];
|
_origProfile = [decoder decodeIntForKey:@"origProfile"];
|
||||||
_origLevel = [decoder decodeInt32ForKey:@"origLevel"];
|
_origLevel = [decoder decodeIntForKey:@"origLevel"];
|
||||||
|
|
||||||
_newProfile = [decoder decodeInt32ForKey:@"newProfile"];
|
_newProfile = [decoder decodeIntForKey:@"newProfile"];
|
||||||
_newLevel = [decoder decodeInt32ForKey:@"newLevel"];
|
_newLevel = [decoder decodeIntForKey:@"newLevel"];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#import "MP42FileImporter.h"
|
#import "MP42FileImporter.h"
|
||||||
|
|
||||||
@interface MP42VobSubImporter : MP42FileImporter {
|
@interface MP42VobSubImporter : MP42FileImporter {
|
||||||
|
@private
|
||||||
NSArray *_VobSubTracks;
|
NSArray *_VobSubTracks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@class MP42Metadata;
|
@class MP42Metadata;
|
||||||
|
|
||||||
@interface MP42XMLReader : NSObject {
|
@interface MP42XMLReader : NSObject {
|
||||||
@@ -16,6 +18,8 @@
|
|||||||
|
|
||||||
- (instancetype)initWithURL:(NSURL *)url error:(NSError **)error;
|
- (instancetype)initWithURL:(NSURL *)url error:(NSError **)error;
|
||||||
|
|
||||||
@property(readonly) MP42Metadata *mMetadata;
|
@property (nonatomic, readonly) MP42Metadata *mMetadata;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
+1
-124
@@ -3,9 +3,7 @@
|
|||||||
// Subler
|
// Subler
|
||||||
//
|
//
|
||||||
// Created by Damiano Galassi on 13/12/12.
|
// Created by Damiano Galassi on 13/12/12.
|
||||||
// Duplicate and fix QTMetadataItem so it can be compiled while targetting 10.6.
|
// Almost all the constants from QTMetadataItem all broken, @ instead of ©.
|
||||||
// Who knows the reason, it's so easy in Cocoa to check if a class exists at runtime...
|
|
||||||
// Oh and almost all the constants from QTMetadataItem all broken, @ instead of ©.
|
|
||||||
// Plus define a QTKit costant.
|
// Plus define a QTKit costant.
|
||||||
|
|
||||||
#import <QTKit/QTKit.h>
|
#import <QTKit/QTKit.h>
|
||||||
@@ -30,124 +28,3 @@ extern NSString * const QTTrackLanguageAttribute; // NSNumber (long)
|
|||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface QTMovie (QTMovie_MetadataReading_10_6_Fix)
|
|
||||||
|
|
||||||
#if (defined(MAC_OS_X_VERSION_10_7))
|
|
||||||
/*!
|
|
||||||
@method commonMetadata
|
|
||||||
@abstract Returns an NSArray containing QTMetadataItem objects for each common metadata key for which a value for the current locale is available.
|
|
||||||
@result An NSArray containing QTMetadataItem objects for each common metadata key for which a value for the current locale is available; may be nil if there is no metadata that's appropriately localized.
|
|
||||||
@discussion The returned metadata may be tagged with default locale information or with no locale information, if that's the best available choice.
|
|
||||||
*/
|
|
||||||
- (NSArray *)commonMetadata;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@method availableMetadataFormats
|
|
||||||
@abstract Returns an NSArray containing NSString objects representing the metadata formats available to the receiver.
|
|
||||||
@result An NSArray containing an NSString objects, each of which represents a metadata format that is available to the receiver.
|
|
||||||
*/
|
|
||||||
- (NSArray *)availableMetadataFormats;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@method metadataForFormat:
|
|
||||||
@abstract Returns an NSArray of QTMetadataItem objects having a specified format.
|
|
||||||
@param format
|
|
||||||
The metadata format for which items are requested.
|
|
||||||
@result An NSArray containing all QTMetadataItem objects of the receiver that have the specified format; may be nil if there is no metadata of the specified format.
|
|
||||||
*/
|
|
||||||
- (NSArray *)metadataForFormat:(NSString *)format;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
|
|
||||||
#if (defined(MAC_OS_X_VERSION_10_7))
|
|
||||||
/*!
|
|
||||||
@class QTMetadataItem
|
|
||||||
@abstract QTMetadataItem represents an item of metadata associated with a QTMovie or QTTrack object.
|
|
||||||
|
|
||||||
@discussion QTMetadataItem objects have keys that accord with the specification of the container format from which they're drawn.
|
|
||||||
|
|
||||||
You can filter arrays of QTMetadataItem objects by locale or by key and keyspace via the category
|
|
||||||
QTMetadataItem_ArrayFiltering defined below.
|
|
||||||
*/
|
|
||||||
|
|
||||||
@class QTMetadataItemInternal;
|
|
||||||
|
|
||||||
@interface QTMetadataItem : NSObject <NSCopying, NSMutableCopying, NSCoding>
|
|
||||||
{
|
|
||||||
QTMetadataItemInternal *_priv;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* indicates the key of the metadata item */
|
|
||||||
@property (readonly, copy) id<NSCopying> key;
|
|
||||||
|
|
||||||
/* indicates the keyspace of the metadata item's key; this will typically be the default keyspace for the metadata container in which the metadata item is stored */
|
|
||||||
@property (readonly, copy) NSString *keySpace;
|
|
||||||
|
|
||||||
/* indicates the locale of the metadata item; may be nil if no locale information is available for the metadata item */
|
|
||||||
@property (readonly, copy) NSLocale *locale;
|
|
||||||
|
|
||||||
/* indicates the timestamp of the metadata item. */
|
|
||||||
@property (readonly) QTTime time;
|
|
||||||
|
|
||||||
/* provides the value of the metadata item */
|
|
||||||
@property (readonly, copy) id<NSCopying> value;
|
|
||||||
|
|
||||||
/* provides a dictionary of the additional attributes */
|
|
||||||
@property (readonly, copy) NSDictionary *extraAttributes;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
|
|
||||||
@interface QTMetadataItem (QTMetadataItem_TypeCoercion)
|
|
||||||
|
|
||||||
/* provides the value of the metadata item as a string; will be nil if the value cannot be represented as a string */
|
|
||||||
@property (readonly) NSString *stringValue;
|
|
||||||
|
|
||||||
/* provides the value of the metadata item as an NSNumber. If the metadata item's value can't be coerced to a number, @"numberValue" will be nil. */
|
|
||||||
@property (readonly) NSNumber *numberValue;
|
|
||||||
|
|
||||||
/* provides the value of the metadata item as an NSDate. If the metadata item's value can't be coerced to a date, @"dateValue" will be nil. */
|
|
||||||
@property (readonly) NSDate *dateValue;
|
|
||||||
|
|
||||||
/* provides the raw bytes of the value of the metadata item */
|
|
||||||
@property (readonly) NSData *dataValue;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
|
|
||||||
@interface QTMetadataItem (QTMetadataItem_ArrayFiltering)
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@method metadataItemsFromArray:withLocale:
|
|
||||||
@abstract Filters an array of QTMetadataItem objects according to locale.
|
|
||||||
@param array
|
|
||||||
An array of QTMetadataItem objects to be filtered by locale.
|
|
||||||
@param locale
|
|
||||||
The NSLocale that must be matched for a metadata item to be copied to the output array.
|
|
||||||
@result An NSArray object containing the metadata items of the specified NSArray that match the specified locale.
|
|
||||||
*/
|
|
||||||
+ (NSArray *)metadataItemsFromArray:(NSArray *)array withLocale:(NSLocale *)locale;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
@method metadataItemsFromArray:withKey:keySpace:
|
|
||||||
@abstract Filters an array of QTMetadataItem objects according to key and/or keySpace.
|
|
||||||
@param array
|
|
||||||
An array of QTMetadataItem objects to be filtered by key and/or keySpace.
|
|
||||||
@param key
|
|
||||||
The key that must be matched for a metadata item to be copied to the output array.
|
|
||||||
The keys will be compared to the keys of the QTMetadataItem objects in the array via [key isEqual:].
|
|
||||||
If no filtering according to key is desired, pass nil.
|
|
||||||
@param keySpace
|
|
||||||
The keySpace that must be matched for a metadata item to be copied to the output array.
|
|
||||||
The keySpace will be compared to the keySpaces of the QTMetadataItems in the array via [keySpace isEqualToString:].
|
|
||||||
If no filtering according to keySpace is desired, pass nil.
|
|
||||||
@result An NSArray object containing the metadata items of the specified NSArray that match the specified key and/or keySpace.
|
|
||||||
*/
|
|
||||||
+ (NSArray *)metadataItemsFromArray:(NSArray *)array withKey:(id)key keySpace:(NSString *)keySpace;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif // if (defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7))
|
|
||||||
@@ -1154,32 +1154,35 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++98";
|
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||||
CLANG_CXX_LIBRARY = "libstdc++";
|
CLANG_CXX_LIBRARY = "libstdc++";
|
||||||
CLANG_ENABLE_OBJC_ARC = NO;
|
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE;
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = c11;
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
|
||||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
"DEBUG=1",
|
"DEBUG=1",
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
);
|
);
|
||||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||||
|
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
|
||||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||||
|
GCC_WARN_UNKNOWN_PRAGMAS = YES;
|
||||||
GCC_WARN_UNUSED_FUNCTION = NO;
|
GCC_WARN_UNUSED_FUNCTION = NO;
|
||||||
|
GCC_WARN_UNUSED_LABEL = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
HEADER_SEARCH_PATHS = (
|
HEADER_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@@ -1188,8 +1191,8 @@
|
|||||||
"$(SRCROOT)/ffmpeg/**",
|
"$(SRCROOT)/ffmpeg/**",
|
||||||
"$(SRCROOT)/Tesseract",
|
"$(SRCROOT)/Tesseract",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||||
ONLY_ACTIVE_ARCH = NO;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = (
|
||||||
"-read_only_relocs",
|
"-read_only_relocs",
|
||||||
suppress,
|
suppress,
|
||||||
@@ -1204,27 +1207,32 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
|
||||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++98";
|
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
|
||||||
CLANG_CXX_LIBRARY = "libstdc++";
|
CLANG_CXX_LIBRARY = "libstdc++";
|
||||||
CLANG_ENABLE_OBJC_ARC = NO;
|
|
||||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
CLANG_WARN_INT_CONVERSION = YES;
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
|
||||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE;
|
||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
COPY_PHASE_STRIP = YES;
|
COPY_PHASE_STRIP = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = c11;
|
||||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||||
|
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
|
||||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||||
|
GCC_WARN_UNKNOWN_PRAGMAS = YES;
|
||||||
GCC_WARN_UNUSED_FUNCTION = NO;
|
GCC_WARN_UNUSED_FUNCTION = NO;
|
||||||
|
GCC_WARN_UNUSED_LABEL = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
HEADER_SEARCH_PATHS = (
|
HEADER_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@@ -1233,8 +1241,8 @@
|
|||||||
"$(SRCROOT)/ffmpeg/**",
|
"$(SRCROOT)/ffmpeg/**",
|
||||||
"$(SRCROOT)/Tesseract",
|
"$(SRCROOT)/Tesseract",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
MACOSX_DEPLOYMENT_TARGET = 10.7;
|
||||||
ONLY_ACTIVE_ARCH = NO;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = (
|
||||||
"-read_only_relocs",
|
"-read_only_relocs",
|
||||||
suppress,
|
suppress,
|
||||||
|
|||||||
Reference in new issue
Block a user