-
Notifications
You must be signed in to change notification settings - Fork 39
Allow multiple AVPlayer instances, use TextureView instead of SurfaceView #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| // XXX: Should we just return _presentation if it already exists?? | ||
| // This seems to break animations, but why? | ||
| // if let _presentation { return _presentation } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelknoch this is kind of an open question to you I think. We don't need to answer it right now but I it did confuse me that we create a new presentation layer on every frame – is that how iOS works?
|
|
||
| let format: GPU_FormatEnum = switch channels { | ||
| case 1: GPU_FORMAT_ALPHA | ||
| case 2: GPU_FORMAT_LUMINANCE_ALPHA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelknoch FYI in theory GPU_FORMAT_LUMINANCE_ALPHA (and GPU_FORMAT_ALPHA) is not supported in OpenGLES in versions 3+. So this "should" not work on newer devices. In practice I saw that Android emulates OpenGLES2 in these cases, so it works. I don't think it's problematic, but I wanted to mention it.
I didn't immediately find a way to see if this device is running OpenGLES2 vs OpenGLES3 – if we can find that we could also fall back to using 4-channel textures in that case. But let's see if it's actually a problem first
|
|
||
| let rw = SDL_RWFromMem(ptr, Int32(buffer.count)) | ||
| return GPU_LoadImage_RW(rw, true) | ||
| #elseif os(macOS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure we need elseif os(macOS) here – it should be just "else"
| // `newValue` is the HIDDEN state, whereas we're setting the _VISIBILITY_ here: | ||
| visibility = if (!newValue) { View.VISIBLE } else { View.INVISIBLE } | ||
| // Note: there is another visibility state, `View.GONE`, which also removes the view | ||
| // from layout (similar to `display: none`), but we want to match iOS behaviour here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michaelknoch actually i'm unsure if GONE isn't a closer match to iOS behaviour. We kind of don't care about the layouting either way though because essentially our views are positioned absolutely. Either way, GONE might actually make more sense? Do you have any thoughts about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me (I hope so because I think I wrote most of it)
* enhance error recovery * add eof * fix streching of video
Type of change: feature
Motivation (current vs expected behavior)
Allow multiple AVPlayer instances, use TextureView instead of SurfaceView
Please check if the PR fulfills these requirements