Skip to content

Commit

Permalink
#42,fix real iOS device does not display picture and keeps showing a …
Browse files Browse the repository at this point in the history
…pink color
  • Loading branch information
debugly committed Aug 19, 2024
1 parent 409f9ae commit 6501969
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 47 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
tag k0.11.6
--------------------------------

- fix real iOS device does not display picture and keeps showing a pink color,#42

tag k0.11.5
--------------------------------

Expand Down
2 changes: 1 addition & 1 deletion IJKMediaPlayerKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'IJKMediaPlayerKit'
s.version = '0.11.5'
s.version = '0.11.6'
s.summary = 'IJKMediaPlayerKit for ios/macOS/tvOS.'

# This description is used to generate tags and improve search results.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ijk media player based on [ffplay](http://ffmpeg.org)
install use cocoapod:

```
pod "IJKMediaPlayerKit", :podspec => 'https://github.com/debugly/ijkplayer/releases/download/k0.11.5/IJKMediaPlayerKit.spec.json'
pod "IJKMediaPlayerKit", :podspec => 'https://github.com/debugly/ijkplayer/releases/download/k0.11.6/IJKMediaPlayerKit.spec.json'
```

## Development
Expand All @@ -66,7 +66,7 @@ how to run examples:
```
git clone https://github.com/debugly/ijkplayer.git ijkplayer
cd ijkplayer
git checkout -B latest k0.11.5
git checkout -B latest k0.11.6
git submodule update --init
./FFToolChain/main.sh install -p macos -l 'ass ffmpeg'
Expand All @@ -78,11 +78,11 @@ pod install --project-directory=./examples/ios
pod install --project-directory=./examples/tvos
# run iOS demo
open ./examples/macos/IJKMediaDemo.xcworkspace
open ./examples/ios/IJKMediaDemo.xcworkspace
# run macOS demo
open ./examples/macos/IJKMediaMacDemo.xcworkspace
# run tvOS demo
open ./examples/macos/IJKMediaTVDemo.xcworkspace
open ./examples/tvos/IJKMediaTVDemo.xcworkspace
```

if you want build your IJKMediaPlayerKit.framework, you need enter examples/{plat} folder, then exec `./build-framework.sh`
Expand Down
4 changes: 2 additions & 2 deletions android/ijkplayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ ext {

targetSdkVersion = 25

versionCode = 1100500
versionName = "0.11.5"
versionCode = 1100600
versionName = "0.11.6"
}

