diff --git a/MP42/MP42AACImporter.mm b/MP42/MP42AACImporter.mm index 3ee7781..127431d 100644 --- a/MP42/MP42AACImporter.mm +++ b/MP42/MP42AACImporter.mm @@ -12,7 +12,7 @@ #import "MP42Languages.h" #import "MP42File.h" #import "MP42PrivateUtilities.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "MP42Track+Private.h" @implementation MP42AACImporter { diff --git a/MP42/MP42AC3AudioEncoder.m b/MP42/MP42AC3AudioEncoder.m index b8b3236..17264af 100644 --- a/MP42/MP42AC3AudioEncoder.m +++ b/MP42/MP42AC3AudioEncoder.m @@ -8,7 +8,7 @@ #import "MP42AC3AudioEncoder.h" #import "MP42Fifo.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "MP42PrivateUtilities.h" #include "sfifo.h" #include "FFmpegUtils.h" diff --git a/MP42/MP42AC3Importer.m b/MP42/MP42AC3Importer.m index f948f2b..847cc02 100644 --- a/MP42/MP42AC3Importer.m +++ b/MP42/MP42AC3Importer.m @@ -13,7 +13,7 @@ #import "MP42File.h" #import "MP42PrivateUtilities.h" #import "MP42FormatUtilites.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "MP42Track+Private.h" #include diff --git a/MP42/MP42AudioDecoder.m b/MP42/MP42AudioDecoder.m index cdda4d5..c2501c0 100644 --- a/MP42/MP42AudioDecoder.m +++ b/MP42/MP42AudioDecoder.m @@ -9,7 +9,7 @@ #import "MP42AudioDecoder.h" #import "MP42AudioTrack.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "MP42Fifo.h" #include "FFmpegUtils.h" diff --git a/MP42/MP42AudioEncoder.m b/MP42/MP42AudioEncoder.m index b8351b7..83d38a8 100644 --- a/MP42/MP42AudioEncoder.m +++ b/MP42/MP42AudioEncoder.m @@ -8,7 +8,7 @@ #import "MP42AudioEncoder.h" #import "MP42Fifo.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "MP42FormatUtilites.h" #include "sfifo.h" diff --git a/MP42/MP42BitmapSubConverter.m b/MP42/MP42BitmapSubConverter.m index db0d851..48bcb60 100644 --- a/MP42/MP42BitmapSubConverter.m +++ b/MP42/MP42BitmapSubConverter.m @@ -15,7 +15,7 @@ #import "MP42Track+Private.h" #import "MP42Fifo.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "MP42PrivateUtilities.h" #import "MP42SubtitleTrack.h" diff --git a/MP42/MP42CCImporter.m b/MP42/MP42CCImporter.m index 629a766..f1c5146 100644 --- a/MP42/MP42CCImporter.m +++ b/MP42/MP42CCImporter.m @@ -12,7 +12,7 @@ #import "MP42SubUtilities.h" #import "MP42Languages.h" #import "MP42File.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "NSString+MP42Additions.h" #import "MP42Track+Private.h" diff --git a/MP42/MP42ConverterProtocol.h b/MP42/MP42ConverterProtocol.h index 40330de..2897a0b 100644 --- a/MP42/MP42ConverterProtocol.h +++ b/MP42/MP42ConverterProtocol.h @@ -7,7 +7,7 @@ // #import -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" NS_ASSUME_NONNULL_BEGIN diff --git a/MP42/MP42EditListsReconstructor.h b/MP42/MP42EditListsReconstructor.h index 861bfa3..4dd0738 100644 --- a/MP42/MP42EditListsReconstructor.h +++ b/MP42/MP42EditListsReconstructor.h @@ -9,7 +9,7 @@ #import #import -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" /** * Analyzes the sample buffers of a track and tries to recreate an array of edits lists diff --git a/MP42/MP42FileImporter.m b/MP42/MP42FileImporter.m index 5bde6d6..0687b1f 100644 --- a/MP42/MP42FileImporter.m +++ b/MP42/MP42FileImporter.m @@ -22,7 +22,7 @@ #import "MP42VideoTrack.h" #import "MP42AudioTrack.h" #import "MP42Track+Private.h" -#import "MP42Track+Muxer.h" +#import "MP42SampleBuffer.h" #import "mp4v2.h" diff --git a/MP42/MP42H264Importer.mm b/MP42/MP42H264Importer.mm index cb847f4..381f798 100644 --- a/MP42/MP42H264Importer.mm +++ b/MP42/MP42H264Importer.mm @@ -8,7 +8,7 @@ #import "MP42H264Importer.h" #import "MP42FileImporter+Private.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "MP42Languages.h" #import "MP42File.h" diff --git a/MP42/MP42MkvImporter.m b/MP42/MP42MkvImporter.m index de98db7..99bbfe4 100644 --- a/MP42/MP42MkvImporter.m +++ b/MP42/MP42MkvImporter.m @@ -8,7 +8,7 @@ #import "MP42MkvImporter.h" #import "MP42FileImporter+Private.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "MP42File.h" #import "MP42Languages.h" diff --git a/MP42/MP42Mp4Importer.m b/MP42/MP42Mp4Importer.m index 5202b9f..08136c2 100644 --- a/MP42/MP42Mp4Importer.m +++ b/MP42/MP42Mp4Importer.m @@ -10,7 +10,7 @@ #import "MP42FileImporter+Private.h" #import "MP42File.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "mp4v2.h" #import "MP42PrivateUtilities.h" diff --git a/MP42/MP42Muxer.m b/MP42/MP42Muxer.m index 6693674..e7085b0 100644 --- a/MP42/MP42Muxer.m +++ b/MP42/MP42Muxer.m @@ -12,7 +12,7 @@ #import "MP42FileImporter.h" #import "MP42FileImporter+Private.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "MP42AudioConverter.h" #import "MP42BitmapSubConverter.h" #import "MP42TextSubConverter.h" @@ -21,7 +21,6 @@ #import "MP42FormatUtilites.h" #import "MP42PrivateUtilities.h" #import "MP42Track+Private.h" -#import "MP42Track+Muxer.h" #include diff --git a/MP42/MP42Sample.h b/MP42/MP42SampleBuffer.h similarity index 100% rename from MP42/MP42Sample.h rename to MP42/MP42SampleBuffer.h diff --git a/MP42/MP42Sample.m b/MP42/MP42SampleBuffer.m similarity index 90% rename from MP42/MP42Sample.m rename to MP42/MP42SampleBuffer.m index 77b76c4..01bdcad 100644 --- a/MP42/MP42Sample.m +++ b/MP42/MP42SampleBuffer.m @@ -6,7 +6,7 @@ // Copyright 2010 Damiano Galassi. All rights reserved. // -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" @implementation MP42SampleBuffer diff --git a/MP42/MP42SubUtilities.m b/MP42/MP42SubUtilities.m index 898f03c..06cf287 100644 --- a/MP42/MP42SubUtilities.m +++ b/MP42/MP42SubUtilities.m @@ -7,7 +7,7 @@ // #import "MP42SubUtilities.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "MP42HtmlParser.h" @implementation MP42SubSerializer diff --git a/MP42/MP42TextSubConverter.m b/MP42/MP42TextSubConverter.m index 051f8d2..a59516f 100644 --- a/MP42/MP42TextSubConverter.m +++ b/MP42/MP42TextSubConverter.m @@ -16,7 +16,7 @@ #import "MP42Track+Private.h" #import "MP42Fifo.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" #import "MP42SubUtilities.h" #import "MP42SSAParser.h" diff --git a/MP42/MP42Track+Muxer.h b/MP42/MP42Track+Muxer.h deleted file mode 100644 index 3c37c7d..0000000 --- a/MP42/MP42Track+Muxer.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// MP42Track_MP42Track_Muxer.h -// MP42 -// -// Created by Damiano Galassi on 01/11/13. -// Copyright (c) 2013 Damiano Galassi. All rights reserved. -// - -#import "MP42Track.h" -#import "MP42ConverterProtocol.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface MP42Track (MP42TrackMuxerExtentions) - -@property (nonatomic, readwrite, nullable) id converter; - -- (void)startReading; - -- (void)enqueue:(MP42SampleBuffer *)sample; -- (nullable MP42SampleBuffer *)copyNextSample; - -@end - -NS_ASSUME_NONNULL_END diff --git a/MP42/MP42Track+Private.h b/MP42/MP42Track+Private.h index a6c14db..f3cadff 100644 --- a/MP42/MP42Track+Private.h +++ b/MP42/MP42Track+Private.h @@ -9,6 +9,8 @@ NS_ASSUME_NONNULL_BEGIN @class MP42FileImporter; +@class MP42SampleBuffer; +@protocol MP42ConverterProtocol; @interface MP42Track (Private) @@ -34,6 +36,12 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSMutableDictionary *updatedProperty; @property (nonatomic, readwrite, nullable) MP42FileImporter *importer; +@property (nonatomic, readwrite, nullable) id converter; + +- (void)startReading; + +- (void)enqueue:(MP42SampleBuffer *)sample; +- (nullable MP42SampleBuffer *)copyNextSample; @end diff --git a/MP42/MP42Track.m b/MP42/MP42Track.m index 77e83d2..3ff32db 100644 --- a/MP42/MP42Track.m +++ b/MP42/MP42Track.m @@ -7,13 +7,14 @@ // #import "MP42Track.h" +#import "MP42Track+Private.h" #import "MP42PrivateUtilities.h" #import "MP42Utilities.h" #import "MP42Languages.h" -#import "MP42Track+Muxer.h" #import "MP42Fifo.h" #import "MP42FileImporter.h" +#import "MP42ConverterProtocol.h" typedef struct muxer_helper { // Input helpers diff --git a/MP42/MP42VobSubImporter.m b/MP42/MP42VobSubImporter.m index 07b20e8..189517a 100644 --- a/MP42/MP42VobSubImporter.m +++ b/MP42/MP42VobSubImporter.m @@ -16,7 +16,7 @@ #import "mp4v2.h" #import "MP42PrivateUtilities.h" #import "MP42Track+Private.h" -#import "MP42Sample.h" +#import "MP42SampleBuffer.h" @interface SBVobSubSample : NSObject { diff --git a/MP42Foundation.xcodeproj/project.pbxproj b/MP42Foundation.xcodeproj/project.pbxproj index ebbc61c..c0d6333 100644 --- a/MP42Foundation.xcodeproj/project.pbxproj +++ b/MP42Foundation.xcodeproj/project.pbxproj @@ -52,7 +52,7 @@ A910B5E618394EB20064028F /* MP42XMLReader.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C2591823923200416A4E /* MP42XMLReader.m */; }; A910B5E818394EB20064028F /* MP42HtmlParser.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C2371823923100416A4E /* MP42HtmlParser.m */; }; A910B5F118394EB20064028F /* MP42Muxer.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C2431823923100416A4E /* MP42Muxer.m */; }; - A910B5F418394EB20064028F /* MP42Sample.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C2491823923100416A4E /* MP42Sample.m */; }; + A910B5F418394EB20064028F /* MP42SampleBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C2491823923100416A4E /* MP42SampleBuffer.m */; }; A910B5F718394EB20064028F /* MP42Fifo.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C22F1823923100416A4E /* MP42Fifo.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; A910B5F918394EB20064028F /* MP42FileImporter.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C2331823923100416A4E /* MP42FileImporter.m */; }; A910B5FA18394EB20064028F /* sfifo.c in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C2641823923200416A4E /* sfifo.c */; }; @@ -130,7 +130,6 @@ A97EA7C81D4B8A2D00257CEA /* FFmpegUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = A97EA7C51D4B8A2D00257CEA /* FFmpegUtils.h */; }; A97EA7C91D4B8A2D00257CEA /* FFmpegUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = A97EA7C61D4B8A2D00257CEA /* FFmpegUtils.m */; }; A97EA7CA1D4B8A2D00257CEA /* FFmpegUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = A97EA7C61D4B8A2D00257CEA /* FFmpegUtils.m */; }; - 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 */; }; A99DB6A51D4648A800C6E56C /* libmp4v2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A99DB6A41D4648A800C6E56C /* libmp4v2.a */; }; @@ -199,7 +198,7 @@ A9B9C28E1823923200416A4E /* MP42Muxer.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C2431823923100416A4E /* MP42Muxer.m */; }; A9B9C28F1823923200416A4E /* MP42OCRWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = A9B9C2441823923100416A4E /* MP42OCRWrapper.h */; }; A9B9C2901823923200416A4E /* MP42OCRWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C2451823923100416A4E /* MP42OCRWrapper.mm */; }; - A9B9C2941823923200416A4E /* MP42Sample.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C2491823923100416A4E /* MP42Sample.m */; }; + A9B9C2941823923200416A4E /* MP42SampleBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C2491823923100416A4E /* MP42SampleBuffer.m */; }; A9B9C2951823923200416A4E /* MP42SrtImporter.h in Headers */ = {isa = PBXBuildFile; fileRef = A9B9C24A1823923100416A4E /* MP42SrtImporter.h */; }; A9B9C2961823923200416A4E /* MP42SrtImporter.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B9C24B1823923100416A4E /* MP42SrtImporter.m */; }; A9B9C2971823923200416A4E /* MP42SubtitleTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = A9B9C24C1823923100416A4E /* MP42SubtitleTrack.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -318,7 +317,6 @@ A96D28921BAD390400403327 /* MP42Metadata+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MP42Metadata+Private.h"; sourceTree = ""; }; A97EA7C51D4B8A2D00257CEA /* FFmpegUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFmpegUtils.h; sourceTree = ""; }; A97EA7C61D4B8A2D00257CEA /* FFmpegUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFmpegUtils.m; sourceTree = ""; }; - 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 = ""; }; A99DB6A41D4648A800C6E56C /* libmp4v2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmp4v2.a; path = contrib/mp42v2/libmp4v2.a; sourceTree = ""; }; @@ -391,8 +389,8 @@ A9B9C2431823923100416A4E /* MP42Muxer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MP42Muxer.m; sourceTree = ""; }; A9B9C2441823923100416A4E /* MP42OCRWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MP42OCRWrapper.h; sourceTree = ""; }; A9B9C2451823923100416A4E /* MP42OCRWrapper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MP42OCRWrapper.mm; sourceTree = ""; }; - A9B9C2481823923100416A4E /* MP42Sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MP42Sample.h; sourceTree = ""; }; - A9B9C2491823923100416A4E /* MP42Sample.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MP42Sample.m; sourceTree = ""; }; + A9B9C2481823923100416A4E /* MP42SampleBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MP42SampleBuffer.h; sourceTree = ""; }; + A9B9C2491823923100416A4E /* MP42SampleBuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MP42SampleBuffer.m; sourceTree = ""; }; A9B9C24A1823923100416A4E /* MP42SrtImporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MP42SrtImporter.h; sourceTree = ""; }; A9B9C24B1823923100416A4E /* MP42SrtImporter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MP42SrtImporter.m; sourceTree = ""; }; A9B9C24C1823923100416A4E /* MP42SubtitleTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MP42SubtitleTrack.h; sourceTree = ""; }; @@ -669,9 +667,8 @@ children = ( A9B9C2421823923100416A4E /* MP42Muxer.h */, A9B9C2431823923100416A4E /* MP42Muxer.m */, - A989F0FF1823AB2E0070AD8C /* MP42Track+Muxer.h */, - A9B9C2481823923100416A4E /* MP42Sample.h */, - A9B9C2491823923100416A4E /* MP42Sample.m */, + A9B9C2481823923100416A4E /* MP42SampleBuffer.h */, + A9B9C2491823923100416A4E /* MP42SampleBuffer.m */, A9B9C22D1823923100416A4E /* MP42ConverterProtocol.h */, A9B9C22E1823923100416A4E /* MP42Fifo.h */, A9B9C22F1823923100416A4E /* MP42Fifo.m */, @@ -867,7 +864,6 @@ A9DFBDA1195FF5BA00410060 /* MP42Heap.h in Headers */, A9B9C2661823923200416A4E /* MP42AACImporter.h in Headers */, A9B9C2681823923200416A4E /* MP42AC3Importer.h in Headers */, - A989F1001823AB2E0070AD8C /* MP42Track+Muxer.h in Headers */, A9B9C26A1823923200416A4E /* MP42AudioConverter.h in Headers */, A90801191D4B83A3002B6950 /* MP42AudioUnit.h in Headers */, A9B9C2A11823923200416A4E /* MP42VobSubImporter.h in Headers */, @@ -1033,7 +1029,7 @@ A941C9611F82A9B900FC5E8D /* MP42SSAConverter.m in Sources */, A910B5E818394EB20064028F /* MP42HtmlParser.m in Sources */, A910B5F118394EB20064028F /* MP42Muxer.m in Sources */, - A910B5F418394EB20064028F /* MP42Sample.m in Sources */, + A910B5F418394EB20064028F /* MP42SampleBuffer.m in Sources */, A910B5F718394EB20064028F /* MP42Fifo.m in Sources */, A96523491BAC315900E994E0 /* NSString+MP42Additions.m in Sources */, A910B5F918394EB20064028F /* MP42FileImporter.m in Sources */, @@ -1120,7 +1116,7 @@ A9B9C26D1823923200416A4E /* MP42AudioTrack.m in Sources */, A9B9C2901823923200416A4E /* MP42OCRWrapper.mm in Sources */, A9B9C2881823923200416A4E /* MP42Metadata.m in Sources */, - A9B9C2941823923200416A4E /* MP42Sample.m in Sources */, + A9B9C2941823923200416A4E /* MP42SampleBuffer.m in Sources */, A925AAB018379AF800BE84D4 /* MP42Utilities.m in Sources */, A9B9C29A1823923200416A4E /* MP42SubUtilities.m in Sources */, A90801131D4B83A3002B6950 /* MP42AudioDecoder.m in Sources */,