Update MP4Dump.

This commit is contained in:
Damiano Galassi committed 2019-10-15 08:32:21 +02:00
1 parent 33a876f218
commit 6bb26182ba
4 files changed
+36 -31

No files matched your search

+8 -8
View File
@@ -14,17 +14,17 @@ NSString *libraryPath = nil;
void logCallback(MP4LogLevel loglevel, const char* fmt, va_list ap)
{
if (!libraryPath) {
NSString *libraryDir = NSSearchPathForDirectoriesInDomains( NSLibraryDirectory,
NSUserDomainMask,
YES ).firstObject;
NSString *libraryDir = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSUserDomainMask,
YES).firstObject;
NSString *AppSupportDirectory = [[libraryDir stringByAppendingPathComponent:@"Application Support"]
stringByAppendingPathComponent:@"MP4Dump"];
if (![[NSFileManager defaultManager] fileExistsAtPath:AppSupportDirectory]) {
[[NSFileManager defaultManager] createDirectoryAtPath:AppSupportDirectory
withIntermediateDirectories:YES
attributes:nil
error:NULL];
if (![NSFileManager.defaultManager fileExistsAtPath:AppSupportDirectory]) {
[NSFileManager.defaultManager createDirectoryAtPath:AppSupportDirectory
withIntermediateDirectories:YES
attributes:nil
error:NULL];
}
libraryPath = [AppSupportDirectory stringByAppendingPathComponent:@"temp.txt"];
+15 -14
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12106.1" systemVersion="16E154a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12106.1"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15504"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -18,45 +18,45 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="69" y="418" width="637" height="542"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1028"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
<value key="minSize" type="size" width="94" height="86"/>
<view key="contentView" id="6">
<rect key="frame" x="0.0" y="0.0" width="637" height="542"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="100021">
<scrollView fixedFrame="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="100021">
<rect key="frame" x="-1" y="22" width="639" height="521"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" id="vWS-ib-gMH">
<rect key="frame" x="1" y="1" width="637" height="519"/>
<clipView key="contentView" ambiguous="YES" drawsBackground="NO" id="vWS-ib-gMH">
<rect key="frame" x="1" y="1" width="622" height="519"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView editable="NO" importsGraphics="NO" richText="NO" findStyle="bar" id="100024">
<textView ambiguous="YES" editable="NO" importsGraphics="NO" richText="NO" verticallyResizable="YES" findStyle="bar" incrementalSearchingEnabled="YES" allowsCharacterPickerTouchBarItem="NO" allowsNonContiguousLayout="YES" textCompletion="NO" id="100024">
<rect key="frame" x="0.0" y="0.0" width="637" height="519"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<size key="minSize" width="637" height="519"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<size key="minSize" width="622" height="519"/>
<size key="maxSize" width="1261" height="10000000"/>
<color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
</textView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="100023">
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="100022">
<rect key="frame" x="622" y="1" width="16" height="519"/>
<rect key="frame" x="623" y="1" width="15" height="519"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<popUpButton id="100025">
<popUpButton fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="100025">
<rect key="frame" x="-1" y="-2" width="100" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<popUpButtonCell key="cell" type="bevel" title="Info" bezelStyle="regularSquare" imagePosition="left" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="bezel" tag="3" inset="2" selectedItem="100042" id="100026">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="menu"/>
<font key="font" metaFont="system"/>
<menu key="menu" title="OtherViews" id="100027">
<items>
<menuItem title="Error" tag="1" id="100029">
@@ -103,6 +103,7 @@
<connections>
<outlet property="delegate" destination="-2" id="17"/>
</connections>
<point key="canvasLocation" x="157" y="128"/>
</window>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
</objects>
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
@@ -158,10 +158,10 @@
2A37F4A9FDCFA73011CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1120;
};
buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "MP4Dump" */;
compatibilityVersion = "Xcode 3.2";
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 1;
knownRegions = (
@@ -248,6 +248,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
@@ -272,6 +273,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
+8 -6
View File
@@ -60,14 +60,17 @@ extern NSString *libraryPath;
{
MP4FileHandle fileHandle = MP4Read(absoluteURL.fileSystemRepresentation);
MP4Dump(fileHandle, 0);
MP4LogLevel level = (MP4LogLevel)[NSUserDefaults.standardUserDefaults integerForKey:@"LogLevel"];
MP4LogSetLevel(level);
MP4Dump(fileHandle, 0);
MP4Close(fileHandle, 0);
result = [NSString stringWithContentsOfFile:libraryPath encoding:NSASCIIStringEncoding error:outError];
if ([[NSFileManager defaultManager] isDeletableFileAtPath:libraryPath])
[[NSFileManager defaultManager] removeItemAtPath:libraryPath error:nil];
if ([NSFileManager.defaultManager isDeletableFileAtPath:libraryPath]) {
[NSFileManager.defaultManager removeItemAtPath:libraryPath error:nil];
}
if (result) {
return YES;
}
@@ -80,7 +83,6 @@ extern NSString *libraryPath;
{
if (outError != NULL && ![self _loadFileDump:absoluteURL error:outError]) {
*outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL];
return NO;
}
@@ -94,7 +96,7 @@ extern NSString *libraryPath;
- (IBAction)setLogLevel:(id)sender
{
MP4LogLevel level = (MP4LogLevel)[sender tag];
[[NSUserDefaults standardUserDefaults] setInteger:level forKey:@"LogLevel"];
[NSUserDefaults.standardUserDefaults setInteger:level forKey:@"LogLevel"];
MP4LogSetLevel(level);
if ([self _loadFileDump:self.fileURL error:nil]) {