Remove 32bit only files (QuickTime) and update headers.
This commit is contained in:
1 parent
67db65596f
commit
3b941b8c9e
50 files changed
+236
-3172
No files matched your search
@@ -76,6 +76,7 @@ static const struct {
|
||||
|
||||
{ kAudioFormatAC3, AV_CODEC_ID_AC3 },
|
||||
{ kAudioFormatEnhancedAC3, AV_CODEC_ID_EAC3 },
|
||||
{ 'trhd', AV_CODEC_ID_TRUEHD },
|
||||
|
||||
{ 'DTS ', AV_CODEC_ID_DTS },
|
||||
|
||||
|
||||
@@ -9,13 +9,5 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MP42FileImporter.h"
|
||||
|
||||
@interface MP42AACImporter : MP42FileImporter {
|
||||
@private
|
||||
FILE *inFile;
|
||||
int64_t size;
|
||||
|
||||
NSMutableData *aacInfo;
|
||||
u_int32_t samplesPerSecond;
|
||||
}
|
||||
|
||||
@interface MP42AACImporter : MP42FileImporter
|
||||
@end
|
||||
@@ -14,7 +14,15 @@
|
||||
#import "MP42PrivateUtilities.h"
|
||||
#import "MP42Sample.h"
|
||||
|
||||
@implementation MP42AACImporter
|
||||
@implementation MP42AACImporter {
|
||||
@private
|
||||
FILE *inFile;
|
||||
int64_t size;
|
||||
|
||||
NSMutableData *aacInfo;
|
||||
u_int32_t samplesPerSecond;
|
||||
}
|
||||
|
||||
|
||||
static int aacUseOldFile = 0;
|
||||
static int aacProfileLevel = 4;
|
||||
|
||||
@@ -9,13 +9,5 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MP42FileImporter.h"
|
||||
|
||||
@interface MP42AC3Importer : MP42FileImporter {
|
||||
@private
|
||||
FILE *inFile;
|
||||
int64_t size;
|
||||
|
||||
NSMutableData *ac3Info;
|
||||
u_int32_t samplesPerSecond;
|
||||
}
|
||||
|
||||
@interface MP42AC3Importer : MP42FileImporter
|
||||
@end
|
||||
@@ -23,7 +23,14 @@
|
||||
#define NUM_AC3_FRAMECODE_SIZES 19 * 2
|
||||
|
||||
|
||||
@implementation MP42AC3Importer
|
||||
@implementation MP42AC3Importer {
|
||||
@private
|
||||
FILE *inFile;
|
||||
int64_t size;
|
||||
|
||||
NSMutableData *ac3Info;
|
||||
u_int32_t samplesPerSecond;
|
||||
}
|
||||
|
||||
u_int32_t Ac3SamplingRates[NUM_AC3_SAMPLING_RATES] = {
|
||||
48000, 44100, 32000, 0
|
||||
|
||||
@@ -11,10 +11,7 @@
|
||||
|
||||
@class AVAsset;
|
||||
|
||||
@interface MP42AVFImporter : MP42FileImporter {
|
||||
@private
|
||||
AVAsset *_localAsset;
|
||||
}
|
||||
@interface MP42AVFImporter : MP42FileImporter
|
||||
|
||||
@end
|
||||
|
||||
@@ -42,7 +42,10 @@
|
||||
|
||||
@end
|
||||
|
||||
@implementation MP42AVFImporter
|
||||
@implementation MP42AVFImporter {
|
||||
@private
|
||||
AVAsset *_localAsset;
|
||||
}
|
||||
|
||||
+ (NSArray<NSString *> *)supportedFileFormats {
|
||||
return @[@"mov", @"mp4", @"m4v", @"m4a", @"m2ts", @"ts", @"mts", @"ac3", @"eac3", @"ec3", @"webvtt", @"vtt"];
|
||||
@@ -372,7 +375,9 @@
|
||||
}
|
||||
|
||||
CMTimeRange timeRange = track.timeRange;
|
||||
newTrack.duration = timeRange.duration.value / timeRange.duration.timescale * 1000;
|
||||
if (timeRange.duration.timescale > 0) {
|
||||
newTrack.duration = timeRange.duration.value / timeRange.duration.timescale * 1000;
|
||||
}
|
||||
|
||||
[self addTrack:newTrack];
|
||||
[newTrack release];
|
||||
|
||||
@@ -7,12 +7,8 @@
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#include "downmix.h"
|
||||
#import "MP42ConverterProtocol.h"
|
||||
|
||||
#import <AudioToolbox/AudioToolbox.h>
|
||||
#import <CoreAudio/CoreAudio.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class MP42SampleBuffer;
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#import "MP42Track+Muxer.h"
|
||||
#import "MP42FileImporter+Private.h"
|
||||
|
||||
#import <CoreAudio/CoreAudio.h>
|
||||
|
||||
@interface MP42AudioConverter ()
|
||||
|
||||
@property (nonatomic, readonly) MP42AudioDecoder *decoder;
|
||||
|
||||
+1
-15
@@ -9,21 +9,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MP42Track.h"
|
||||
|
||||
@interface MP42AudioTrack : MP42Track <NSCoding, NSCopying> {
|
||||
@private
|
||||
float _volume;
|
||||
UInt32 _channels;
|
||||
UInt32 _sourceChannels;
|
||||
UInt32 _channelLayoutTag;
|
||||
|
||||
MP42TrackId _fallbackTrackId;
|
||||
MP42TrackId _followsTrackId;
|
||||
|
||||
MP42Track *_fallbackTrack;
|
||||
MP42Track *_followsTrack;
|
||||
|
||||
NSString *_mixdownType;
|
||||
}
|
||||
@interface MP42AudioTrack : MP42Track <NSCoding, NSCopying>
|
||||
|
||||
@property(nonatomic, readwrite) float volume;
|
||||
@property(nonatomic, readwrite) UInt32 channels;
|
||||
|
||||
+15
-1
@@ -15,7 +15,21 @@
|
||||
|
||||
extern u_int8_t MP4AV_AacConfigGetChannels(u_int8_t* pConfig);
|
||||
|
||||
@implementation MP42AudioTrack
|
||||
@implementation MP42AudioTrack {
|
||||
@private
|
||||
float _volume;
|
||||
UInt32 _channels;
|
||||
UInt32 _sourceChannels;
|
||||
UInt32 _channelLayoutTag;
|
||||
|
||||
MP42TrackId _fallbackTrackId;
|
||||
MP42TrackId _followsTrackId;
|
||||
|
||||
MP42Track *_fallbackTrack;
|
||||
MP42Track *_followsTrack;
|
||||
|
||||
NSString *_mixdownType;
|
||||
}
|
||||
|
||||
- (instancetype)initWithSourceURL:(NSURL *)URL trackID:(NSInteger)trackID fileHandle:(MP4FileHandle)fileHandle
|
||||
{
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MP42ChapterTrack : MP42Track <NSCoding> {
|
||||
@private
|
||||
NSMutableArray<MP42TextSample *> *chapters;
|
||||
BOOL _areChaptersEdited;
|
||||
}
|
||||
@interface MP42ChapterTrack : MP42Track <NSCoding>
|
||||
|
||||
- (instancetype)initWithSourceURL:(NSURL *)URL trackID:(NSInteger)trackID fileHandle:(MP42FileHandle)fileHandle;
|
||||
+ (instancetype)chapterTrackFromFile:(NSURL *)URL;
|
||||
|
||||
@@ -12,7 +12,11 @@
|
||||
#import "MP42PrivateUtilities.h"
|
||||
#import "MP42MediaFormat.h"
|
||||
|
||||
@implementation MP42ChapterTrack
|
||||
@implementation MP42ChapterTrack {
|
||||
@private
|
||||
NSMutableArray<MP42TextSample *> *chapters;
|
||||
BOOL _areChaptersEdited;
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
|
||||
#import "MP42Heap.h"
|
||||
#import "MP42Sample.h"
|
||||
|
||||
/**
|
||||
@@ -17,25 +16,7 @@
|
||||
* by analyzing the doNotDisplay and trimAtStart/End flags
|
||||
* TO-DO: doesn't work in all cases yet.
|
||||
*/
|
||||
@interface MP42EditListsReconstructor : NSObject {
|
||||
@private
|
||||
MP42Heap *_priorityQueue;
|
||||
|
||||
uint64_t _currentTime;
|
||||
CMTimeScale _timescale;
|
||||
CMTimeScale _primingTimescale;
|
||||
|
||||
int64_t _delta;
|
||||
|
||||
CMTimeRange *_edits;
|
||||
uint64_t _editsCount;
|
||||
uint64_t _editsSize;
|
||||
|
||||
BOOL _editOpen;
|
||||
|
||||
uint64_t _priming;
|
||||
BOOL _primingUsed;
|
||||
}
|
||||
@interface MP42EditListsReconstructor : NSObject
|
||||
|
||||
- (instancetype)initWithMediaFormat:(NSString *)format;
|
||||
|
||||
|
||||
@@ -8,8 +8,27 @@
|
||||
|
||||
#import "MP42EditListsReconstructor.h"
|
||||
#import "MP42MediaFormat.h"
|
||||
#import "MP42Heap.h"
|
||||
|
||||
@implementation MP42EditListsReconstructor
|
||||
@implementation MP42EditListsReconstructor {
|
||||
@private
|
||||
MP42Heap *_priorityQueue;
|
||||
|
||||
uint64_t _currentTime;
|
||||
CMTimeScale _timescale;
|
||||
CMTimeScale _primingTimescale;
|
||||
|
||||
int64_t _delta;
|
||||
|
||||
CMTimeRange *_edits;
|
||||
uint64_t _editsCount;
|
||||
uint64_t _editsSize;
|
||||
|
||||
BOOL _editOpen;
|
||||
|
||||
uint64_t _priming;
|
||||
BOOL _primingUsed;
|
||||
}
|
||||
|
||||
@synthesize edits = _edits;
|
||||
@synthesize editsCount = _editsCount;
|
||||
|
||||
+1
-30
@@ -26,41 +26,12 @@ extern NSString * const MP4264BitTime;
|
||||
extern NSString * const MP42GenerateChaptersPreviewTrack;
|
||||
extern NSString * const MP42CustomChaptersPreviewTrack;
|
||||
|
||||
/**
|
||||
* MP42Status
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, MP42Status) {
|
||||
MP42StatusLoaded = 0,
|
||||
MP42StatusReading,
|
||||
MP42StatusWriting
|
||||
};
|
||||
|
||||
@class MP42Muxer;
|
||||
@class MP42FileImporter;
|
||||
|
||||
typedef void (^MP42FileProgressHandler)(double progress);
|
||||
|
||||
/**
|
||||
* A MP42File object is an object that represents a mp4 file.
|
||||
*/
|
||||
@interface MP42File : NSObject <NSCoding> {
|
||||
@private
|
||||
MP42FileHandle _fileHandle;
|
||||
NSURL *_fileURL;
|
||||
|
||||
MP42Status _status;
|
||||
BOOL _cancelled;
|
||||
|
||||
MP42FileProgressHandler _progressHandler;
|
||||
|
||||
NSMutableArray<__kindof MP42Track *> *_tracks;
|
||||
NSMutableArray<MP42Track *> *_tracksToBeDeleted;
|
||||
MP42Metadata *_metadata;
|
||||
MP42Muxer *_muxer;
|
||||
NSMutableDictionary<NSString *, MP42FileImporter *> *_importers;
|
||||
|
||||
BOOL _hasFileRepresentation;
|
||||
}
|
||||
@interface MP42File : NSObject <NSCoding>
|
||||
|
||||
+ (void)setGlobalLogger:(id <MP42Logging>)logger;
|
||||
|
||||
|
||||
+27
-1
@@ -24,6 +24,15 @@ NSString * const MP4264BitTime = @"MP4264BitTime";
|
||||
NSString * const MP42GenerateChaptersPreviewTrack = @"MP42ChaptersPreview";
|
||||
NSString * const MP42CustomChaptersPreviewTrack = @"MP42CustomChaptersPreview";
|
||||
|
||||
/**
|
||||
* MP42Status
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, MP42Status) {
|
||||
MP42StatusLoaded = 0,
|
||||
MP42StatusReading,
|
||||
MP42StatusWriting
|
||||
};
|
||||
|
||||
static id <MP42Logging> _logger = nil;
|
||||
|
||||
static void logCallback(MP4LogLevel loglevel, const char *fmt, va_list ap) {
|
||||
@@ -65,7 +74,24 @@ static void logCallback(MP4LogLevel loglevel, const char *fmt, va_list ap) {
|
||||
[_logger writeToLog:output];
|
||||
}
|
||||
|
||||
@interface MP42File () <MP42MuxerDelegate>
|
||||
@interface MP42File () <MP42MuxerDelegate> {
|
||||
@private
|
||||
MP42FileHandle _fileHandle;
|
||||
NSURL *_fileURL;
|
||||
|
||||
MP42Status _status;
|
||||
BOOL _cancelled;
|
||||
|
||||
MP42FileProgressHandler _progressHandler;
|
||||
|
||||
NSMutableArray<__kindof MP42Track *> *_tracks;
|
||||
NSMutableArray<MP42Track *> *_tracksToBeDeleted;
|
||||
MP42Metadata *_metadata;
|
||||
MP42Muxer *_muxer;
|
||||
NSMutableDictionary<NSString *, MP42FileImporter *> *_importers;
|
||||
|
||||
BOOL _hasFileRepresentation;
|
||||
}
|
||||
|
||||
@property(nonatomic, readwrite) MP42FileHandle fileHandle;
|
||||
@property(nonatomic, readwrite, retain) NSURL *URL;
|
||||
|
||||
@@ -21,18 +21,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
double _progress;
|
||||
int32_t _cancelled;
|
||||
|
||||
@private
|
||||
NSURL *_fileURL;
|
||||
|
||||
NSMutableArray<MP42Track *> *_tracksArray;
|
||||
|
||||
NSMutableArray<MP42Track *> *_inputTracks;
|
||||
NSMutableArray<MP42Track *> *_outputsTracks;
|
||||
|
||||
NSThread *_demuxerThread;
|
||||
|
||||
dispatch_semaphore_t _doneSem;
|
||||
}
|
||||
|
||||
+ (NSArray<NSString *> *)supportedFileFormats;
|
||||
|
||||
+24
-22
@@ -16,9 +16,6 @@
|
||||
#import "MP42H264Importer.h"
|
||||
#import "MP42VobSubImporter.h"
|
||||
#import "MP42AVFImporter.h"
|
||||
#if !__LP64__
|
||||
#import "MP42QTImporter.h"
|
||||
#endif
|
||||
|
||||
#import "MP42Track.h"
|
||||
#import "MP42Fifo.h"
|
||||
@@ -26,34 +23,39 @@
|
||||
#import "MP42AudioConverter.h"
|
||||
#import "MP42Track+Muxer.h"
|
||||
|
||||
#import <CoreAudio/CoreAudio.h>
|
||||
|
||||
/// The available subclasses
|
||||
static NSArray<Class> *_fileImporters;
|
||||
|
||||
/// The supporter file extentions.
|
||||
static NSArray<NSString *> *_supportedFileFormats;
|
||||
|
||||
@implementation MP42FileImporter
|
||||
@implementation MP42FileImporter {
|
||||
@private
|
||||
NSURL *_fileURL;
|
||||
|
||||
NSMutableArray<MP42Track *> *_tracksArray;
|
||||
|
||||
NSMutableArray<MP42Track *> *_inputTracks;
|
||||
NSMutableArray<MP42Track *> *_outputsTracks;
|
||||
|
||||
NSThread *_demuxerThread;
|
||||
|
||||
dispatch_semaphore_t _doneSem;
|
||||
}
|
||||
|
||||
+ (void)initialize {
|
||||
if (self == [MP42FileImporter class]) {
|
||||
NSMutableArray<Class> * fileImporters = [@[[MP42MkvImporter class],
|
||||
[MP42Mp4Importer class],
|
||||
[MP42SrtImporter class],
|
||||
[MP42CCImporter class],
|
||||
[MP42AC3Importer class],
|
||||
[MP42AACImporter class],
|
||||
[MP42H264Importer class],
|
||||
[MP42VobSubImporter class],
|
||||
[MP42AVFImporter class]] mutableCopy];
|
||||
|
||||
#if !__LP64__
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"MP42PreferQuickTime"]) {
|
||||
[fileImporters insertObject:[MP42QTImporter class] atIndex:7];
|
||||
}
|
||||
#endif
|
||||
|
||||
_fileImporters = [fileImporters copy];
|
||||
[fileImporters release];
|
||||
_fileImporters = @[[MP42MkvImporter class],
|
||||
[MP42Mp4Importer class],
|
||||
[MP42SrtImporter class],
|
||||
[MP42CCImporter class],
|
||||
[MP42AC3Importer class],
|
||||
[MP42AACImporter class],
|
||||
[MP42H264Importer class],
|
||||
[MP42VobSubImporter class],
|
||||
[MP42AVFImporter class]];
|
||||
|
||||
NSMutableArray<NSString *> *formats = [[NSMutableArray alloc] init];
|
||||
|
||||
|
||||
@@ -27,13 +27,6 @@ rgba_color make_color(u_int8_t r, u_int8_t g, u_int8_t b, u_int8_t a);
|
||||
int compare_color(rgba_color c1, rgba_color c2);
|
||||
|
||||
@interface MP42Style : NSObject
|
||||
{
|
||||
NSInteger _style;
|
||||
rgba_color _color;
|
||||
NSInteger _type;
|
||||
NSUInteger _location;
|
||||
NSUInteger _length;
|
||||
}
|
||||
|
||||
- (instancetype)initWithStyle:(NSInteger)style type:(NSInteger)type location:(NSUInteger) location color:(rgba_color) color;
|
||||
|
||||
@@ -46,12 +39,6 @@ int compare_color(rgba_color c1, rgba_color c2);
|
||||
@end
|
||||
|
||||
@interface MP42HtmlParser : NSObject
|
||||
{
|
||||
NSUInteger _location;
|
||||
NSMutableString *_text;
|
||||
NSMutableArray<MP42Style *> *_styles;
|
||||
rgba_color _defaultColor;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly) NSString *text;
|
||||
@property (nonatomic, readonly) NSArray *styles;
|
||||
|
||||
+13
-1
@@ -27,6 +27,13 @@ int compare_color(rgba_color c1, rgba_color c2) {
|
||||
return 1;
|
||||
}
|
||||
@implementation MP42Style
|
||||
{
|
||||
NSInteger _style;
|
||||
rgba_color _color;
|
||||
NSInteger _type;
|
||||
NSUInteger _location;
|
||||
NSUInteger _length;
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
@@ -75,7 +82,12 @@ int compare_color(rgba_color c1, rgba_color c2) {
|
||||
@end
|
||||
|
||||
@implementation MP42HtmlParser
|
||||
|
||||
{
|
||||
NSUInteger _location;
|
||||
NSMutableString *_text;
|
||||
NSMutableArray<MP42Style *> *_styles;
|
||||
rgba_color _defaultColor;
|
||||
}
|
||||
- (instancetype)initWithString: (NSString*) string
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
+1
-10
@@ -18,16 +18,7 @@ typedef enum MP42TagArtworkType_e {
|
||||
MP42_ART_PNG = 4
|
||||
} MP42TagArtworkType;
|
||||
|
||||
@interface MP42Image : NSObject <NSCoding, NSCopying> {
|
||||
@private
|
||||
NSImage *_image;
|
||||
|
||||
NSURL *_url;
|
||||
NSData *_data;
|
||||
NSString *_uuid;
|
||||
|
||||
NSInteger _type;
|
||||
}
|
||||
@interface MP42Image : NSObject <NSCoding, NSCopying>
|
||||
|
||||
- (instancetype)initWithURL:(NSURL *)url type:(NSInteger)type;
|
||||
- (instancetype)initWithImage:(NSImage *)image;
|
||||
|
||||
+10
-1
@@ -15,7 +15,16 @@
|
||||
|
||||
@end
|
||||
|
||||
@implementation MP42Image
|
||||
@implementation MP42Image {
|
||||
@private
|
||||
NSImage *_image;
|
||||
|
||||
NSURL *_url;
|
||||
NSData *_data;
|
||||
NSString *_uuid;
|
||||
|
||||
NSInteger _type;
|
||||
}
|
||||
|
||||
@synthesize url = _url;
|
||||
@synthesize data = _data;
|
||||
|
||||
+1
-18
@@ -13,24 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class MP42Image;
|
||||
|
||||
@interface MP42Metadata : NSObject <NSCoding, NSCopying> {
|
||||
@private
|
||||
NSString *presetName;
|
||||
NSMutableDictionary<NSString *, id> *tagsDict;
|
||||
|
||||
NSMutableArray<MP42Image *> *artworks;
|
||||
|
||||
NSString *ratingiTunesCode;
|
||||
|
||||
uint8_t mediaKind;
|
||||
uint8_t contentRating;
|
||||
uint8_t hdVideo;
|
||||
uint8_t gapless;
|
||||
uint8_t podcast;
|
||||
|
||||
BOOL isEdited;
|
||||
BOOL isArtworkEdited;
|
||||
}
|
||||
@interface MP42Metadata : NSObject <NSCoding, NSCopying>
|
||||
|
||||
/**
|
||||
* Initializes a new metadata instance by a given URL
|
||||
|
||||
+18
-1
@@ -186,7 +186,24 @@ static const genreType_t genreType_strings[] = {
|
||||
};
|
||||
|
||||
|
||||
@implementation MP42Metadata
|
||||
@implementation MP42Metadata {
|
||||
@private
|
||||
NSString *presetName;
|
||||
NSMutableDictionary<NSString *, id> *tagsDict;
|
||||
|
||||
NSMutableArray<MP42Image *> *artworks;
|
||||
|
||||
NSString *ratingiTunesCode;
|
||||
|
||||
uint8_t mediaKind;
|
||||
uint8_t contentRating;
|
||||
uint8_t hdVideo;
|
||||
uint8_t gapless;
|
||||
uint8_t podcast;
|
||||
|
||||
BOOL isEdited;
|
||||
BOOL isArtworkEdited;
|
||||
}
|
||||
|
||||
@synthesize presetName;
|
||||
|
||||
|
||||
@@ -9,12 +9,5 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MP42FileImporter.h"
|
||||
|
||||
@interface MP42MkvImporter : MP42FileImporter {
|
||||
@private
|
||||
struct MatroskaFile *_matroskaFile;
|
||||
struct StdIoStream *_ioStream;
|
||||
|
||||
u_int64_t _fileDuration;
|
||||
}
|
||||
|
||||
@interface MP42MkvImporter : MP42FileImporter
|
||||
@end
|
||||
@@ -139,7 +139,13 @@ int readMkvPacket(struct StdIoStream *ioStream, TrackInfo *trackInfo, uint64_t
|
||||
return 1;
|
||||
}
|
||||
|
||||
@implementation MP42MkvImporter
|
||||
@implementation MP42MkvImporter {
|
||||
@private
|
||||
struct MatroskaFile *_matroskaFile;
|
||||
struct StdIoStream *_ioStream;
|
||||
|
||||
u_int64_t _fileDuration;
|
||||
}
|
||||
|
||||
+ (NSArray<NSString *> *)supportedFileFormats {
|
||||
return @[@"mkv", @"mka", @"mks"];
|
||||
|
||||
@@ -8,11 +8,6 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MP42FileImporter.h"
|
||||
#import "MP42File.h"
|
||||
|
||||
@interface MP42Mp4Importer : MP42FileImporter {
|
||||
@private
|
||||
MP42FileHandle _fileHandle;
|
||||
}
|
||||
|
||||
@interface MP42Mp4Importer : MP42FileImporter
|
||||
@end
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#import "MP42Mp4Importer.h"
|
||||
#import "MP42FileImporter+Private.h"
|
||||
#import "MP42File.h"
|
||||
|
||||
#import "MP42Languages.h"
|
||||
#import "MP42Sample.h"
|
||||
@@ -30,7 +31,10 @@
|
||||
@implementation MP4DemuxHelper
|
||||
@end
|
||||
|
||||
@implementation MP42Mp4Importer
|
||||
@implementation MP42Mp4Importer {
|
||||
@private
|
||||
MP42FileHandle _fileHandle;
|
||||
}
|
||||
|
||||
+ (NSArray<NSString *> *)supportedFileFormats {
|
||||
return @[@"mp4", @"m4v", @"m4a", @"m4r"];
|
||||
|
||||
@@ -6,11 +6,9 @@
|
||||
// Copyright 2011 Damiano Galassi. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface MP42OCRWrapper : NSObject {
|
||||
void *tess_base;
|
||||
}
|
||||
@interface MP42OCRWrapper : NSObject
|
||||
|
||||
- (instancetype)initWithLanguage:(NSString *)language extendedLanguageTag:(NSString *)extendedLanguageTag;
|
||||
- (NSString *)performOCROnCGImage:(CGImageRef)image;
|
||||
|
||||
@@ -49,7 +49,9 @@ protected:
|
||||
TessBaseAPI tess_base_api;
|
||||
};
|
||||
|
||||
@implementation MP42OCRWrapper
|
||||
@implementation MP42OCRWrapper {
|
||||
void *tess_base;
|
||||
}
|
||||
|
||||
- (NSURL *)appSupportUrl
|
||||
{
|
||||
|
||||
@@ -40,14 +40,13 @@
|
||||
NSImage *frame = [[NSImage alloc] initWithCGImage:imgRef size:size];
|
||||
|
||||
[images addObject:frame];
|
||||
[frame release];
|
||||
}
|
||||
|
||||
CGImageRelease(imgRef);
|
||||
}
|
||||
}
|
||||
|
||||
return [images autorelease];
|
||||
return images;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// MP42MkvFileImporter.h
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 31/01/10.
|
||||
// Copyright 2010 Damiano Galassi All rights reserved.
|
||||
//
|
||||
|
||||
#if !__LP64__
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "MP42FileImporter.h"
|
||||
#import <QTKit/QTKit.h>
|
||||
|
||||
@interface MP42QTImporter : MP42FileImporter {
|
||||
@private
|
||||
QTMovie *_sourceFile;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
+1
-6
@@ -10,12 +10,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MP42Ratings : NSObject {
|
||||
@private
|
||||
NSMutableArray *ratingsDictionary;
|
||||
NSMutableArray<NSString *> *ratings;
|
||||
NSMutableArray<NSString *> *iTunesCodes;
|
||||
}
|
||||
@interface MP42Ratings : NSObject
|
||||
|
||||
@property (atomic, readonly) NSArray<NSString *> *ratings;
|
||||
@property (atomic, readonly) NSArray<NSString *> *iTunesCodes;
|
||||
|
||||
+6
-1
@@ -8,7 +8,12 @@
|
||||
|
||||
#import "MP42Ratings.h"
|
||||
|
||||
@implementation MP42Ratings
|
||||
@implementation MP42Ratings {
|
||||
@private
|
||||
NSMutableArray *ratingsDictionary;
|
||||
NSMutableArray<NSString *> *ratings;
|
||||
NSMutableArray<NSString *> *iTunesCodes;
|
||||
}
|
||||
|
||||
@synthesize ratings;
|
||||
@synthesize iTunesCodes;
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class MP42Track;
|
||||
|
||||
typedef NS_OPTIONS(NSUInteger, MP42SampleBufferFlag) {
|
||||
MP42SampleBufferFlagEndOfFile = 1 << 0,
|
||||
};
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#import "MP42Sample.h"
|
||||
|
||||
|
||||
@implementation MP42SampleBuffer
|
||||
|
||||
- (void)dealloc {
|
||||
|
||||
@@ -11,10 +11,5 @@
|
||||
|
||||
@class SBSubSerializer;
|
||||
|
||||
@interface MP42SrtImporter : MP42FileImporter {
|
||||
@private
|
||||
SBSubSerializer *_ss;
|
||||
BOOL _verticalPlacement;
|
||||
}
|
||||
|
||||
@interface MP42SrtImporter : MP42FileImporter
|
||||
@end
|
||||
@@ -17,7 +17,11 @@
|
||||
#import "MP42PrivateUtilities.h"
|
||||
#import "MP42Track+Muxer.h"
|
||||
|
||||
@implementation MP42SrtImporter
|
||||
@implementation MP42SrtImporter {
|
||||
@private
|
||||
SBSubSerializer *_ss;
|
||||
BOOL _verticalPlacement;
|
||||
}
|
||||
|
||||
+ (NSArray<NSString *> *)supportedFileFormats {
|
||||
return @[@"srt"];
|
||||
|
||||
@@ -11,15 +11,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MP42SubtitleTrack : MP42VideoTrack <NSCoding> {
|
||||
@private
|
||||
BOOL _verticalPlacement;
|
||||
BOOL _someSamplesAreForced;
|
||||
BOOL _allSamplesAreForced;
|
||||
|
||||
MP42TrackId _forcedTrackId;
|
||||
MP42Track *_forcedTrack;
|
||||
}
|
||||
@interface MP42SubtitleTrack : MP42VideoTrack <NSCoding>
|
||||
|
||||
- (BOOL)exportToURL:(NSURL *)url error:(NSError **)error;
|
||||
|
||||
|
||||
@@ -12,7 +12,15 @@
|
||||
#import "MP42MediaFormat.h"
|
||||
#import "MP42HtmlParser.h"
|
||||
|
||||
@implementation MP42SubtitleTrack
|
||||
@implementation MP42SubtitleTrack {
|
||||
@private
|
||||
BOOL _verticalPlacement;
|
||||
BOOL _someSamplesAreForced;
|
||||
BOOL _allSamplesAreForced;
|
||||
|
||||
MP42TrackId _forcedTrackId;
|
||||
MP42Track *_forcedTrack;
|
||||
}
|
||||
|
||||
- (instancetype)initWithSourceURL:(NSURL *)URL trackID:(NSInteger)trackID fileHandle:(MP4FileHandle)fileHandle
|
||||
{
|
||||
|
||||
@@ -12,12 +12,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MP42TextSample : NSObject <NSCoding> {
|
||||
@private
|
||||
MP42Duration _timestamp;
|
||||
MP42Image *_image;
|
||||
NSString *_title;
|
||||
}
|
||||
@interface MP42TextSample : NSObject <NSCoding>
|
||||
|
||||
@property (nonatomic, readwrite, copy) NSString *title;
|
||||
@property (nonatomic, readwrite, retain, nullable) MP42Image *image;
|
||||
|
||||
@@ -8,7 +8,12 @@
|
||||
|
||||
#import "MP42TextSample.h"
|
||||
|
||||
@implementation MP42TextSample
|
||||
@implementation MP42TextSample {
|
||||
@private
|
||||
MP42Duration _timestamp;
|
||||
MP42Image *_image;
|
||||
NSString *_title;
|
||||
}
|
||||
|
||||
- (NSComparisonResult)compare:(MP42TextSample *)otherObject
|
||||
{
|
||||
|
||||
@@ -8,9 +8,5 @@
|
||||
|
||||
#import "MP42FileImporter.h"
|
||||
|
||||
@interface MP42VobSubImporter : MP42FileImporter {
|
||||
@private
|
||||
NSArray *_VobSubTracks;
|
||||
}
|
||||
|
||||
@interface MP42VobSubImporter : MP42FileImporter
|
||||
@end
|
||||
@@ -219,7 +219,10 @@ static NSArray<SBVobSubTrack *> * LoadVobSubSubtitles(NSURL *theDirectory, NSStr
|
||||
}
|
||||
}
|
||||
|
||||
@implementation MP42VobSubImporter
|
||||
@implementation MP42VobSubImporter {
|
||||
@private
|
||||
NSArray *_VobSubTracks;
|
||||
}
|
||||
|
||||
+ (NSArray<NSString *> *)supportedFileFormats {
|
||||
return @[@"idx"];
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
//
|
||||
// QTKitDecrap.h
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 13/12/12.
|
||||
// Almost all the constants from QTMetadataItem all broken, @ instead of ©.
|
||||
// Plus define a QTKit costant.
|
||||
|
||||
#import <QTKit/QTKit.h>
|
||||
|
||||
extern NSString * const QTTrackLanguageAttribute; // NSNumber (long)
|
||||
|
||||
@interface QTMovie (QTMovieSublerExtras)
|
||||
|
||||
- (QTTrack *)trackWithTrackID:(NSInteger)trackID;
|
||||
|
||||
@end
|
||||
|
||||
@implementation QTMovie (QTMovieSublerExtras)
|
||||
|
||||
- (QTTrack *)trackWithTrackID:(NSInteger)trackID
|
||||
{
|
||||
for (QTTrack *track in [self tracks])
|
||||
if (trackID == [[track attributeForKey:QTTrackIDAttribute] integerValue])
|
||||
return track;
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,109 +0,0 @@
|
||||
/* $Id: downmix.h,v 1.51 2005/11/04 13:09:40 stebbins Exp $
|
||||
|
||||
This file is part of the HandBrake source code.
|
||||
Homepage: <http://handbrake.fr/>.
|
||||
It may be used under the terms of the GNU General Public License. */
|
||||
|
||||
#ifndef DOWNMIX_H
|
||||
#define DOWNMIX_H
|
||||
|
||||
/* Input Channel Layout */
|
||||
/* define some masks, used to extract the various information from the HB_AMIXDOWN_XXXX values */
|
||||
#define HB_INPUT_CH_LAYOUT_DISCRETE_FRONT_MASK 0x00F0000
|
||||
#define HB_INPUT_CH_LAYOUT_DISCRETE_REAR_MASK 0x000F000
|
||||
#define HB_INPUT_CH_LAYOUT_DISCRETE_LFE_MASK 0x0000F00
|
||||
#define HB_INPUT_CH_LAYOUT_DISCRETE_NO_LFE_MASK 0xFFFF0FF
|
||||
#define HB_INPUT_CH_LAYOUT_ENCODED_FRONT_MASK 0x00000F0
|
||||
#define HB_INPUT_CH_LAYOUT_ENCODED_REAR_MASK 0x000000F
|
||||
/* define the input channel layouts used to describe the channel layout of this audio */
|
||||
#define HB_INPUT_CH_LAYOUT_MONO 0x0110010
|
||||
#define HB_INPUT_CH_LAYOUT_STEREO 0x0220020
|
||||
#define HB_INPUT_CH_LAYOUT_DOLBY 0x0320031
|
||||
#define HB_INPUT_CH_LAYOUT_3F 0x0430030
|
||||
#define HB_INPUT_CH_LAYOUT_2F1R 0x0521021
|
||||
#define HB_INPUT_CH_LAYOUT_3F1R 0x0631031
|
||||
#define HB_INPUT_CH_LAYOUT_2F2R 0x0722022
|
||||
#define HB_INPUT_CH_LAYOUT_3F2R 0x0832032
|
||||
#define HB_INPUT_CH_LAYOUT_4F2R 0x0942042
|
||||
#define HB_INPUT_CH_LAYOUT_3F4R 0x0a34034
|
||||
#define HB_INPUT_CH_LAYOUT_HAS_LFE 0x0000100
|
||||
|
||||
#define HB_AMIXDOWN_MONO 0x01000001
|
||||
// DCA_FORMAT of DCA_MONO = 0 = 0x000
|
||||
// A52_FORMAT of A52_MONO = 1 = 0x01
|
||||
// discrete channel count of 1
|
||||
#define HB_AMIXDOWN_STEREO 0x02002022
|
||||
// DCA_FORMAT of DCA_STEREO = 2 = 0x002
|
||||
// A52_FORMAT of A52_STEREO = 2 = 0x02
|
||||
// discrete channel count of 2
|
||||
#define HB_AMIXDOWN_DOLBY 0x042070A2
|
||||
// DCA_FORMAT of DCA_3F1R | DCA_OUT_DPLI = 519 = 0x207
|
||||
// A52_FORMAT of A52_DOLBY = 10 = 0x0A
|
||||
// discrete channel count of 2
|
||||
#define HB_AMIXDOWN_DOLBYPLII 0x084094A2
|
||||
// DCA_FORMAT of DCA_3F2R | DCA_OUT_DPLII = 1033 = 0x409
|
||||
// A52_FORMAT of A52_DOLBY | A52_USE_DPLII = 74 = 0x4A
|
||||
// discrete channel count of 2
|
||||
#define HB_AMIXDOWN_6CH 0x10089176
|
||||
// DCA_FORMAT of DCA_3F2R | DCA_LFE = 137 = 0x089
|
||||
// A52_FORMAT of A52_3F2R | A52_LFE = 23 = 0x17
|
||||
// discrete channel count of 6
|
||||
|
||||
typedef float hb_sample_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int chan_map[10][2][8];
|
||||
int inv_chan_map[10][2][8];
|
||||
} hb_chan_map_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int mode_in;
|
||||
int mode_out;
|
||||
int nchans_in;
|
||||
int nchans_out;
|
||||
hb_sample_t matrix[8][8];
|
||||
int matrix_initialized;
|
||||
hb_sample_t clev;
|
||||
hb_sample_t slev;
|
||||
hb_sample_t level;
|
||||
hb_sample_t bias;
|
||||
hb_chan_map_t map_in;
|
||||
hb_chan_map_t map_out;
|
||||
|
||||
int center;
|
||||
int left_surround;
|
||||
int right_surround;
|
||||
int rear_left_surround;
|
||||
int rear_right_surround;
|
||||
} hb_downmix_t;
|
||||
|
||||
// For convenience, a map to convert smpte channel layout
|
||||
// to QuickTime channel layout.
|
||||
// Map Indicies are mode, lfe, channel respectively
|
||||
extern hb_chan_map_t hb_smpte_chan_map;
|
||||
extern hb_chan_map_t hb_ac3_chan_map;
|
||||
extern hb_chan_map_t hb_ac3_2_chan_map;
|
||||
extern hb_chan_map_t hb_qt_chan_map;
|
||||
|
||||
hb_downmix_t * hb_downmix_init(int layout, int mixdown);
|
||||
void hb_downmix_close( hb_downmix_t **downmix );
|
||||
int hb_downmix_set_mode( hb_downmix_t * downmix, int layout, int mixdown );
|
||||
void hb_downmix_set_level( hb_downmix_t * downmix, hb_sample_t clev, hb_sample_t slev, hb_sample_t level );
|
||||
void hb_downmix_adjust_level( hb_downmix_t * downmix );
|
||||
void hb_downmix_set_bias( hb_downmix_t * downmix, hb_sample_t bias );
|
||||
void hb_downmix_set_chan_map(
|
||||
hb_downmix_t * downmix,
|
||||
hb_chan_map_t * map_in,
|
||||
hb_chan_map_t * map_out );
|
||||
void hb_downmix( hb_downmix_t * downmix, hb_sample_t * dst, hb_sample_t * src, int nsamples);
|
||||
void hb_layout_remap(
|
||||
hb_chan_map_t * map_in,
|
||||
hb_chan_map_t * map_out,
|
||||
int layout,
|
||||
hb_sample_t * samples,
|
||||
int nsamples );
|
||||
int hb_need_downmix( int layout, int mixdown );
|
||||
|
||||
#endif /* DOWNMIX_H */
|
||||
Reference in new issue
Block a user