Skip to content
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

macOS: Add texture support #122

Merged

Conversation

jnschulze
Copy link
Collaborator

[WIP] This PR adds macOS texture support.

The color components are mixed up as RGBA is not supported.

Screenshot 2021-08-21 at 13 57 11

In order to make this work correctly, a few things need to be fixed in the common layer (I will take care of that):

  • The pixel format must be configurable by the plugin.
  • The pixel buffer VLC writes to shouldn't be owned by the player but by the respective plugin. The reason is that otherwise an unnecessary memcpy operation will be required on macOS in order to turn the raw pixel buffer into a CVPixelBuffer.
  • The Player implementation doesn't currently support choosing other VLC rendering backends like libvlc_video_engine_d3d11 (which will be required on Windows later on in order to support GPUSurfaceTextures). So there needs to be more flexibility in the rendering part of the Player in general.
  • The platform-specific VideoOutlets should be owned by the player which will allow the macOS and Windows plugins to get rid of the outlet map.

@jnschulze jnschulze linked an issue Aug 21, 2021 that may be closed by this pull request
5 tasks
@alexmercerind
Copy link
Owner

alexmercerind commented Aug 25, 2021

Should we just hardcode "RV32" here for some macOS specific macro (#ifdef)?

I believe no guy ever will want to change the video format. Still upto you, if you want to do this.

vlc_media_player_.setVideoFormat("RGBA", video_width, video_height,

strcpy(chroma, "RGBA");

@jnschulze
Copy link
Collaborator Author

Should we just hardcode "RV32" here for some macOS specific macro (#ifdef)?

I believe no guy ever will want to change the video format. Still upto you, if you want to do this.

vlc_media_player_.setVideoFormat("RGBA", video_width, video_height,

strcpy(chroma, "RGBA");

Yes, this should be fine as a quick fix.

Btw., this strcpy causes a warning for me. Just use memcpy(chroma, "RGBA", 4) instead.

(In general, I'd like to decouple video output from the player and abstract it in a way that the platform-specific plugin can create the most suitable output itself. I Started working on that on Monday.)

@alexmercerind alexmercerind mentioned this pull request Sep 7, 2021
@alexmercerind alexmercerind merged commit 5fcc2f0 into alexmercerind:master Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use texture registrar APIs on iOS, Linux & Mac.
2 participants