wrapper {
Expand Down
4 changes: 2 additions & 2 deletions android/ijkplayer/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME=0.11.5
VERSION_CODE=1100500
VERSION_NAME=0.11.6
VERSION_CODE=1100600
GROUP=tv.danmaku.ijk.media

# http://central.sonatype.org/pages/requirements.html
Expand Down
20 changes: 10 additions & 10 deletions android/ijkplayer/ijkplayer-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ dependencies {
all64Compile project(':ijkplayer-x86')
all64Compile project(':ijkplayer-x86_64')

// compile 'tv.danmaku.ijk.media:ijkplayer-java:0.11.5'
// compile 'tv.danmaku.ijk.media:ijkplayer-exo:0.11.5'
// compile 'tv.danmaku.ijk.media:ijkplayer-java:0.11.6'
// compile 'tv.danmaku.ijk.media:ijkplayer-exo:0.11.6'

// all32Compile 'tv.danmaku.ijk.media:ijkplayer-armv5:0.11.5'
// all32Compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.11.5'
// all32Compile 'tv.danmaku.ijk.media:ijkplayer-x86:0.11.5'
// all32Compile 'tv.danmaku.ijk.media:ijkplayer-armv5:0.11.6'
// all32Compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.11.6'
// all32Compile 'tv.danmaku.ijk.media:ijkplayer-x86:0.11.6'

// all64Compile 'tv.danmaku.ijk.media:ijkplayer-armv5:0.11.5'
// all64Compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.11.5'
// all64Compile 'tv.danmaku.ijk.media:ijkplayer-arm64:0.11.5'
// all64Compile 'tv.danmaku.ijk.media:ijkplayer-x86:0.11.5'
// all64Compile 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.11.5'
// all64Compile 'tv.danmaku.ijk.media:ijkplayer-armv5:0.11.6'
// all64Compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.11.6'
// all64Compile 'tv.danmaku.ijk.media:ijkplayer-arm64:0.11.6'
// all64Compile 'tv.danmaku.ijk.media:ijkplayer-x86:0.11.6'
// all64Compile 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.11.6'

// armv5Compile project(':player-armv5')
// armv7aCompile project(':player-armv7a')
Expand Down
2 changes: 1 addition & 1 deletion android/ijkplayer/ijkplayer-exo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies {
compile 'com.google.android.exoplayer:exoplayer:r1.5.11'

compile project(':ijkplayer-java')
// compile 'tv.danmaku.ijk.media:ijkplayer-java:0.11.5'
// compile 'tv.danmaku.ijk.media:ijkplayer-java:0.11.6'
}

gradle.startParameter.taskNames.each { task ->
Expand Down
4 changes: 2 additions & 2 deletions examples/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- IJKMediaPlayerKit (0.11.5)
- IJKMediaPlayerKit (0.11.6)

DEPENDENCIES:
- IJKMediaPlayerKit (from `../../`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../../"

SPEC CHECKSUMS:
IJKMediaPlayerKit: 72e9a8874564300d5f576a1889c7c750e1948f62
IJKMediaPlayerKit: 1b9d8c06af1e5251d4fe68094415b311b0733cac

PODFILE CHECKSUM: cd296d63e0523ffeac3abedb895edb14934a2d48

Expand Down
4 changes: 2 additions & 2 deletions examples/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- IJKMediaPlayerKit (0.11.5)
- IJKMediaPlayerKit (0.11.6)

DEPENDENCIES:
- IJKMediaPlayerKit (from `../../`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../../"

SPEC CHECKSUMS:
IJKMediaPlayerKit: 72e9a8874564300d5f576a1889c7c750e1948f62
IJKMediaPlayerKit: 1b9d8c06af1e5251d4fe68094415b311b0733cac

PODFILE CHECKSUM: f950a6923955cd8172bbcde59a7c414fe1a4ac71

Expand Down
4 changes: 2 additions & 2 deletions examples/tvos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- IJKMediaPlayerKit (0.11.5)
- IJKMediaPlayerKit (0.11.6)

DEPENDENCIES:
- IJKMediaPlayerKit (from `../../`)
Expand All @@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../../"

SPEC CHECKSUMS:
IJKMediaPlayerKit: 72e9a8874564300d5f576a1889c7c750e1948f62
IJKMediaPlayerKit: 1b9d8c06af1e5251d4fe68094415b311b0733cac

PODFILE CHECKSUM: 61b62f37b598e87b9117082bdf528ef9f99adafb

Expand Down
43 changes: 24 additions & 19 deletions ijkmedia/ijksdl/metal/IJKMetalView.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ @interface IJKMetalView ()
@property (atomic, strong) IJKOverlayAttach *currentAttach;
@property (assign) int hdrAnimationFrameCount;
@property (atomic, strong) NSLock *pilelineLock;
@property (assign) BOOL needCleanBackgroundColor;

@end

Expand Down Expand Up @@ -91,7 +92,7 @@ - (BOOL)prepareMetal
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidEndLiveResize:) name:NSWindowDidEndLiveResizeNotification object:nil];
#endif
//set default bg color.
[self setBackgroundColor:1.0 g:1.0 b:1.0];
[self setBackgroundColor:0 g:0 b:0];
return YES;
}

Expand Down Expand Up @@ -298,6 +299,26 @@ - (void)drawRect:(NSRect)dirtyRect
{
IJKOverlayAttach * attach = self.currentAttach;
if (attach.videoTextures.count == 0) {
if (self.needCleanBackgroundColor) {
id<CAMetalDrawable> drawable = self.currentDrawable;
if (drawable) {
id<MTLTexture> texture = drawable.texture;

MTLRenderPassDescriptor *passDescriptor = [MTLRenderPassDescriptor renderPassDescriptor];
passDescriptor.colorAttachments[0].texture = texture;
passDescriptor.colorAttachments[0].loadAction = MTLLoadActionClear;
passDescriptor.colorAttachments[0].storeAction = MTLStoreActionStore;
passDescriptor.colorAttachments[0].clearColor = self.clearColor;

id<MTLCommandBuffer> commandBuffer = [self.commandQueue commandBuffer];
id <MTLRenderCommandEncoder> commandEncoder = [commandBuffer renderCommandEncoderWithDescriptor:passDescriptor];

[commandEncoder endEncoding];
[commandBuffer presentDrawable:drawable];
[commandBuffer commit];
self.needCleanBackgroundColor = NO;
}
}
return;
}

Expand Down Expand Up @@ -652,24 +673,8 @@ - (void)setDarPreference:(IJKSDLDARPreference)darPreference
- (void)setBackgroundColor:(uint8_t)r g:(uint8_t)g b:(uint8_t)b
{
self.clearColor = (MTLClearColor){r/255.0, g/255.0, b/255.0, 1.0f};

id<CAMetalDrawable> drawable = self.currentDrawable;
if (drawable) {
id<MTLTexture> texture = drawable.texture;

MTLRenderPassDescriptor *passDescriptor = [MTLRenderPassDescriptor renderPassDescriptor];
passDescriptor.colorAttachments[0].texture = texture;
passDescriptor.colorAttachments[0].loadAction = MTLLoadActionClear;
passDescriptor.colorAttachments[0].storeAction = MTLStoreActionStore;
passDescriptor.colorAttachments[0].clearColor = self.clearColor;

id<MTLCommandBuffer> commandBuffer = [self.commandQueue commandBuffer];
id <MTLRenderCommandEncoder> commandEncoder = [commandBuffer renderCommandEncoderWithDescriptor:passDescriptor];

[commandEncoder endEncoding];
[commandBuffer presentDrawable:drawable];
[commandBuffer commit];
}
self.needCleanBackgroundColor = YES;
[self setNeedsRefreshCurrentPic];
}

- (id)context
Expand Down
4 changes: 2 additions & 2 deletions version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -e

VERSION_CODE=1100500
VERSION_NAME=0.11.5
VERSION_CODE=1100600
VERSION_NAME=0.11.6
VERSION_TARGET=$1

echo "alter version to $VERSION_NAME"
Expand Down

0 comments on commit 6501969

Please sign in to comment.