diff --git a/MP42/MP42AudioTrack.h b/MP42/MP42AudioTrack.h index 29cb510..966ecc1 100644 --- a/MP42/MP42AudioTrack.h +++ b/MP42/MP42AudioTrack.h @@ -10,6 +10,7 @@ #import "MP42Track.h" @interface MP42AudioTrack : MP42Track { +@private float _volume; UInt32 _channels; UInt32 _sourceChannels; diff --git a/MP42/MP42ChapterTrack.h b/MP42/MP42ChapterTrack.h index 18065bf..c75f791 100644 --- a/MP42/MP42ChapterTrack.h +++ b/MP42/MP42ChapterTrack.h @@ -11,6 +11,7 @@ #import "MP42TextSample.h" @interface MP42ChapterTrack : MP42Track { +@private NSMutableArray *chapters; BOOL _areChaptersEdited; } diff --git a/MP42/MP42ClosedCaptionTrack.h b/MP42/MP42ClosedCaptionTrack.h index 3935145..e5eee0c 100644 --- a/MP42/MP42ClosedCaptionTrack.h +++ b/MP42/MP42ClosedCaptionTrack.h @@ -10,5 +10,4 @@ #import "MP42VideoTrack.h" @interface MP42ClosedCaptionTrack : MP42VideoTrack - @end diff --git a/MP42/MP42ClosedCaptionTrack.m b/MP42/MP42ClosedCaptionTrack.m index 7eb50dc..fa918a5 100644 --- a/MP42/MP42ClosedCaptionTrack.m +++ b/MP42/MP42ClosedCaptionTrack.m @@ -8,7 +8,6 @@ #import "MP42ClosedCaptionTrack.h" #import "MP42MediaFormat.h" -#import "MP42Languages.h" @implementation MP42ClosedCaptionTrack diff --git a/MP42/MP42Fifo.h b/MP42/MP42Fifo.h index 6eb6aa6..64f5201 100644 --- a/MP42/MP42Fifo.h +++ b/MP42/MP42Fifo.h @@ -9,6 +9,7 @@ #import @interface MP42Fifo : NSObject { +@private id *_array; int32_t _head; diff --git a/MP42/MP42FileImporter.h b/MP42/MP42FileImporter.h index de912fe..62f32b1 100644 --- a/MP42/MP42FileImporter.h +++ b/MP42/MP42FileImporter.h @@ -17,6 +17,7 @@ @class MP42Track; @interface MP42FileImporter : NSObject { +@protected NSURL *_fileURL; NSInteger _chapterId; diff --git a/MP42/MP42Metadata.h b/MP42/MP42Metadata.h index 72adc53..1ece37f 100644 --- a/MP42/MP42Metadata.h +++ b/MP42/MP42Metadata.h @@ -10,6 +10,7 @@ #import "MP42MediaFormat.h" @interface MP42Metadata : NSObject { +@private NSString *presetName; NSURL *sourceURL; NSMutableDictionary *tagsDict; diff --git a/MP42/MP42Muxer.h b/MP42/MP42Muxer.h index 00ed20f..b5a9296 100644 --- a/MP42/MP42Muxer.h +++ b/MP42/MP42Muxer.h @@ -16,6 +16,7 @@ @end @interface MP42Muxer : NSObject { +@private MP4FileHandle _fileHandle; id _delegate; diff --git a/MP42/MP42SubtitleTrack.h b/MP42/MP42SubtitleTrack.h index bae81cc..3c21fba 100644 --- a/MP42/MP42SubtitleTrack.h +++ b/MP42/MP42SubtitleTrack.h @@ -10,6 +10,7 @@ #import "MP42VideoTrack.h" @interface MP42SubtitleTrack : MP42VideoTrack { +@private BOOL _verticalPlacement; BOOL _someSamplesAreForced; BOOL _allSamplesAreForced; diff --git a/MP42/MP42SubtitleTrack.m b/MP42/MP42SubtitleTrack.m index da48fc0..b2db838 100644 --- a/MP42/MP42SubtitleTrack.m +++ b/MP42/MP42SubtitleTrack.m @@ -10,7 +10,6 @@ #import "MP42PrivateUtilities.h" #import "MP42MediaFormat.h" #import "MP42HtmlParser.h" -#import "MP42Languages.h" @implementation MP42SubtitleTrack diff --git a/MP42/MP42Track+Muxer.h b/MP42/MP42Track+Muxer.h index 43cbfba..7f1c454 100644 --- a/MP42/MP42Track+Muxer.h +++ b/MP42/MP42Track+Muxer.h @@ -27,4 +27,6 @@ typedef struct muxer_helper { @property(nonatomic, readonly) muxer_helper *muxer_helper; +- (MP42SampleBuffer *)copyNextSample; + @end diff --git a/MP42/MP42Track+Muxer.m b/MP42/MP42Track+Muxer.m new file mode 100644 index 0000000..3407fa8 --- /dev/null +++ b/MP42/MP42Track+Muxer.m @@ -0,0 +1,45 @@ +// +// MP42Track_MP42Track_Muxer.h +// MP42 +// +// Created by Damiano Galassi on 01/11/13. +// Copyright (c) 2013 Damiano Galassi. All rights reserved. +// + +#import "MP42Track+Muxer.h" + +@implementation MP42Track (MP42TrackMuxerExtentions) + +- (muxer_helper *)muxer_helper +{ + if (_helper == NULL) + _helper = calloc(1, sizeof(muxer_helper)); + + return _helper; +} + +- (MP42SampleBuffer *)copyNextSample { + MP42SampleBuffer *sample = nil; + muxer_helper *helper = (muxer_helper *)_helper; + + if (helper->converter) { + if ([helper->importer done]) + [helper->converter setInputDone]; + + if ([helper->converter encoderDone]) + helper->done = YES; + + sample = [helper->converter copyEncodedSample]; + } else { + if ([helper->fifo isEmpty] && [helper->importer done]) + helper->done = YES; + + if ([helper->fifo count]) + sample = [helper->fifo deque]; + } + + return sample; +} + + +@end diff --git a/MP42/MP42Track.h b/MP42/MP42Track.h index b9fdcfb..e228c07 100644 --- a/MP42/MP42Track.h +++ b/MP42/MP42Track.h @@ -7,14 +7,13 @@ // #import -#import "MP42ConverterProtocol.h" #import "MP42MediaFormat.h" -@class MP42FileImporter; -@class MP42SampleBuffer; -@class MP42Fifo; - +/** + * MP42Track + */ @interface MP42Track : NSObject { +@protected MP42TrackId _Id; MP42TrackId _sourceId; @@ -47,7 +46,6 @@ - (instancetype)initWithSourceURL:(NSURL *)URL trackID:(NSInteger)trackID fileHandle:(MP42FileHandle)fileHandle; - (BOOL)writeToFile:(MP42FileHandle)fileHandle error:(NSError **)outError; -- (MP42SampleBuffer *)copyNextSample; - (NSString *)timeString; - (NSString *)formatSummary; diff --git a/MP42/MP42Track.m b/MP42/MP42Track.m index 7106bff..8012f90 100644 --- a/MP42/MP42Track.m +++ b/MP42/MP42Track.m @@ -336,39 +336,7 @@ @synthesize dataLength = _size; @synthesize mediaType = _mediaType; -- (muxer_helper *)muxer_helper -{ - if (_helper == NULL) - _helper = calloc(1, sizeof(muxer_helper)); - - return _helper; -} - -- (MP42SampleBuffer *)copyNextSample { - MP42SampleBuffer *sample = nil; - muxer_helper *helper = (muxer_helper *)_helper; - - if (helper->converter) { - if ([helper->importer done]) - [helper->converter setInputDone]; - - if ([helper->converter encoderDone]) - helper->done = YES; - - sample = [helper->converter copyEncodedSample]; - } else { - if ([helper->fifo isEmpty] && [helper->importer done]) - helper->done = YES; - - if ([helper->fifo count]) - sample = [helper->fifo deque]; - } - - return sample; -} - -- (void)dealloc -{ +- (void)dealloc { free(_helper); [_updatedProperty release]; diff --git a/MP42/MP42VideoTrack.h b/MP42/MP42VideoTrack.h index 5c16636..f2c7b13 100644 --- a/MP42/MP42VideoTrack.h +++ b/MP42/MP42VideoTrack.h @@ -10,6 +10,7 @@ #import "MP42Track.h" @interface MP42VideoTrack : MP42Track { +@protected uint64_t width, height; float trackWidth, trackHeight; diff --git a/MP42Foundation.xcodeproj/project.pbxproj b/MP42Foundation.xcodeproj/project.pbxproj index 8b29c13..3083692 100644 --- a/MP42Foundation.xcodeproj/project.pbxproj +++ b/MP42Foundation.xcodeproj/project.pbxproj @@ -81,6 +81,9 @@ A989F1001823AB2E0070AD8C /* MP42Track+Muxer.h in Headers */ = {isa = PBXBuildFile; fileRef = A989F0FF1823AB2E0070AD8C /* MP42Track+Muxer.h */; }; A989F10F1823B3B40070AD8C /* MP42TextSample.h in Headers */ = {isa = PBXBuildFile; fileRef = A989F10D1823B3B40070AD8C /* MP42TextSample.h */; settings = {ATTRIBUTES = (Public, ); }; }; A989F1101823B3B40070AD8C /* MP42TextSample.m in Sources */ = {isa = PBXBuildFile; fileRef = A989F10E1823B3B40070AD8C /* MP42TextSample.m */; }; + A991714C195AAAEF005AD68E /* MP42Track+Muxer.m in Sources */ = {isa = PBXBuildFile; fileRef = A991714B195AAAEF005AD68E /* MP42Track+Muxer.m */; }; + A991714D195AAAEF005AD68E /* MP42Track+Muxer.m in Sources */ = {isa = PBXBuildFile; fileRef = A991714B195AAAEF005AD68E /* MP42Track+Muxer.m */; }; + A991714E195AAAEF005AD68E /* MP42Track+Muxer.m in Sources */ = {isa = PBXBuildFile; fileRef = A991714B195AAAEF005AD68E /* MP42Track+Muxer.m */; }; A9B9C1F1182391DF00416A4E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9B9C1F0182391DF00416A4E /* Cocoa.framework */; }; A9B9C1FB182391DF00416A4E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A9B9C1F9182391DF00416A4E /* InfoPlist.strings */; }; A9B9C206182391DF00416A4E /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9B9C205182391DF00416A4E /* XCTest.framework */; }; @@ -262,6 +265,7 @@ A989F0FF1823AB2E0070AD8C /* MP42Track+Muxer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MP42Track+Muxer.h"; sourceTree = ""; }; A989F10D1823B3B40070AD8C /* MP42TextSample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MP42TextSample.h; sourceTree = ""; }; A989F10E1823B3B40070AD8C /* MP42TextSample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MP42TextSample.m; sourceTree = ""; }; + A991714B195AAAEF005AD68E /* MP42Track+Muxer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MP42Track+Muxer.m"; sourceTree = ""; }; A9B9C1ED182391DF00416A4E /* MP42Foundation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MP42Foundation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A9B9C1F0182391DF00416A4E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; A9B9C1F3182391DF00416A4E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; @@ -593,6 +597,7 @@ A9B9C2421823923100416A4E /* MP42Muxer.h */, A9B9C2431823923100416A4E /* MP42Muxer.m */, A989F0FF1823AB2E0070AD8C /* MP42Track+Muxer.h */, + A991714B195AAAEF005AD68E /* MP42Track+Muxer.m */, A9B9C2481823923100416A4E /* MP42Sample.h */, A9B9C2491823923100416A4E /* MP42Sample.m */, A9B9C22D1823923100416A4E /* MP42ConverterProtocol.h */, @@ -911,6 +916,7 @@ A910B5D618394EB20064028F /* MP42MediaFormat.m in Sources */, A910B5D818394EB20064028F /* MP42TextSample.m in Sources */, A910B5DA18394EB20064028F /* MP42Image.m in Sources */, + A991714E195AAAEF005AD68E /* MP42Track+Muxer.m in Sources */, A910B5DC18394EB20064028F /* MP42Languages.m in Sources */, A910B5DE18394EB20064028F /* MP42Ratings.m in Sources */, A910B5E018394EB20064028F /* MP42PrivateUtilities.m in Sources */, @@ -961,6 +967,7 @@ A9B9C2921823923200416A4E /* MP42QTImporter.m in Sources */, A9B9C2A21823923200416A4E /* MP42VobSubImporter.m in Sources */, A9B9C28E1823923200416A4E /* MP42Muxer.m in Sources */, + A991714C195AAAEF005AD68E /* MP42Track+Muxer.m in Sources */, A9B9C2D0182396A100416A4E /* MP42Ratings.m in Sources */, A9B9C2691823923200416A4E /* MP42AC3Importer.m in Sources */, A9B9C26F1823923200416A4E /* MP42AVFImporter.m in Sources */, @@ -999,6 +1006,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + A991714D195AAAEF005AD68E /* MP42Track+Muxer.m in Sources */, A9B9C212182391DF00416A4E /* MP42Tests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1136,7 +1144,7 @@ "-read_only_relocs", suppress, ); - SDKROOT = macosx10.8; + SDKROOT = macosx10.9; USER_HEADER_SEARCH_PATHS = ""; }; name = Debug; @@ -1181,7 +1189,7 @@ "-read_only_relocs", suppress, ); - SDKROOT = macosx10.8; + SDKROOT = macosx10.9; USER_HEADER_SEARCH_PATHS = ""; }; name = Release;