diff --git a/.gitignore b/.gitignore index 19111e41..d8745765 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ Pods UserInterface.xcuserstate xcuserdata/ -*.lock \ No newline at end of file +*.lock +.DS_Store +build diff --git a/Podfile b/Podfile index 3cb9a7ae..7069d153 100644 --- a/Podfile +++ b/Podfile @@ -1,8 +1,19 @@ -platform :ios, '8.0' - -target 'SVGAPlayer' do +platform :ios, '12.0' +target 'SVGAPlayerDemo' do pod 'SSZipArchive', '~> 2.1.4' pod 'Protobuf', '~> 3.4' +end +target 'SVGAPlayer' do + pod 'SSZipArchive', '~> 2.1.4' + pod 'Protobuf', '~> 3.4' end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "12.0" + end + end + end diff --git a/Podfile.lock b/Podfile.lock index be536f16..973f4fee 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -7,7 +7,7 @@ DEPENDENCIES: - SSZipArchive (~> 2.1.4) SPEC REPOS: - https://github.com/CocoaPods/Specs.git: + https://gitee.com/mirrors/CocoaPods-Specs.git: - Protobuf - SSZipArchive @@ -15,6 +15,6 @@ SPEC CHECKSUMS: Protobuf: 1eb9700044745f00181c136ef21b8ff3ad5a0fd5 SSZipArchive: 41455d4b8d2b6ab93990820b50dc697c2554a322 -PODFILE CHECKSUM: 15ec3c806396baa34a298b2254638f0a6691580c +PODFILE CHECKSUM: b5c5105cdd322486ab4cb3c2d05afe068009dc66 -COCOAPODS: 1.9.1 +COCOAPODS: 1.16.2 diff --git a/SVGAPlayer.xcodeproj/project.pbxproj b/SVGAPlayer.xcodeproj/project.pbxproj index 4f39f57f..e753b453 100644 --- a/SVGAPlayer.xcodeproj/project.pbxproj +++ b/SVGAPlayer.xcodeproj/project.pbxproj @@ -15,7 +15,7 @@ 71A8679122B7785100176CD6 /* matteRect.svga in Resources */ = {isa = PBXBuildFile; fileRef = 71A8679022B7785100176CD6 /* matteRect.svga */; }; 71A8679322B7853600176CD6 /* matteBitmap.svga in Resources */ = {isa = PBXBuildFile; fileRef = 71A8679222B7853600176CD6 /* matteBitmap.svga */; }; 71DAA8A52355B3ED006608A1 /* Goddess.svga in Resources */ = {isa = PBXBuildFile; fileRef = 71DAA8A42355B3ED006608A1 /* Goddess.svga */; }; - 80D4C7254846B96B9C6EED83 /* libPods-SVGAPlayer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DDA5FF396660C7C932DF9B8 /* libPods-SVGAPlayer.a */; }; + 860B128ED6B8A53405306522 /* libPods-SVGAPlayerDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BB99F49A87B6B31DCEF63DE0 /* libPods-SVGAPlayerDemo.a */; }; 904D41F81D223DD20085A21A /* SVGABezierPath.m in Sources */ = {isa = PBXBuildFile; fileRef = 904D41F71D223DD20085A21A /* SVGABezierPath.m */; }; 9052FC631E6EB8D4007BC925 /* SVGAExporter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9052FC621E6EB8D4007BC925 /* SVGAExporter.m */; }; 90A364D11E5AEC11009347F1 /* SVGABitmapLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 90A364D01E5AEC11009347F1 /* SVGABitmapLayer.m */; }; @@ -39,11 +39,66 @@ 90D7CA1C1F7FB114006E74F0 /* rose_1.5.0.svga in Resources */ = {isa = PBXBuildFile; fileRef = 90D7CA1A1F7FB114006E74F0 /* rose_1.5.0.svga */; }; 90D7CA1E1F7FB34E006E74F0 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 90D7CA1D1F7FB34E006E74F0 /* libz.tbd */; }; 90DB59B51F96026E00894727 /* SVGAImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 90DB59B41F96026E00894727 /* SVGAImageView.m */; }; + 9D2D89394F3F82947CA3DE92 /* libPods-SVGAPlayer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CCE52B7C8CB296705A5E2B0E /* libPods-SVGAPlayer.a */; }; + B788331F2BC64B0C000474C2 /* Svga.pbobjc.h in Headers */ = {isa = PBXBuildFile; fileRef = B788331C2BC64B0C000474C2 /* Svga.pbobjc.h */; }; + B78833202BC64B0C000474C2 /* Svga.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = B788331D2BC64B0C000474C2 /* Svga.pbobjc.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + B788333C2BC64B1B000474C2 /* SVGA.m in Sources */ = {isa = PBXBuildFile; fileRef = B78833212BC64B1B000474C2 /* SVGA.m */; }; + B788333D2BC64B1B000474C2 /* SVGAVectorLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = B78833222BC64B1B000474C2 /* SVGAVectorLayer.m */; }; + B788333E2BC64B1B000474C2 /* SVGAVideoSpriteEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = B78833232BC64B1B000474C2 /* SVGAVideoSpriteEntity.m */; }; + B788333F2BC64B1B000474C2 /* SVGAVideoSpriteFrameEntity.h in Headers */ = {isa = PBXBuildFile; fileRef = B78833242BC64B1B000474C2 /* SVGAVideoSpriteFrameEntity.h */; }; + B78833402BC64B1B000474C2 /* SVGAParser.m in Sources */ = {isa = PBXBuildFile; fileRef = B78833252BC64B1B000474C2 /* SVGAParser.m */; }; + B78833412BC64B1B000474C2 /* SVGAImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = B78833262BC64B1B000474C2 /* SVGAImageView.m */; }; + B78833422BC64B1B000474C2 /* SVGAExporter.m in Sources */ = {isa = PBXBuildFile; fileRef = B78833272BC64B1B000474C2 /* SVGAExporter.m */; }; + B78833432BC64B1B000474C2 /* SVGAAudioLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = B78833282BC64B1B000474C2 /* SVGAAudioLayer.h */; }; + B78833442BC64B1B000474C2 /* SVGAAudioLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = B78833292BC64B1B000474C2 /* SVGAAudioLayer.m */; }; + B78833452BC64B1B000474C2 /* SVGAVideoEntity.h in Headers */ = {isa = PBXBuildFile; fileRef = B788332A2BC64B1B000474C2 /* SVGAVideoEntity.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B78833462BC64B1B000474C2 /* SVGABitmapLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = B788332B2BC64B1B000474C2 /* SVGABitmapLayer.m */; }; + B78833472BC64B1B000474C2 /* SVGAVectorLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = B788332C2BC64B1B000474C2 /* SVGAVectorLayer.h */; }; + B78833482BC64B1B000474C2 /* SVGAContentLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = B788332D2BC64B1B000474C2 /* SVGAContentLayer.h */; }; + B78833492BC64B1B000474C2 /* SVGAPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = B788332E2BC64B1B000474C2 /* SVGAPlayer.m */; }; + B788334A2BC64B1B000474C2 /* SVGAVideoSpriteFrameEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = B788332F2BC64B1B000474C2 /* SVGAVideoSpriteFrameEntity.m */; }; + B788334B2BC64B1B000474C2 /* SVGAVideoSpriteEntity.h in Headers */ = {isa = PBXBuildFile; fileRef = B78833302BC64B1B000474C2 /* SVGAVideoSpriteEntity.h */; }; + B788334C2BC64B1B000474C2 /* SVGAExporter.h in Headers */ = {isa = PBXBuildFile; fileRef = B78833312BC64B1B000474C2 /* SVGAExporter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B788334D2BC64B1B000474C2 /* SVGAParser.h in Headers */ = {isa = PBXBuildFile; fileRef = B78833322BC64B1B000474C2 /* SVGAParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B788334E2BC64B1B000474C2 /* SVGABezierPath.h in Headers */ = {isa = PBXBuildFile; fileRef = B78833332BC64B1B000474C2 /* SVGABezierPath.h */; }; + B788334F2BC64B1B000474C2 /* SVGAAudioEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = B78833342BC64B1B000474C2 /* SVGAAudioEntity.m */; }; + B78833502BC64B1B000474C2 /* SVGABitmapLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = B78833352BC64B1B000474C2 /* SVGABitmapLayer.h */; }; + B78833512BC64B1B000474C2 /* SVGAAudioEntity.h in Headers */ = {isa = PBXBuildFile; fileRef = B78833362BC64B1B000474C2 /* SVGAAudioEntity.h */; }; + B78833522BC64B1B000474C2 /* SVGABezierPath.m in Sources */ = {isa = PBXBuildFile; fileRef = B78833372BC64B1B000474C2 /* SVGABezierPath.m */; }; + B78833542BC64B1B000474C2 /* SVGAVideoEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = B78833392BC64B1B000474C2 /* SVGAVideoEntity.m */; }; + B78833552BC64B1B000474C2 /* SVGAImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = B788333A2BC64B1B000474C2 /* SVGAImageView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B78833562BC64B1B000474C2 /* SVGAContentLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = B788333B2BC64B1B000474C2 /* SVGAContentLayer.m */; }; + B78833582BC64BE9000474C2 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = B78833572BC64BE0000474C2 /* libz.tbd */; }; E83A58D9247E0E6A00D9F404 /* audio_biling.svga in Resources */ = {isa = PBXBuildFile; fileRef = E83A58D8247E0E6A00D9F404 /* audio_biling.svga */; }; + EF466E802D2C0C9C00FFBCB1 /* SVGAPlayer+public.h in Headers */ = {isa = PBXBuildFile; fileRef = EF466E7D2D2C0B6300FFBCB1 /* SVGAPlayer+public.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EF466E822D2C0DDA00FFBCB1 /* SVGA.h in Headers */ = {isa = PBXBuildFile; fileRef = 90A676F81D13A81F008A69F3 /* SVGA.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EF466E832D2C10D000FFBCB1 /* SVGAPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 90A677041D13BF77008A69F3 /* SVGAPlayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EFF7B0AF2D281CAD00404F60 /* UIImage+Resize.m in Sources */ = {isa = PBXBuildFile; fileRef = EFF7B0AE2D281CAD00404F60 /* UIImage+Resize.m */; }; + EFF7B0B02D281CAD00404F60 /* UIImage+Resize.h in Headers */ = {isa = PBXBuildFile; fileRef = EFF7B0AD2D281CAD00404F60 /* UIImage+Resize.h */; }; + EFF7B0B12D281CAD00404F60 /* UIImage+Resize.m in Sources */ = {isa = PBXBuildFile; fileRef = EFF7B0AE2D281CAD00404F60 /* UIImage+Resize.m */; }; + EFF7B0C22D2917C200404F60 /* DebugInfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = EFF7B0C12D2917C200404F60 /* DebugInfoView.m */; }; + EFF7B0C32D2917C200404F60 /* DebugInfoView.h in Headers */ = {isa = PBXBuildFile; fileRef = EFF7B0C02D2917C200404F60 /* DebugInfoView.h */; }; + EFF7B0C42D2917C200404F60 /* DebugInfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = EFF7B0C12D2917C200404F60 /* DebugInfoView.m */; }; + FC37CEED92F70863E863D2B6 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; /* End PBXBuildFile section */ +/* Begin PBXCopyFilesBuildPhase section */ + EF466E6F2D2BF31700FFBCB1 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ - 1DDA5FF396660C7C932DF9B8 /* libPods-SVGAPlayer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SVGAPlayer.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 14714B6E44B276D74A209A31 /* Pods-SVGAPlayerDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SVGAPlayerDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SVGAPlayerDemo/Pods-SVGAPlayerDemo.debug.xcconfig"; sourceTree = ""; }; + 1B65E3B43FC8C3D598EC0B41 /* Pods-SVGAPlayerDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SVGAPlayerDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-SVGAPlayerDemo/Pods-SVGAPlayerDemo.release.xcconfig"; sourceTree = ""; }; + 4A920DC40C4E275D894059B4 /* Pods-SVGA.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SVGA.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SVGA/Pods-SVGA.debug.xcconfig"; sourceTree = ""; }; 63712E6421787950001AE014 /* heartbeat.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = heartbeat.svga; sourceTree = ""; }; 63712E6621787A45001AE014 /* SVGAAudioEntity.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAAudioEntity.h; sourceTree = ""; }; 63712E6721787A45001AE014 /* SVGAAudioEntity.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SVGAAudioEntity.m; sourceTree = ""; }; @@ -69,7 +124,7 @@ 90A364D91E5AED04009347F1 /* SVGAVideoSpriteFrameEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVGAVideoSpriteFrameEntity.m; sourceTree = ""; }; 90A364DB1E5D33F8009347F1 /* SVGAContentLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAContentLayer.h; sourceTree = ""; }; 90A364DC1E5D33F8009347F1 /* SVGAContentLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVGAContentLayer.m; sourceTree = ""; }; - 90A676DD1D13A6DF008A69F3 /* SVGAPlayer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SVGAPlayer.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 90A676DD1D13A6DF008A69F3 /* SVGAPlayerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SVGAPlayerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 90A676E11D13A6DF008A69F3 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 90A676E31D13A6DF008A69F3 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 90A676E41D13A6DF008A69F3 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; @@ -95,8 +150,48 @@ 90D7CA1D1F7FB34E006E74F0 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 90DB59B31F96026E00894727 /* SVGAImageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAImageView.h; sourceTree = ""; }; 90DB59B41F96026E00894727 /* SVGAImageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SVGAImageView.m; sourceTree = ""; }; + B78833152BC64A9F000474C2 /* SVGAPlayer.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SVGAPlayer.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B78833172BC64A9F000474C2 /* SVGA.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGA.h; sourceTree = ""; }; + B788331C2BC64B0C000474C2 /* Svga.pbobjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Svga.pbobjc.h; sourceTree = ""; }; + B788331D2BC64B0C000474C2 /* Svga.pbobjc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Svga.pbobjc.m; sourceTree = ""; }; + B78833212BC64B1B000474C2 /* SVGA.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGA.m; path = Source/SVGA.m; sourceTree = SOURCE_ROOT; }; + B78833222BC64B1B000474C2 /* SVGAVectorLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGAVectorLayer.m; path = Source/SVGAVectorLayer.m; sourceTree = SOURCE_ROOT; }; + B78833232BC64B1B000474C2 /* SVGAVideoSpriteEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGAVideoSpriteEntity.m; path = Source/SVGAVideoSpriteEntity.m; sourceTree = SOURCE_ROOT; }; + B78833242BC64B1B000474C2 /* SVGAVideoSpriteFrameEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGAVideoSpriteFrameEntity.h; path = Source/SVGAVideoSpriteFrameEntity.h; sourceTree = SOURCE_ROOT; }; + B78833252BC64B1B000474C2 /* SVGAParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGAParser.m; path = Source/SVGAParser.m; sourceTree = SOURCE_ROOT; }; + B78833262BC64B1B000474C2 /* SVGAImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGAImageView.m; path = Source/SVGAImageView.m; sourceTree = SOURCE_ROOT; }; + B78833272BC64B1B000474C2 /* SVGAExporter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGAExporter.m; path = Source/SVGAExporter.m; sourceTree = SOURCE_ROOT; }; + B78833282BC64B1B000474C2 /* SVGAAudioLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGAAudioLayer.h; path = Source/SVGAAudioLayer.h; sourceTree = SOURCE_ROOT; }; + B78833292BC64B1B000474C2 /* SVGAAudioLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGAAudioLayer.m; path = Source/SVGAAudioLayer.m; sourceTree = SOURCE_ROOT; }; + B788332A2BC64B1B000474C2 /* SVGAVideoEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGAVideoEntity.h; path = Source/SVGAVideoEntity.h; sourceTree = SOURCE_ROOT; }; + B788332B2BC64B1B000474C2 /* SVGABitmapLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGABitmapLayer.m; path = Source/SVGABitmapLayer.m; sourceTree = SOURCE_ROOT; }; + B788332C2BC64B1B000474C2 /* SVGAVectorLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGAVectorLayer.h; path = Source/SVGAVectorLayer.h; sourceTree = SOURCE_ROOT; }; + B788332D2BC64B1B000474C2 /* SVGAContentLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGAContentLayer.h; path = Source/SVGAContentLayer.h; sourceTree = SOURCE_ROOT; }; + B788332E2BC64B1B000474C2 /* SVGAPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGAPlayer.m; path = Source/SVGAPlayer.m; sourceTree = SOURCE_ROOT; }; + B788332F2BC64B1B000474C2 /* SVGAVideoSpriteFrameEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGAVideoSpriteFrameEntity.m; path = Source/SVGAVideoSpriteFrameEntity.m; sourceTree = SOURCE_ROOT; }; + B78833302BC64B1B000474C2 /* SVGAVideoSpriteEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGAVideoSpriteEntity.h; path = Source/SVGAVideoSpriteEntity.h; sourceTree = SOURCE_ROOT; }; + B78833312BC64B1B000474C2 /* SVGAExporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGAExporter.h; path = Source/SVGAExporter.h; sourceTree = SOURCE_ROOT; }; + B78833322BC64B1B000474C2 /* SVGAParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGAParser.h; path = Source/SVGAParser.h; sourceTree = SOURCE_ROOT; }; + B78833332BC64B1B000474C2 /* SVGABezierPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGABezierPath.h; path = Source/SVGABezierPath.h; sourceTree = SOURCE_ROOT; }; + B78833342BC64B1B000474C2 /* SVGAAudioEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGAAudioEntity.m; path = Source/SVGAAudioEntity.m; sourceTree = SOURCE_ROOT; }; + B78833352BC64B1B000474C2 /* SVGABitmapLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGABitmapLayer.h; path = Source/SVGABitmapLayer.h; sourceTree = SOURCE_ROOT; }; + B78833362BC64B1B000474C2 /* SVGAAudioEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGAAudioEntity.h; path = Source/SVGAAudioEntity.h; sourceTree = SOURCE_ROOT; }; + B78833372BC64B1B000474C2 /* SVGABezierPath.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGABezierPath.m; path = Source/SVGABezierPath.m; sourceTree = SOURCE_ROOT; }; + B78833382BC64B1B000474C2 /* SVGAPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGAPlayer.h; path = Source/SVGAPlayer.h; sourceTree = SOURCE_ROOT; }; + B78833392BC64B1B000474C2 /* SVGAVideoEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGAVideoEntity.m; path = Source/SVGAVideoEntity.m; sourceTree = SOURCE_ROOT; }; + B788333A2BC64B1B000474C2 /* SVGAImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVGAImageView.h; path = Source/SVGAImageView.h; sourceTree = SOURCE_ROOT; }; + B788333B2BC64B1B000474C2 /* SVGAContentLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVGAContentLayer.m; path = Source/SVGAContentLayer.m; sourceTree = SOURCE_ROOT; }; + B78833572BC64BE0000474C2 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; + BB99F49A87B6B31DCEF63DE0 /* libPods-SVGAPlayerDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SVGAPlayerDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + CCE52B7C8CB296705A5E2B0E /* libPods-SVGAPlayer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SVGAPlayer.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E02B8713B25C0283C736EE03 /* Pods-SVGAPlayer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SVGAPlayer.release.xcconfig"; path = "Pods/Target Support Files/Pods-SVGAPlayer/Pods-SVGAPlayer.release.xcconfig"; sourceTree = ""; }; E83A58D8247E0E6A00D9F404 /* audio_biling.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = audio_biling.svga; sourceTree = ""; }; + EF466E7D2D2C0B6300FFBCB1 /* SVGAPlayer+public.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SVGAPlayer+public.h"; sourceTree = ""; }; + EFF7B0AD2D281CAD00404F60 /* UIImage+Resize.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+Resize.h"; sourceTree = ""; }; + EFF7B0AE2D281CAD00404F60 /* UIImage+Resize.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Resize.m"; sourceTree = ""; }; + EFF7B0C02D2917C200404F60 /* DebugInfoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DebugInfoView.h; sourceTree = ""; }; + EFF7B0C12D2917C200404F60 /* DebugInfoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DebugInfoView.m; sourceTree = ""; }; + FAA02C4EB96718C5A12970B6 /* Pods-SVGA.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SVGA.release.xcconfig"; path = "Pods/Target Support Files/Pods-SVGA/Pods-SVGA.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -105,7 +200,17 @@ buildActionMask = 2147483647; files = ( 90D7CA1E1F7FB34E006E74F0 /* libz.tbd in Frameworks */, - 80D4C7254846B96B9C6EED83 /* libPods-SVGAPlayer.a in Frameworks */, + 860B128ED6B8A53405306522 /* libPods-SVGAPlayerDemo.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B78833122BC64A9F000474C2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B78833582BC64BE9000474C2 /* libz.tbd in Frameworks */, + FC37CEED92F70863E863D2B6 /* (null) in Frameworks */, + 9D2D89394F3F82947CA3DE92 /* libPods-SVGAPlayer.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -117,6 +222,10 @@ children = ( 8AD65028FA2D122A34DC4A63 /* Pods-SVGAPlayer.debug.xcconfig */, E02B8713B25C0283C736EE03 /* Pods-SVGAPlayer.release.xcconfig */, + 4A920DC40C4E275D894059B4 /* Pods-SVGA.debug.xcconfig */, + FAA02C4EB96718C5A12970B6 /* Pods-SVGA.release.xcconfig */, + 14714B6E44B276D74A209A31 /* Pods-SVGAPlayerDemo.debug.xcconfig */, + 1B65E3B43FC8C3D598EC0B41 /* Pods-SVGAPlayerDemo.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -125,7 +234,8 @@ isa = PBXGroup; children = ( 90A676F71D13A70E008A69F3 /* Source */, - 90A676DF1D13A6DF008A69F3 /* SVGAPlayer */, + 90A676DF1D13A6DF008A69F3 /* SVGAPlayerDemo */, + B78833162BC64A9F000474C2 /* SVGAPlayer */, 90A676DE1D13A6DF008A69F3 /* Products */, 431B19F0F45A7844195F461A /* Pods */, B8EE95EA56FFE89CDEC9D8C3 /* Frameworks */, @@ -135,12 +245,13 @@ 90A676DE1D13A6DF008A69F3 /* Products */ = { isa = PBXGroup; children = ( - 90A676DD1D13A6DF008A69F3 /* SVGAPlayer.app */, + 90A676DD1D13A6DF008A69F3 /* SVGAPlayerDemo.app */, + B78833152BC64A9F000474C2 /* SVGAPlayer.framework */, ); name = Products; sourceTree = ""; }; - 90A676DF1D13A6DF008A69F3 /* SVGAPlayer */ = { + 90A676DF1D13A6DF008A69F3 /* SVGAPlayerDemo */ = { isa = PBXGroup; children = ( 90D7C9FA1F7E2AA3006E74F0 /* Samples */, @@ -155,7 +266,7 @@ 90CB64F81EF297E800DAA382 /* SVGAPlayer React-Info.plist */, 90A676E01D13A6DF008A69F3 /* Supporting Files */, ); - path = SVGAPlayer; + path = SVGAPlayerDemo; sourceTree = ""; }; 90A676E01D13A6DF008A69F3 /* Supporting Files */ = { @@ -190,6 +301,7 @@ 90A364D31E5AEC1C009347F1 /* SVGAVectorLayer.m */, 63E816FF2178809D001D2D62 /* SVGAAudioLayer.h */, 63E817002178809D001D2D62 /* SVGAAudioLayer.m */, + EF466E7D2D2C0B6300FFBCB1 /* SVGAPlayer+public.h */, 90A677041D13BF77008A69F3 /* SVGAPlayer.h */, 90A677051D13BF77008A69F3 /* SVGAPlayer.m */, 90DB59B31F96026E00894727 /* SVGAImageView.h */, @@ -198,6 +310,10 @@ 9052FC621E6EB8D4007BC925 /* SVGAExporter.m */, 904D41F61D223DD20085A21A /* SVGABezierPath.h */, 904D41F71D223DD20085A21A /* SVGABezierPath.m */, + EFF7B0AD2D281CAD00404F60 /* UIImage+Resize.h */, + EFF7B0AE2D281CAD00404F60 /* UIImage+Resize.m */, + EFF7B0C02D2917C200404F60 /* DebugInfoView.h */, + EFF7B0C12D2917C200404F60 /* DebugInfoView.m */, ); path = Source; sourceTree = ""; @@ -227,36 +343,132 @@ path = pbobjc; sourceTree = ""; }; + B78833162BC64A9F000474C2 /* SVGAPlayer */ = { + isa = PBXGroup; + children = ( + B788331E2BC64B0C000474C2 /* pbobjc */, + B78833172BC64A9F000474C2 /* SVGA.h */, + B78833212BC64B1B000474C2 /* SVGA.m */, + B78833362BC64B1B000474C2 /* SVGAAudioEntity.h */, + B78833342BC64B1B000474C2 /* SVGAAudioEntity.m */, + B78833282BC64B1B000474C2 /* SVGAAudioLayer.h */, + B78833292BC64B1B000474C2 /* SVGAAudioLayer.m */, + B78833332BC64B1B000474C2 /* SVGABezierPath.h */, + B78833372BC64B1B000474C2 /* SVGABezierPath.m */, + B78833352BC64B1B000474C2 /* SVGABitmapLayer.h */, + B788332B2BC64B1B000474C2 /* SVGABitmapLayer.m */, + B788332D2BC64B1B000474C2 /* SVGAContentLayer.h */, + B788333B2BC64B1B000474C2 /* SVGAContentLayer.m */, + B78833312BC64B1B000474C2 /* SVGAExporter.h */, + B78833272BC64B1B000474C2 /* SVGAExporter.m */, + B788333A2BC64B1B000474C2 /* SVGAImageView.h */, + B78833262BC64B1B000474C2 /* SVGAImageView.m */, + B78833322BC64B1B000474C2 /* SVGAParser.h */, + B78833252BC64B1B000474C2 /* SVGAParser.m */, + B78833382BC64B1B000474C2 /* SVGAPlayer.h */, + B788332E2BC64B1B000474C2 /* SVGAPlayer.m */, + B788332C2BC64B1B000474C2 /* SVGAVectorLayer.h */, + B78833222BC64B1B000474C2 /* SVGAVectorLayer.m */, + B788332A2BC64B1B000474C2 /* SVGAVideoEntity.h */, + B78833392BC64B1B000474C2 /* SVGAVideoEntity.m */, + B78833302BC64B1B000474C2 /* SVGAVideoSpriteEntity.h */, + B78833232BC64B1B000474C2 /* SVGAVideoSpriteEntity.m */, + B78833242BC64B1B000474C2 /* SVGAVideoSpriteFrameEntity.h */, + B788332F2BC64B1B000474C2 /* SVGAVideoSpriteFrameEntity.m */, + ); + path = SVGAPlayer; + sourceTree = ""; + }; + B788331E2BC64B0C000474C2 /* pbobjc */ = { + isa = PBXGroup; + children = ( + B788331C2BC64B0C000474C2 /* Svga.pbobjc.h */, + B788331D2BC64B0C000474C2 /* Svga.pbobjc.m */, + ); + name = pbobjc; + path = Source/pbobjc; + sourceTree = SOURCE_ROOT; + }; B8EE95EA56FFE89CDEC9D8C3 /* Frameworks */ = { isa = PBXGroup; children = ( 90D7CA1D1F7FB34E006E74F0 /* libz.tbd */, - 1DDA5FF396660C7C932DF9B8 /* libPods-SVGAPlayer.a */, + B78833572BC64BE0000474C2 /* libz.tbd */, + BB99F49A87B6B31DCEF63DE0 /* libPods-SVGAPlayerDemo.a */, + CCE52B7C8CB296705A5E2B0E /* libPods-SVGAPlayer.a */, ); name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + B78833102BC64A9F000474C2 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + B78833472BC64B1B000474C2 /* SVGAVectorLayer.h in Headers */, + B788334D2BC64B1B000474C2 /* SVGAParser.h in Headers */, + B788334C2BC64B1B000474C2 /* SVGAExporter.h in Headers */, + EF466E802D2C0C9C00FFBCB1 /* SVGAPlayer+public.h in Headers */, + EF466E822D2C0DDA00FFBCB1 /* SVGA.h in Headers */, + EF466E832D2C10D000FFBCB1 /* SVGAPlayer.h in Headers */, + B78833452BC64B1B000474C2 /* SVGAVideoEntity.h in Headers */, + EFF7B0B02D281CAD00404F60 /* UIImage+Resize.h in Headers */, + B78833552BC64B1B000474C2 /* SVGAImageView.h in Headers */, + B788334B2BC64B1B000474C2 /* SVGAVideoSpriteEntity.h in Headers */, + B78833502BC64B1B000474C2 /* SVGABitmapLayer.h in Headers */, + B78833482BC64B1B000474C2 /* SVGAContentLayer.h in Headers */, + B788331F2BC64B0C000474C2 /* Svga.pbobjc.h in Headers */, + B788334E2BC64B1B000474C2 /* SVGABezierPath.h in Headers */, + B78833512BC64B1B000474C2 /* SVGAAudioEntity.h in Headers */, + B788333F2BC64B1B000474C2 /* SVGAVideoSpriteFrameEntity.h in Headers */, + EFF7B0C32D2917C200404F60 /* DebugInfoView.h in Headers */, + B78833432BC64B1B000474C2 /* SVGAAudioLayer.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ - 90A676DC1D13A6DF008A69F3 /* SVGAPlayer */ = { + 90A676DC1D13A6DF008A69F3 /* SVGAPlayerDemo */ = { isa = PBXNativeTarget; - buildConfigurationList = 90A676F41D13A6DF008A69F3 /* Build configuration list for PBXNativeTarget "SVGAPlayer" */; + buildConfigurationList = 90A676F41D13A6DF008A69F3 /* Build configuration list for PBXNativeTarget "SVGAPlayerDemo" */; buildPhases = ( CD70B01EE331E392E355CD26 /* [CP] Check Pods Manifest.lock */, 90A676D91D13A6DF008A69F3 /* Sources */, 90A676DA1D13A6DF008A69F3 /* Frameworks */, 90A676DB1D13A6DF008A69F3 /* Resources */, + EF466E6F2D2BF31700FFBCB1 /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( ); - name = SVGAPlayer; + name = SVGAPlayerDemo; productName = SVGAPlayer; - productReference = 90A676DD1D13A6DF008A69F3 /* SVGAPlayer.app */; + productReference = 90A676DD1D13A6DF008A69F3 /* SVGAPlayerDemo.app */; productType = "com.apple.product-type.application"; }; + B78833142BC64A9F000474C2 /* SVGAPlayer */ = { + isa = PBXNativeTarget; + buildConfigurationList = B788331B2BC64A9F000474C2 /* Build configuration list for PBXNativeTarget "SVGAPlayer" */; + buildPhases = ( + D86E014333D44E49674E1F31 /* [CP] Check Pods Manifest.lock */, + B78833102BC64A9F000474C2 /* Headers */, + B78833112BC64A9F000474C2 /* Sources */, + B78833122BC64A9F000474C2 /* Frameworks */, + B78833132BC64A9F000474C2 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SVGAPlayer; + productName = SVGA; + productReference = B78833152BC64A9F000474C2 /* SVGAPlayer.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -268,16 +480,20 @@ TargetAttributes = { 90A676DC1D13A6DF008A69F3 = { CreatedOnToolsVersion = 7.3; - DevelopmentTeam = S2RM275849; + DevelopmentTeam = XM2VRDX92Q; + }; + B78833142BC64A9F000474C2 = { + CreatedOnToolsVersion = 15.3; + DevelopmentTeam = XM2VRDX92Q; + ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = 90A676D81D13A6DF008A69F3 /* Build configuration list for PBXProject "SVGAPlayer" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, Base, ); @@ -286,7 +502,8 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 90A676DC1D13A6DF008A69F3 /* SVGAPlayer */, + 90A676DC1D13A6DF008A69F3 /* SVGAPlayerDemo */, + B78833142BC64A9F000474C2 /* SVGAPlayer */, ); }; /* End PBXProject section */ @@ -312,6 +529,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B78833132BC64A9F000474C2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -325,6 +549,28 @@ "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SVGAPlayerDemo-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + D86E014333D44E49674E1F31 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); outputPaths = ( "$(DERIVED_FILE_DIR)/Pods-SVGAPlayer-checkManifestLockResult.txt", ); @@ -345,8 +591,10 @@ 90A677031D13AE19008A69F3 /* SVGAVideoEntity.m in Sources */, 90A364DA1E5AED04009347F1 /* SVGAVideoSpriteFrameEntity.m in Sources */, 63712E6821787A45001AE014 /* SVGAAudioEntity.m in Sources */, + EFF7B0AF2D281CAD00404F60 /* UIImage+Resize.m in Sources */, 63E817012178809D001D2D62 /* SVGAAudioLayer.m in Sources */, 90A364D11E5AEC11009347F1 /* SVGABitmapLayer.m in Sources */, + EFF7B0C22D2917C200404F60 /* DebugInfoView.m in Sources */, 904D41F81D223DD20085A21A /* SVGABezierPath.m in Sources */, 90A364D71E5AECBD009347F1 /* SVGAVideoSpriteEntity.m in Sources */, 90A676E51D13A6DF008A69F3 /* AppDelegate.m in Sources */, @@ -361,6 +609,30 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B78833112BC64A9F000474C2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B78833562BC64B1B000474C2 /* SVGAContentLayer.m in Sources */, + B788333D2BC64B1B000474C2 /* SVGAVectorLayer.m in Sources */, + B78833522BC64B1B000474C2 /* SVGABezierPath.m in Sources */, + B78833422BC64B1B000474C2 /* SVGAExporter.m in Sources */, + B788334A2BC64B1B000474C2 /* SVGAVideoSpriteFrameEntity.m in Sources */, + B78833462BC64B1B000474C2 /* SVGABitmapLayer.m in Sources */, + B788333C2BC64B1B000474C2 /* SVGA.m in Sources */, + B78833442BC64B1B000474C2 /* SVGAAudioLayer.m in Sources */, + B788333E2BC64B1B000474C2 /* SVGAVideoSpriteEntity.m in Sources */, + EFF7B0B12D281CAD00404F60 /* UIImage+Resize.m in Sources */, + B78833202BC64B0C000474C2 /* Svga.pbobjc.m in Sources */, + B78833542BC64B1B000474C2 /* SVGAVideoEntity.m in Sources */, + B788334F2BC64B1B000474C2 /* SVGAAudioEntity.m in Sources */, + EFF7B0C42D2917C200404F60 /* DebugInfoView.m in Sources */, + B78833402BC64B1B000474C2 /* SVGAParser.m in Sources */, + B78833412BC64B1B000474C2 /* SVGAImageView.m in Sources */, + B78833492BC64B1B000474C2 /* SVGAPlayer.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ @@ -467,15 +739,16 @@ }; 90A676F51D13A6DF008A69F3 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8AD65028FA2D122A34DC4A63 /* Pods-SVGAPlayer.debug.xcconfig */; + baseConfigurationReference = 14714B6E44B276D74A209A31 /* Pods-SVGAPlayerDemo.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; - DEVELOPMENT_TEAM = S2RM275849; - INFOPLIST_FILE = SVGAPlayer/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + DEVELOPMENT_TEAM = XM2VRDX92Q; + INFOPLIST_FILE = SVGAPlayerDemo/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = SvgaDemo; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.opensource.SVGAPlayer; + PRODUCT_BUNDLE_IDENTIFIER = io.tzeentch.SVGA; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; TARGETED_DEVICE_FAMILY = "1,2"; @@ -484,21 +757,131 @@ }; 90A676F61D13A6DF008A69F3 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E02B8713B25C0283C736EE03 /* Pods-SVGAPlayer.release.xcconfig */; + baseConfigurationReference = 1B65E3B43FC8C3D598EC0B41 /* Pods-SVGAPlayerDemo.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; - DEVELOPMENT_TEAM = S2RM275849; - INFOPLIST_FILE = SVGAPlayer/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + DEVELOPMENT_TEAM = XM2VRDX92Q; + INFOPLIST_FILE = SVGAPlayerDemo/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = SvgaDemo; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.opensource.SVGAPlayer; + PRODUCT_BUNDLE_IDENTIFIER = io.tzeentch.SVGA; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; + B78833192BC64A9F000474C2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8AD65028FA2D122A34DC4A63 /* Pods-SVGAPlayer.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = XM2VRDX92Q; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 UED Center. All rights reserved."; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACH_O_TYPE = mh_dylib; + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.tzeentch.SVGA; + PRODUCT_MODULE_NAME = SVGAPlayer; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + B788331A2BC64A9F000474C2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E02B8713B25C0283C736EE03 /* Pods-SVGAPlayer.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = XM2VRDX92Q; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 UED Center. All rights reserved."; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MACH_O_TYPE = mh_dylib; + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.tzeentch.SVGA; + PRODUCT_MODULE_NAME = SVGAPlayer; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -511,7 +894,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 90A676F41D13A6DF008A69F3 /* Build configuration list for PBXNativeTarget "SVGAPlayer" */ = { + 90A676F41D13A6DF008A69F3 /* Build configuration list for PBXNativeTarget "SVGAPlayerDemo" */ = { isa = XCConfigurationList; buildConfigurations = ( 90A676F51D13A6DF008A69F3 /* Debug */, @@ -520,6 +903,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + B788331B2BC64A9F000474C2 /* Build configuration list for PBXNativeTarget "SVGAPlayer" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B78833192BC64A9F000474C2 /* Debug */, + B788331A2BC64A9F000474C2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 90A676D51D13A6DF008A69F3 /* Project object */; diff --git a/SVGAPlayer.xcodeproj/xcshareddata/xcschemes/SVGAPlayer.xcscheme b/SVGAPlayer.xcodeproj/xcshareddata/xcschemes/SVGAPlayer.xcscheme index 55f72e87..6fdd2d0a 100644 --- a/SVGAPlayer.xcodeproj/xcshareddata/xcschemes/SVGAPlayer.xcscheme +++ b/SVGAPlayer.xcodeproj/xcshareddata/xcschemes/SVGAPlayer.xcscheme @@ -1,10 +1,11 @@ + LastUpgradeVersion = "1620" + version = "1.7"> + buildImplicitDependencies = "YES" + buildArchitectures = "Automatic"> @@ -26,9 +27,8 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES"> - - + shouldUseLaunchSchemeArgsEnv = "YES" + shouldAutocreateTestPlan = "YES"> - - - - - + - + diff --git a/SVGAPlayer.xcodeproj/xcuserdata/cuiminghui.xcuserdatad/xcschemes/SVGAPlayer.xcscheme b/SVGAPlayer.xcodeproj/xcshareddata/xcschemes/SVGAPlayerDemo.xcscheme similarity index 75% rename from SVGAPlayer.xcodeproj/xcuserdata/cuiminghui.xcuserdatad/xcschemes/SVGAPlayer.xcscheme rename to SVGAPlayer.xcodeproj/xcshareddata/xcschemes/SVGAPlayerDemo.xcscheme index e6d195c8..c2c8ce9b 100644 --- a/SVGAPlayer.xcodeproj/xcuserdata/cuiminghui.xcuserdatad/xcschemes/SVGAPlayer.xcscheme +++ b/SVGAPlayer.xcodeproj/xcshareddata/xcschemes/SVGAPlayerDemo.xcscheme @@ -1,6 +1,6 @@ @@ -29,17 +29,6 @@ shouldUseLaunchSchemeArgsEnv = "YES"> - - - - - - - - diff --git a/SVGAPlayer.xcodeproj/xcuserdata/cuiminghui.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/SVGAPlayer.xcodeproj/xcuserdata/cuiminghui.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist deleted file mode 100644 index fe2b4541..00000000 --- a/SVGAPlayer.xcodeproj/xcuserdata/cuiminghui.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/SVGAPlayer.xcodeproj/xcuserdata/cuiminghui.xcuserdatad/xcschemes/SVGAPlayer React.xcscheme b/SVGAPlayer.xcodeproj/xcuserdata/cuiminghui.xcuserdatad/xcschemes/SVGAPlayer React.xcscheme deleted file mode 100644 index 04020c75..00000000 --- a/SVGAPlayer.xcodeproj/xcuserdata/cuiminghui.xcuserdatad/xcschemes/SVGAPlayer React.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SVGAPlayer.xcodeproj/xcuserdata/cuiminghui.xcuserdatad/xcschemes/xcschememanagement.plist b/SVGAPlayer.xcodeproj/xcuserdata/cuiminghui.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 5ad4d1f1..00000000 --- a/SVGAPlayer.xcodeproj/xcuserdata/cuiminghui.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - SchemeUserState - - SVGAPlayer React.xcscheme - - orderHint - 1 - - SVGAPlayer.xcscheme - - orderHint - 0 - - - SuppressBuildableAutocreation - - 90A676DC1D13A6DF008A69F3 - - primary - - - 90CB64C91EF290F400DAA382 - - primary - - - - - diff --git a/SVGAPlayer.xcodeproj/xcuserdata/errnull.xcuserdatad/xcschemes/xcschememanagement.plist b/SVGAPlayer.xcodeproj/xcuserdata/errnull.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index d0671ccd..00000000 --- a/SVGAPlayer.xcodeproj/xcuserdata/errnull.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,27 +0,0 @@ - - - - - SchemeUserState - - SVGAPlayer React.xcscheme_^#shared#^_ - - orderHint - 7 - - SVGAPlayer.xcscheme_^#shared#^_ - - orderHint - 5 - - - SuppressBuildableAutocreation - - 90A676DC1D13A6DF008A69F3 - - primary - - - - - diff --git a/SVGAPlayer.xcodeproj/xcuserdata/saiakirahui.xcuserdatad/xcschemes/xcschememanagement.plist b/SVGAPlayer.xcodeproj/xcuserdata/saiakirahui.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index ef983a68..00000000 --- a/SVGAPlayer.xcodeproj/xcuserdata/saiakirahui.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,29 +0,0 @@ - - - - - SchemeUserState - - SVGAPlayer React.xcscheme - - orderHint - 7 - - SVGAPlayer React.xcscheme_^#shared#^_ - - orderHint - 4 - - SVGAPlayer.xcscheme - - orderHint - 6 - - SVGAPlayer.xcscheme_^#shared#^_ - - orderHint - 3 - - - - diff --git a/SVGAPlayer/SVGA.h b/SVGAPlayer/SVGA.h new file mode 100644 index 00000000..d1055ec1 --- /dev/null +++ b/SVGAPlayer/SVGA.h @@ -0,0 +1,30 @@ +// +// SVGA.h +// SVGA +// +// Created by Xinyu Wang on 2024/4/10. +// Copyright © 2024 UED Center. All rights reserved. +// + +#import + +//! Project version number for SVGA. +//FOUNDATION_EXPORT double SVGAVersionNumber; +// +////! Project version string for SVGA. +//FOUNDATION_EXPORT const unsigned char SVGAVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +//#import +//#import +//#import +//#import +//#import + + +@interface SVGA : NSObject ++ (SVGA *)shared; +- (void)setEnableDebug:(BOOL)enableDebug; +- (BOOL)enableDebug; +@end + diff --git a/SVGAPlayerDemo.xcworkspace/contents.xcworkspacedata b/SVGAPlayerDemo.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..03633c10 --- /dev/null +++ b/SVGAPlayerDemo.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/SVGAPlayer/AppDelegate.h b/SVGAPlayerDemo/AppDelegate.h similarity index 100% rename from SVGAPlayer/AppDelegate.h rename to SVGAPlayerDemo/AppDelegate.h diff --git a/SVGAPlayer/AppDelegate.m b/SVGAPlayerDemo/AppDelegate.m similarity index 100% rename from SVGAPlayer/AppDelegate.m rename to SVGAPlayerDemo/AppDelegate.m diff --git a/SVGAPlayer/Assets.xcassets/AppIcon.appiconset/Contents.json b/SVGAPlayerDemo/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from SVGAPlayer/Assets.xcassets/AppIcon.appiconset/Contents.json rename to SVGAPlayerDemo/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/SVGAPlayer/Assets.xcassets/Contents.json b/SVGAPlayerDemo/Assets.xcassets/Contents.json similarity index 100% rename from SVGAPlayer/Assets.xcassets/Contents.json rename to SVGAPlayerDemo/Assets.xcassets/Contents.json diff --git a/SVGAPlayer/Assets.xcassets/begin.imageset/Contents.json b/SVGAPlayerDemo/Assets.xcassets/begin.imageset/Contents.json similarity index 100% rename from SVGAPlayer/Assets.xcassets/begin.imageset/Contents.json rename to SVGAPlayerDemo/Assets.xcassets/begin.imageset/Contents.json diff --git a/SVGAPlayer/Assets.xcassets/begin.imageset/begin@2x.png b/SVGAPlayerDemo/Assets.xcassets/begin.imageset/begin@2x.png similarity index 100% rename from SVGAPlayer/Assets.xcassets/begin.imageset/begin@2x.png rename to SVGAPlayerDemo/Assets.xcassets/begin.imageset/begin@2x.png diff --git a/SVGAPlayer/Assets.xcassets/purse.imageset/Contents.json b/SVGAPlayerDemo/Assets.xcassets/purse.imageset/Contents.json similarity index 100% rename from SVGAPlayer/Assets.xcassets/purse.imageset/Contents.json rename to SVGAPlayerDemo/Assets.xcassets/purse.imageset/Contents.json diff --git a/SVGAPlayer/Assets.xcassets/purse.imageset/purse@2x.png b/SVGAPlayerDemo/Assets.xcassets/purse.imageset/purse@2x.png similarity index 100% rename from SVGAPlayer/Assets.xcassets/purse.imageset/purse@2x.png rename to SVGAPlayerDemo/Assets.xcassets/purse.imageset/purse@2x.png diff --git a/SVGAPlayer/Base.lproj/LaunchScreen.storyboard b/SVGAPlayerDemo/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from SVGAPlayer/Base.lproj/LaunchScreen.storyboard rename to SVGAPlayerDemo/Base.lproj/LaunchScreen.storyboard diff --git a/SVGAPlayer/Base.lproj/Main.storyboard b/SVGAPlayerDemo/Base.lproj/Main.storyboard similarity index 100% rename from SVGAPlayer/Base.lproj/Main.storyboard rename to SVGAPlayerDemo/Base.lproj/Main.storyboard diff --git a/SVGAPlayer/Info.plist b/SVGAPlayerDemo/Info.plist similarity index 100% rename from SVGAPlayer/Info.plist rename to SVGAPlayerDemo/Info.plist diff --git a/SVGAPlayer/SVGAPlayer React-Info.plist b/SVGAPlayerDemo/SVGAPlayer React-Info.plist similarity index 100% rename from SVGAPlayer/SVGAPlayer React-Info.plist rename to SVGAPlayerDemo/SVGAPlayer React-Info.plist diff --git a/SVGAPlayer/Samples/Goddess.svga b/SVGAPlayerDemo/Samples/Goddess.svga similarity index 100% rename from SVGAPlayer/Samples/Goddess.svga rename to SVGAPlayerDemo/Samples/Goddess.svga diff --git a/SVGAPlayer/Samples/Rocket.svga b/SVGAPlayerDemo/Samples/Rocket.svga similarity index 100% rename from SVGAPlayer/Samples/Rocket.svga rename to SVGAPlayerDemo/Samples/Rocket.svga diff --git a/SVGAPlayer/Samples/audio_biling.svga b/SVGAPlayerDemo/Samples/audio_biling.svga similarity index 100% rename from SVGAPlayer/Samples/audio_biling.svga rename to SVGAPlayerDemo/Samples/audio_biling.svga diff --git a/SVGAPlayer/Samples/heartbeat.svga b/SVGAPlayerDemo/Samples/heartbeat.svga similarity index 100% rename from SVGAPlayer/Samples/heartbeat.svga rename to SVGAPlayerDemo/Samples/heartbeat.svga diff --git a/SVGAPlayer/Samples/matteBitmap.svga b/SVGAPlayerDemo/Samples/matteBitmap.svga similarity index 100% rename from SVGAPlayer/Samples/matteBitmap.svga rename to SVGAPlayerDemo/Samples/matteBitmap.svga diff --git a/SVGAPlayer/Samples/matteBitmap_1.x.svga b/SVGAPlayerDemo/Samples/matteBitmap_1.x.svga similarity index 100% rename from SVGAPlayer/Samples/matteBitmap_1.x.svga rename to SVGAPlayerDemo/Samples/matteBitmap_1.x.svga diff --git a/SVGAPlayer/Samples/matteRect.svga b/SVGAPlayerDemo/Samples/matteRect.svga similarity index 100% rename from SVGAPlayer/Samples/matteRect.svga rename to SVGAPlayerDemo/Samples/matteRect.svga diff --git a/SVGAPlayer/Samples/mutiMatte.svga b/SVGAPlayerDemo/Samples/mutiMatte.svga similarity index 100% rename from SVGAPlayer/Samples/mutiMatte.svga rename to SVGAPlayerDemo/Samples/mutiMatte.svga diff --git a/SVGAPlayer/Samples/rose_1.5.0.svga b/SVGAPlayerDemo/Samples/rose_1.5.0.svga similarity index 100% rename from SVGAPlayer/Samples/rose_1.5.0.svga rename to SVGAPlayerDemo/Samples/rose_1.5.0.svga diff --git a/SVGAPlayer/Samples/rose_2.0.0.svga b/SVGAPlayerDemo/Samples/rose_2.0.0.svga similarity index 100% rename from SVGAPlayer/Samples/rose_2.0.0.svga rename to SVGAPlayerDemo/Samples/rose_2.0.0.svga diff --git a/SVGAPlayer/ViewController.h b/SVGAPlayerDemo/ViewController.h similarity index 100% rename from SVGAPlayer/ViewController.h rename to SVGAPlayerDemo/ViewController.h diff --git a/SVGAPlayer/ViewController.m b/SVGAPlayerDemo/ViewController.m similarity index 97% rename from SVGAPlayer/ViewController.m rename to SVGAPlayerDemo/ViewController.m index 97e52729..87cf2542 100644 --- a/SVGAPlayer/ViewController.m +++ b/SVGAPlayerDemo/ViewController.m @@ -7,7 +7,7 @@ // #import "ViewController.h" -#import "SVGA.h" +#import "SVGAPlayer.h" @interface ViewController () @@ -20,13 +20,19 @@ @interface ViewController () @implementation ViewController static SVGAParser *parser; ++ (void)initialize { + [[SVGA shared] setEnableDebug: YES]; +} - (void)viewDidLoad { [super viewDidLoad]; + + self.aPlayer.delegate = self; self.aPlayer.loops = 1; self.aPlayer.clearsAfterStop = YES; parser = [[SVGAParser alloc] init]; +// parser.targetSize = CGSizeMake(375, 375); [self onChange:nil]; } diff --git a/SVGAPlayer/main.m b/SVGAPlayerDemo/main.m similarity index 100% rename from SVGAPlayer/main.m rename to SVGAPlayerDemo/main.m diff --git a/Source/DebugInfoView.h b/Source/DebugInfoView.h new file mode 100644 index 00000000..1e0e3f12 --- /dev/null +++ b/Source/DebugInfoView.h @@ -0,0 +1,20 @@ +// +// DebugInfoView.h +// SVGAPlayer +// +// Created by smartzou on 2025/1/4. +// Copyright © 2025 UED Center. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface DebugInfoView : UIView +@property (nonatomic, strong) UITextView *textView; + +- (instancetype)initWithFrame:(CGRect)frame; +- (void)updateWithText:(NSString *)text; +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/DebugInfoView.m b/Source/DebugInfoView.m new file mode 100644 index 00000000..44b2c822 --- /dev/null +++ b/Source/DebugInfoView.m @@ -0,0 +1,58 @@ +// +// DebugInfoView.m +// SVGAPlayer +// +// Created by smartzou on 2025/1/4. +// Copyright © 2025 UED Center. All rights reserved. +// + +#import "DebugInfoView.h" +#import + +@implementation DebugInfoView + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + // 设置视图背景颜色 + self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.6]; + + // 初始化 UITextView + _textView = [[UITextView alloc] init]; + _textView.textColor = [UIColor whiteColor]; + _textView.backgroundColor = [UIColor clearColor]; // 背景透明 + _textView.editable = NO; // 禁止编辑 + _textView.scrollEnabled = NO; // 自动调整大小时禁用滚动 + _textView.textAlignment = NSTextAlignmentLeft; + _textView.translatesAutoresizingMaskIntoConstraints = NO; + + // 添加 UITextView 到视图中 + [self addSubview:_textView]; + + // 设置 UITextView 的约束 + [self setupConstraints]; + } + return self; +} + +- (void)setupConstraints { + // 将 UITextView 在父视图中居中 + [NSLayoutConstraint activateConstraints:@[ + [_textView.centerXAnchor constraintEqualToAnchor:self.centerXAnchor], + [_textView.centerYAnchor constraintEqualToAnchor:self.centerYAnchor], + [_textView.leadingAnchor constraintGreaterThanOrEqualToAnchor:self.leadingAnchor constant:10], + [_textView.trailingAnchor constraintLessThanOrEqualToAnchor:self.trailingAnchor constant:-10] + ]]; +} + +- (void)updateWithText:(NSString *)text { + // 更新 UITextView 的文本内容 + self.textView.text = text; + + // 调整 UITextView 的大小以适应文本 + CGSize textSize = [self.textView sizeThatFits:CGSizeMake(self.bounds.size.width - 20, CGFLOAT_MAX)]; + self.textView.bounds = CGRectMake(0, 0, textSize.width, textSize.height); +} + +@end + diff --git a/Source/SVGA.h b/Source/SVGA.h index 118ff4fd..3b5dcd71 100644 --- a/Source/SVGA.h +++ b/Source/SVGA.h @@ -7,12 +7,20 @@ // #import -#import "SVGAParser.h" -#import "SVGAPlayer.h" -#import "SVGAImageView.h" -#import "SVGAVideoEntity.h" -#import "SVGAExporter.h" +//#import "SVGAParser.h" +//#import "SVGAPlayer.h" +//#import "SVGAImageView.h" +//#import "SVGAVideoEntity.h" +//#import "SVGAExporter.h" -@interface SVGA : NSObject +//#import +//#import +//#import +//#import +//#import +@interface SVGA : NSObject ++ (SVGA *)shared; +- (void)setEnableDebug:(BOOL)enableDebug; +- (BOOL)enableDebug; @end diff --git a/Source/SVGA.m b/Source/SVGA.m index d9e4ef35..ca4e94b4 100644 --- a/Source/SVGA.m +++ b/Source/SVGA.m @@ -8,6 +8,28 @@ #import "SVGA.h" +@interface SVGA () +@property (nonatomic,assign) BOOL deubg; +@end + + @implementation SVGA ++ (SVGA *)shared { + static SVGA *sharedInstance = nil; + static dispatch_once_t onceToken; // onceToken = 0 + dispatch_once(&onceToken, ^{ + sharedInstance = [[SVGA alloc] init]; + }); + + return sharedInstance; +} + +- (void)setEnableDebug:(BOOL)enableDebug { + _deubg = enableDebug; +} + +- (BOOL)enableDebug { + return _deubg; +} @end diff --git a/Source/SVGAImageView.h b/Source/SVGAImageView.h index adfd650f..90905c44 100644 --- a/Source/SVGAImageView.h +++ b/Source/SVGAImageView.h @@ -6,8 +6,7 @@ // Copyright © 2017年 UED Center. All rights reserved. // -#import "SVGAPlayer.h" - +#import @interface SVGAImageView : SVGAPlayer @property (nonatomic, assign) IBInspectable BOOL autoPlay; diff --git a/Source/SVGAParser.h b/Source/SVGAParser.h index 91ea6726..a7d39683 100644 --- a/Source/SVGAParser.h +++ b/Source/SVGAParser.h @@ -13,6 +13,7 @@ @interface SVGAParser : NSObject @property (nonatomic, assign) BOOL enabledMemoryCache; +@property (nonatomic, assign) CGSize targetSize; - (void)parseWithURL:(nonnull NSURL *)URL completionBlock:(void ( ^ _Nonnull )(SVGAVideoEntity * _Nullable videoItem))completionBlock diff --git a/Source/SVGAParser.m b/Source/SVGAParser.m index af7b07da..c321d0d2 100644 --- a/Source/SVGAParser.m +++ b/Source/SVGAParser.m @@ -131,6 +131,7 @@ - (void)parseWithCacheKey:(nonnull NSString *)cacheKey SVGAProtoMovieEntity *protoObject = [SVGAProtoMovieEntity parseFromData:protoData error:&err]; if (!err && [protoObject isKindOfClass:[SVGAProtoMovieEntity class]]) { SVGAVideoEntity *videoItem = [[SVGAVideoEntity alloc] initWithProtoObject:protoObject cacheDir:cacheDir]; + videoItem.targetSize = self.targetSize; [videoItem resetImagesWithProtoObject:protoObject]; [videoItem resetSpritesWithProtoObject:protoObject]; [videoItem resetAudiosWithProtoObject:protoObject]; @@ -160,6 +161,7 @@ - (void)parseWithCacheKey:(nonnull NSString *)cacheKey NSDictionary *JSONObject = [NSJSONSerialization JSONObjectWithData:JSONData options:kNilOptions error:&err]; if ([JSONObject isKindOfClass:[NSDictionary class]]) { SVGAVideoEntity *videoItem = [[SVGAVideoEntity alloc] initWithJSONObject:JSONObject cacheDir:cacheDir]; + videoItem.targetSize = self.targetSize; [videoItem resetImagesWithJSONObject:JSONObject]; [videoItem resetSpritesWithJSONObject:JSONObject]; if (self.enabledMemoryCache) { @@ -222,6 +224,7 @@ - (void)parseWithData:(nonnull NSData *)data SVGAProtoMovieEntity *protoObject = [SVGAProtoMovieEntity parseFromData:inflateData error:&err]; if (!err && [protoObject isKindOfClass:[SVGAProtoMovieEntity class]]) { SVGAVideoEntity *videoItem = [[SVGAVideoEntity alloc] initWithProtoObject:protoObject cacheDir:@""]; + videoItem.targetSize = self.targetSize; [videoItem resetImagesWithProtoObject:protoObject]; [videoItem resetSpritesWithProtoObject:protoObject]; [videoItem resetAudiosWithProtoObject:protoObject]; @@ -280,6 +283,7 @@ - (void)parseWithData:(nonnull NSData *)data SVGAProtoMovieEntity *protoObject = [SVGAProtoMovieEntity parseFromData:protoData error:&err]; if (!err) { SVGAVideoEntity *videoItem = [[SVGAVideoEntity alloc] initWithProtoObject:protoObject cacheDir:cacheDir]; + videoItem.targetSize = self.targetSize; [videoItem resetImagesWithProtoObject:protoObject]; [videoItem resetSpritesWithProtoObject:protoObject]; if (self.enabledMemoryCache) { @@ -308,6 +312,7 @@ - (void)parseWithData:(nonnull NSData *)data NSDictionary *JSONObject = [NSJSONSerialization JSONObjectWithData:JSONData options:kNilOptions error:&err]; if ([JSONObject isKindOfClass:[NSDictionary class]]) { SVGAVideoEntity *videoItem = [[SVGAVideoEntity alloc] initWithJSONObject:JSONObject cacheDir:cacheDir]; + videoItem.targetSize = self.targetSize; [videoItem resetImagesWithJSONObject:JSONObject]; [videoItem resetSpritesWithJSONObject:JSONObject]; if (self.enabledMemoryCache) { diff --git a/Source/SVGAPlayer+public.h b/Source/SVGAPlayer+public.h new file mode 100644 index 00000000..21a372ac --- /dev/null +++ b/Source/SVGAPlayer+public.h @@ -0,0 +1,55 @@ +// +// SVGAPlayer 2.h +// SVGAPlayer +// +// Created by smartzou on 2025/1/6. +// Copyright © 2025 UED Center. All rights reserved. +// + +#import +@class SVGAVideoEntity, SVGAPlayer; + +@protocol SVGAPlayerDelegate + +@optional +- (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player ; + +- (void)svgaPlayer:(SVGAPlayer *)player didAnimatedToFrame:(NSInteger)frame; +- (void)svgaPlayer:(SVGAPlayer *)player didAnimatedToPercentage:(CGFloat)percentage; + +- (void)svgaPlayerDidAnimatedToFrame:(NSInteger)frame API_DEPRECATED("Use svgaPlayer:didAnimatedToFrame: instead", ios(7.0, API_TO_BE_DEPRECATED)); +- (void)svgaPlayerDidAnimatedToPercentage:(CGFloat)percentage API_DEPRECATED("Use svgaPlayer:didAnimatedToPercentage: instead", ios(7.0, API_TO_BE_DEPRECATED)); + +@end + +typedef void(^SVGAPlayerDynamicDrawingBlock)(CALayer *contentLayer, NSInteger frameIndex); + +@interface SVGAPlayer : UIView + +@property (nonatomic, weak) id delegate; +@property (nonatomic, strong) SVGAVideoEntity *videoItem; +@property (nonatomic, assign) IBInspectable int loops; +@property (nonatomic, assign) IBInspectable BOOL clearsAfterStop; +@property (nonatomic, copy) NSString *fillMode; +@property (nonatomic, copy) NSRunLoopMode mainRunLoopMode; +@property (nonatomic, assign) BOOL mute; + +- (void)startAnimation; +- (void)startAnimationWithRange:(NSRange)range reverse:(BOOL)reverse; +- (void)pauseAnimation; +- (void)stopAnimation; +- (void)clear; +- (void)stepToFrame:(NSInteger)frame andPlay:(BOOL)andPlay; +- (void)stepToPercentage:(CGFloat)percentage andPlay:(BOOL)andPlay; + +#pragma mark - Dynamic Object + +- (void)setImage:(UIImage *)image forKey:(NSString *)aKey; +- (void)setImageWithURL:(NSURL *)URL forKey:(NSString *)aKey; +- (void)setImage:(UIImage *)image forKey:(NSString *)aKey referenceLayer:(CALayer *)referenceLayer; // deprecated from 2.0.1 +- (void)setAttributedText:(NSAttributedString *)attributedText forKey:(NSString *)aKey; +- (void)setDrawingBlock:(SVGAPlayerDynamicDrawingBlock)drawingBlock forKey:(NSString *)aKey; +- (void)setHidden:(BOOL)hidden forKey:(NSString *)aKey; +- (void)clearDynamicObjects; + +@end diff --git a/Source/SVGAPlayer.h b/Source/SVGAPlayer.h index cdeb8ccf..4ac3eb2a 100644 --- a/Source/SVGAPlayer.h +++ b/Source/SVGAPlayer.h @@ -6,50 +6,21 @@ // Copyright © 2016年 UED Center. All rights reserved. // -#import +#import -@class SVGAVideoEntity, SVGAPlayer; -@protocol SVGAPlayerDelegate -@optional -- (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player ; +//! Project version number for SVGAPlayer. +FOUNDATION_EXPORT double SVGAPlayerVersionNumber; -- (void)svgaPlayer:(SVGAPlayer *)player didAnimatedToFrame:(NSInteger)frame; -- (void)svgaPlayer:(SVGAPlayer *)player didAnimatedToPercentage:(CGFloat)percentage; +//! Project version string for SVGAPlayer. +FOUNDATION_EXPORT const unsigned char SVGAPlayerVersionString[]; -- (void)svgaPlayerDidAnimatedToFrame:(NSInteger)frame API_DEPRECATED("Use svgaPlayer:didAnimatedToFrame: instead", ios(7.0, API_TO_BE_DEPRECATED)); -- (void)svgaPlayerDidAnimatedToPercentage:(CGFloat)percentage API_DEPRECATED("Use svgaPlayer:didAnimatedToPercentage: instead", ios(7.0, API_TO_BE_DEPRECATED)); +// In this header, you should import all the public headers of your framework using statements like #import -@end - -typedef void(^SVGAPlayerDynamicDrawingBlock)(CALayer *contentLayer, NSInteger frameIndex); - -@interface SVGAPlayer : UIView - -@property (nonatomic, weak) id delegate; -@property (nonatomic, strong) SVGAVideoEntity *videoItem; -@property (nonatomic, assign) IBInspectable int loops; -@property (nonatomic, assign) IBInspectable BOOL clearsAfterStop; -@property (nonatomic, copy) NSString *fillMode; -@property (nonatomic, copy) NSRunLoopMode mainRunLoopMode; - -- (void)startAnimation; -- (void)startAnimationWithRange:(NSRange)range reverse:(BOOL)reverse; -- (void)pauseAnimation; -- (void)stopAnimation; -- (void)clear; -- (void)stepToFrame:(NSInteger)frame andPlay:(BOOL)andPlay; -- (void)stepToPercentage:(CGFloat)percentage andPlay:(BOOL)andPlay; - -#pragma mark - Dynamic Object - -- (void)setImage:(UIImage *)image forKey:(NSString *)aKey; -- (void)setImageWithURL:(NSURL *)URL forKey:(NSString *)aKey; -- (void)setImage:(UIImage *)image forKey:(NSString *)aKey referenceLayer:(CALayer *)referenceLayer; // deprecated from 2.0.1 -- (void)setAttributedText:(NSAttributedString *)attributedText forKey:(NSString *)aKey; -- (void)setDrawingBlock:(SVGAPlayerDynamicDrawingBlock)drawingBlock forKey:(NSString *)aKey; -- (void)setHidden:(BOOL)hidden forKey:(NSString *)aKey; -- (void)clearDynamicObjects; - -@end +#import +#import +#import +#import +#import +#import diff --git a/Source/SVGAPlayer.m b/Source/SVGAPlayer.m index 289e09f0..7517fce8 100644 --- a/Source/SVGAPlayer.m +++ b/Source/SVGAPlayer.m @@ -6,7 +6,7 @@ // Copyright © 2016年 UED Center. All rights reserved. // -#import "SVGAPlayer.h" +#import "SVGAPlayer+public.h" #import "SVGAVideoEntity.h" #import "SVGAVideoSpriteEntity.h" #import "SVGAVideoSpriteFrameEntity.h" @@ -15,6 +15,17 @@ #import "SVGAVectorLayer.h" #import "SVGAAudioLayer.h" #import "SVGAAudioEntity.h" +#import "SVGA.h" +#import "DebugInfoView.h" +#import + +static inline void svg_dispatch_async_on_main_queue(void (^block)(void)) { + if (pthread_main_np()) { + block(); + } else { + dispatch_async(dispatch_get_main_queue(), block); + } +} @interface SVGAPlayer () @@ -31,6 +42,7 @@ @interface SVGAPlayer () @property (nonatomic, assign) NSRange currentRange; @property (nonatomic, assign) BOOL forwardAnimating; @property (nonatomic, assign) BOOL reversing; +@property (nonatomic, strong) DebugInfoView *infoView; @end @@ -60,15 +72,40 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder { - (void)initPlayer { self.contentMode = UIViewContentModeTop; self.clearsAfterStop = YES; + if ([self enableDebug]) { + _infoView = [[DebugInfoView alloc] initWithFrame:CGRectMake(0, 0, 100, 80)]; + [self addSubview:_infoView]; + } } - (void)willMoveToSuperview:(UIView *)newSuperview { [super willMoveToSuperview:newSuperview]; if (newSuperview == nil) { [self stopAnimation:YES]; +#if DEBUG + NSLog(@"willMoveToSuperview stopAnimation Clear YES"); +#endif + } +} + +- (void)willMoveToWindow:(UIWindow *)newWindow { + [super willMoveToWindow:newWindow]; + if (newWindow == nil) { + // 当前视图将从屏幕移除,停止动画 + [self pauseAnimation]; +#if DEBUG + NSLog(@"willMoveToWindow stopAnimation Clear NO"); +#endif + } else { + // 当前视图将显示在屏幕上,启动动画 + [self startAnimation]; +#if DEBUG + NSLog(@"willMoveToWindow startAnimation"); +#endif } } + - (void)startAnimation { if (self.videoItem == nil) { NSLog(@"videoItem could not be nil!"); @@ -151,6 +188,25 @@ - (void)clearAudios { } } +- (void)setAudiosVolums:(float)volume { + for (SVGAAudioLayer *layer in self.audioLayers) { + if (layer.audioPlaying) { + [layer.audioPlayer setVolume:volume]; + } + } +} + +- (void)setMute:(BOOL)mute { + if (_mute != mute) { + _mute = mute; + if (mute) { + [self setAudiosVolums:0.0]; + }else { + [self setAudiosVolums:1.0]; + } + } +} + - (void)stepToFrame:(NSInteger)frame andPlay:(BOOL)andPlay { if (self.videoItem == nil) { NSLog(@"videoItem could not be nil!"); @@ -347,6 +403,11 @@ - (void)update { for (SVGAAudioLayer *layer in self.audioLayers) { if (!layer.audioPlaying && layer.audioItem.startFrame <= self.currentFrame && self.currentFrame <= layer.audioItem.endFrame) { [layer.audioPlayer setCurrentTime:(NSTimeInterval)(layer.audioItem.startTime / 1000)]; + if (self.mute) { + [layer.audioPlayer setVolume:0.0]; + }else { + [layer.audioPlayer setVolume:1.0]; + } [layer.audioPlayer play]; layer.audioPlaying = YES; } @@ -413,10 +474,12 @@ - (void)setVideoItem:(SVGAVideoEntity *)videoItem { _reversing = NO; _currentFrame = 0; _loopCount = 0; - [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + + svg_dispatch_async_on_main_queue(^{ [self clear]; [self draw]; - }]; + [self updateInfoView]; + }); } #pragma mark - Dynamic Object @@ -442,9 +505,9 @@ - (void)setImageWithURL:(NSURL *)URL forKey:(NSString *)aKey { if (error == nil && data != nil) { UIImage *image = [UIImage imageWithData:data]; if (image != nil) { - [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + svg_dispatch_async_on_main_queue(^{ [self setImage:image forKey:aKey]; - }]; + }); } } }] resume]; @@ -555,4 +618,22 @@ - (NSRunLoopMode)mainRunLoopMode { return _mainRunLoopMode; } + +- (void)updateInfoView { + if (_videoItem != nil) { + //NSLog(@"filesize: %.1f kb , memorycost: %.1f kb",self.bytecount/1024.0,self.memoryCount/1024.0); + NSString *videoSizeInfo = [NSString stringWithFormat:@"(%.0f,%.0f)",_videoItem.videoSize.width,_videoItem.videoSize.height]; + NSString *targetSizeInfo = [NSString stringWithFormat:@"(%.0f,%.0f)",_videoItem.targetSize.width,_videoItem.targetSize.height]; + NSString *fileSize = [NSString stringWithFormat:@"%.1f kb",_videoItem.bytecount/1024.0]; + NSString *mcost = [NSString stringWithFormat:@"%.1f kb",_videoItem.memoryCount/1024.0]; + NSString *text = [NSString stringWithFormat:@"%@,%@ \n %@ \n %@",videoSizeInfo,targetSizeInfo,fileSize,mcost]; + [_infoView updateWithText:text]; + [self bringSubviewToFront:_infoView]; + } + +} + +- (BOOL)enableDebug { + return [[SVGA shared] enableDebug]; +} @end diff --git a/Source/SVGAVideoEntity.h b/Source/SVGAVideoEntity.h index 77498206..7ab42b31 100644 --- a/Source/SVGAVideoEntity.h +++ b/Source/SVGAVideoEntity.h @@ -21,6 +21,9 @@ @property (nonatomic, readonly) NSDictionary *audiosData; @property (nonatomic, readonly) NSArray *sprites; @property (nonatomic, readonly) NSArray *audios; +@property (nonatomic, assign) CGSize targetSize; +@property (nonatomic,readonly) NSInteger bytecount; +@property (nonatomic,readonly) NSInteger memoryCount; - (instancetype)initWithJSONObject:(NSDictionary *)JSONObject cacheDir:(NSString *)cacheDir; - (void)resetImagesWithJSONObject:(NSDictionary *)JSONObject; diff --git a/Source/SVGAVideoEntity.m b/Source/SVGAVideoEntity.m index cd63400a..f99ec05a 100644 --- a/Source/SVGAVideoEntity.m +++ b/Source/SVGAVideoEntity.m @@ -12,7 +12,8 @@ #import "SVGAVideoSpriteEntity.h" #import "SVGAAudioEntity.h" #import "Svga.pbobjc.h" - +#import "UIImage+Resize.h" +#import "SVGA.h" #define MP3_MAGIC_NUMBER "ID3" @interface SVGAVideoEntity () @@ -25,11 +26,26 @@ @interface SVGAVideoEntity () @property (nonatomic, copy) NSArray *sprites; @property (nonatomic, copy) NSArray *audios; @property (nonatomic, copy) NSString *cacheDir; - +@property (nonatomic,assign) NSInteger bytecount; +@property (nonatomic,assign) NSInteger memoryCount; @end @implementation SVGAVideoEntity +static inline UIImage *SVGAImageDecodeAndScaleDownUIKit(UIImage *image, CGSize destResolution) { + // See: https://developer.apple.com/documentation/uikit/uiimage/3750835-imagebypreparingthumbnailofsize + // Need CGImage-based + if (@available(iOS 15, tvOS 15, *)) { + // Calculate thumbnail point size + CGSize thumbnailSize = CGSizeMake(destResolution.width, destResolution.height); + UIImage *decodedImage = [image imageByPreparingThumbnailOfSize:thumbnailSize]; + if (decodedImage) { + return decodedImage; + } + } + return nil; +} + static NSCache *videoCache; static NSMapTable * weakCache; static dispatch_semaphore_t videoSemaphore; @@ -93,9 +109,15 @@ - (void)resetImagesWithJSONObject:(NSDictionary *)JSONObject { NSData *imageData = [NSData dataWithContentsOfFile:filePath options:NSDataReadingMappedIfSafe error:NULL]; if (imageData != nil) { UIImage *image = [[UIImage alloc] initWithData:imageData scale:2.0]; - if (image != nil) { - [images setObject:image forKey:[key stringByDeletingPathExtension]]; + UIImage *scaledImage = [self resizeImageIfNeed:image]; + if (scaledImage != nil) { + [images setObject:scaledImage forKey:[key stringByDeletingPathExtension]]; + } + if (self.enableDebug) { + self.memoryCount += [scaledImage costForImage]; + self.bytecount += imageData.length; } + } } }]; @@ -135,6 +157,7 @@ - (instancetype)initWithProtoObject:(SVGAProtoMovieEntity *)protoObject cacheDir - (void)resetMovieWithProtoObject:(SVGAProtoMovieEntity *)protoObject { if (protoObject.hasParams) { self.videoSize = CGSizeMake((CGFloat)protoObject.params.viewBoxWidth, (CGFloat)protoObject.params.viewBoxHeight); + NSLog(@"videosize: %.1f, %.1f",_videoSize.width,_videoSize.height); self.FPS = (int)protoObject.params.fps; self.frames = (int)protoObject.params.frames; } @@ -148,10 +171,14 @@ + (BOOL)isMP3Data:(NSData *)data { return result; } + + - (void)resetImagesWithProtoObject:(SVGAProtoMovieEntity *)protoObject { NSMutableDictionary *images = [[NSMutableDictionary alloc] init]; NSMutableDictionary *audiosData = [[NSMutableDictionary alloc] init]; NSDictionary *protoImages = [protoObject.images copy]; + self.bytecount = 0; + self.memoryCount = 0; for (NSString *key in protoImages) { NSString *fileName = [[NSString alloc] initWithData:protoImages[key] encoding:NSUTF8StringEncoding]; if (fileName != nil) { @@ -175,17 +202,30 @@ - (void)resetImagesWithProtoObject:(SVGAProtoMovieEntity *)protoObject { // mp3 [audiosData setObject:protoImages[key] forKey:key]; } else { - UIImage *image = [[UIImage alloc] initWithData:protoImages[key] scale:2.0]; - if (image != nil) { - [images setObject:image forKey:key]; + NSData *data = protoImages[key]; + UIImage *image = [[UIImage alloc] initWithData:data scale:2.0]; + UIImage *scaledImage = [self resizeImageIfNeed:image]; + if (scaledImage != nil) { + + [images setObject:scaledImage forKey:key]; + + + } + if (self.enableDebug) { + self.memoryCount += [scaledImage costForImage]; + self.bytecount += data.length; } } } } self.images = images; self.audiosData = audiosData; + if (self.enableDebug) { + NSLog(@"SVGA filesize: %.1f kb , memorycost: %.1f kb", self.bytecount / 1024.0, self.memoryCount / 1024.0); + } } + - (void)resetSpritesWithProtoObject:(SVGAProtoMovieEntity *)protoObject { NSMutableArray *sprites = [[NSMutableArray alloc] init]; NSArray *protoSprites = [protoObject.spritesArray copy]; @@ -233,6 +273,26 @@ - (void)saveWeakCache:(NSString *)cacheKey { dispatch_semaphore_signal(videoSemaphore); } + + +- (UIImage *)resizeImageIfNeed:(UIImage *)image { + UIImage *scaledImage; + if ((self.targetSize.width > 0 && self.targetSize.height > 0) && (self.targetSize.width < image.size.width && self.targetSize.height < image.size.height)) { + scaledImage = SVGAImageDecodeAndScaleDownUIKit(image,self.targetSize); + if (!scaledImage) { + // fill + scaledImage = [image scaleToFillSize:self.targetSize mode:0 scale:image.scale?:2]; + } + }else { + scaledImage = image; + } + return scaledImage; +} + +- (BOOL)enableDebug { + return [[SVGA shared] enableDebug]; +} + @end @interface SVGAVideoSpriteEntity() diff --git a/Source/UIImage+Resize.h b/Source/UIImage+Resize.h new file mode 100644 index 00000000..43be438d --- /dev/null +++ b/Source/UIImage+Resize.h @@ -0,0 +1,18 @@ +// +// UIImage+Resize.h +// SVGAPlayer +// +// Created by smartzou on 2025/1/3. +// Copyright © 2025 UED Center. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIImage (Resize) +- (NSUInteger)costForImage; +- (UIImage *)scaleToFillSize:(CGSize)size mode:(NSInteger)mode scale:(CGFloat)scale; +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/UIImage+Resize.m b/Source/UIImage+Resize.m new file mode 100644 index 00000000..9f6adbed --- /dev/null +++ b/Source/UIImage+Resize.m @@ -0,0 +1,88 @@ +// +// UIImage+Resize.m +// SVGAPlayer +// +// Created by smartzou on 2025/1/3. +// Copyright © 2025 UED Center. All rights reserved. +// + +#import "UIImage+Resize.h" + +@implementation UIImage (Resize) + +- (NSUInteger)costForImage { + CGImageRef imageRef = self.CGImage; + if (!imageRef) { + return 0; + } + NSUInteger bytesPerFrame = CGImageGetBytesPerRow(imageRef) * CGImageGetHeight(imageRef); + NSUInteger frameCount = self.images.count > 0 ? self.images.count : 1; + return bytesPerFrame * frameCount; +} + +- (UIImage *)scaleToFillSize:(CGSize)size mode:(NSInteger)mode scale:(CGFloat)scale { + if (CGSizeEqualToSize(self.size, size)) { + return self; + } + + CGRect rect; + CGSize rendererSize; + + if (mode == 0) { // Assuming 0 is for .fill + BOOL isEqualRatio = (size.width / size.height) == (self.size.width / self.size.height); + if (isEqualRatio) { + rendererSize = size; + rect = CGRectMake(0, 0, size.width, size.height); + } else { + CGFloat scale = size.width / self.size.width; + CGFloat scaleHeight = scale * self.size.height; + CGFloat scaleWidth = size.width; + if (scaleHeight < size.height) { + scaleWidth = size.height / scaleHeight * size.width; + scaleHeight = size.height; + } + rendererSize = CGSizeMake(scaleWidth, scaleHeight); + rect = CGRectMake(0, 0, rendererSize.width, rendererSize.height); + } + } else { + rendererSize = size; + if (mode == 1) { // Assuming 1 is for .fit + rect = CGRectMake(0, 0, size.width, size.height); + } else { + CGFloat scale = size.width / self.size.width; + CGFloat scaleHeight = scale * self.size.height; + if (scaleHeight < size.height) { + scaleHeight = size.height; + } + rect = CGRectMake(0, -(scaleHeight - size.height) / 2, size.width, scaleHeight); + } + } + + UIGraphicsImageRendererFormat *format = [UIGraphicsImageRendererFormat defaultFormat]; + BOOL hasAlpha = [self CGImageContainsAlpha]; + format.opaque = !hasAlpha; + format.scale = scale == 0 ? self.scale : scale; + + UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:rendererSize format:format]; + UIImage *image = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull context) { + [self drawInRect:rect]; + }]; + + return image; +} + +- (BOOL)CGImageContainsAlpha { + if (!self.CGImage) { + return NO; + } + CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(self.CGImage); + BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone || + alphaInfo == kCGImageAlphaNoneSkipFirst || + alphaInfo == kCGImageAlphaNoneSkipLast); + return hasAlpha; +} + + + + +@end diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..ea4d1a26 --- /dev/null +++ b/build.sh @@ -0,0 +1,29 @@ +rm -rf build + +#For iOS Device +xcodebuild clean archive \ +-workspace "SVGAPlayer.xcworkspace" \ +-scheme SVGAPlayer \ +-sdk iphoneos \ +-configuration Release \ +-destination 'generic/platform=iOS' \ +-archivePath './build/SVGAPlayer.framework-iphoneos.xcarchive' \ +SKIP_INSTALL=NO \ +BUILD_LIBRARIES_FOR_DISTRIBUTION=YES + + +xcodebuild clean archive \ +-workspace "SVGAPlayer.xcworkspace" \ +-scheme SVGAPlayer \ +-sdk iphoneos \ +-configuration Release \ +-destination 'generic/platform=iOS Simulator' \ +-archivePath './build/SVGAPlayer.framework-iphonesimulator.xcarchive' \ +SKIP_INSTALL=NO \ +BUILD_LIBRARIES_FOR_DISTRIBUTION=YES + + +xcodebuild -create-xcframework \ +-framework './build/SVGAPlayer.framework-iphonesimulator.xcarchive/Products/Library/Frameworks/SVGAPlayer.framework' \ +-framework './build/SVGAPlayer.framework-iphoneos.xcarchive/Products/Library/Frameworks/SVGAPlayer.framework' \ +-output './build/SVGAPlayer.xcframework'