From a1f8ba106a5afe59cc72400a4054c80d3d431d1a Mon Sep 17 00:00:00 2001 From: wenchuanjun Date: Sun, 23 Apr 2023 16:01:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SVGAVideoEntity.h | 4 ++++ Source/SVGAVideoEntity.m | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/Source/SVGAVideoEntity.h b/Source/SVGAVideoEntity.h index 77498206..81329645 100644 --- a/Source/SVGAVideoEntity.h +++ b/Source/SVGAVideoEntity.h @@ -36,6 +36,10 @@ - (void)saveCache:(NSString *)cacheKey; // NSMapTable弱缓存 - (void)saveWeakCache:(NSString *)cacheKey; +/// 清除缓存 ++ (void)clearCache:(NSString *)cacheKey; +/// 清除所有缓存 ++ (void)clearAllCache; @end diff --git a/Source/SVGAVideoEntity.m b/Source/SVGAVideoEntity.m index cd63400a..1cb68586 100644 --- a/Source/SVGAVideoEntity.m +++ b/Source/SVGAVideoEntity.m @@ -233,6 +233,16 @@ - (void)saveWeakCache:(NSString *)cacheKey { dispatch_semaphore_signal(videoSemaphore); } ++ (void)clearCache:(NSString *)cacheKey{ + dispatch_semaphore_wait(videoSemaphore, DISPATCH_TIME_FOREVER); + [videoCache removeObjectForKey:cacheKey]; + dispatch_semaphore_signal(videoSemaphore); +} + ++ (void)clearAllCache{ + [videoCache removeAllObjects]; +} + @end @interface SVGAVideoSpriteEntity() From 173e78ea7ec618e58b6ed8ceb053cdffdc61fa84 Mon Sep 17 00:00:00 2001 From: wenchuanjun Date: Wed, 17 May 2023 14:45:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=8C=87=E5=AE=9AProtobuf=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SVGAPlayer.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SVGAPlayer.podspec b/SVGAPlayer.podspec index 3753c367..38e50349 100644 --- a/SVGAPlayer.podspec +++ b/SVGAPlayer.podspec @@ -25,7 +25,7 @@ Pod::Spec.new do |s| s.subspec 'ProtoFiles' do |ss| ss.source_files = "Source/pbobjc/*.{h,m}" ss.requires_arc = false - ss.dependency 'Protobuf', '~> 3.4' + ss.dependency 'Protobuf', '~> 3.22.1' ss.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1', } From 3d5a2fa5e7c393ff4e998b7ea664dfd4bc5f2145 Mon Sep 17 00:00:00 2001 From: wenchuanjun Date: Sun, 25 Jun 2023 18:04:23 +0800 Subject: [PATCH 3/3] test --- Source/SVGAPlayer.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/SVGAPlayer.m b/Source/SVGAPlayer.m index 289e09f0..60f38024 100644 --- a/Source/SVGAPlayer.m +++ b/Source/SVGAPlayer.m @@ -400,6 +400,7 @@ - (void)next { if (self.videoItem.frames > 0) { if ([delegate respondsToSelector:@selector(svgaPlayer:didAnimatedToPercentage:)]) { [delegate svgaPlayer:self didAnimatedToPercentage:(CGFloat)(self.currentFrame + 1) / (CGFloat)self.videoItem.frames]; + } else if ([delegate respondsToSelector:@selector(svgaPlayerDidAnimatedToPercentage:)]) { [delegate svgaPlayerDidAnimatedToPercentage:(CGFloat)(self.currentFrame + 1) / (CGFloat)self.videoItem.frames]; }