screencast: don't rely on the structure of xdpw_screencast_instance to convert formats

This commit is contained in:
columbarius 2021-06-15 18:04:33 +02:00 committed by Simon Ser
parent bb24b226e4
commit 96d2789d8f
3 changed files with 4 additions and 6 deletions

View File

@ -122,8 +122,7 @@ struct xdpw_wlr_output {
};
void randname(char *buf);
enum spa_video_format xdpw_format_pw_from_wl_shm(
struct xdpw_screencast_instance *cast);
enum spa_video_format xdpw_format_pw_from_wl_shm(enum wl_shm_format format);
enum spa_video_format xdpw_format_pw_strip_alpha(enum spa_video_format format);
enum xdpw_chooser_types get_chooser_type(const char *chooser_type);

View File

@ -164,7 +164,7 @@ void xdpw_pwr_stream_create(struct xdpw_screencast_instance *cast) {
pw_loop_add_event(state->pw_loop, pwr_on_event, cast);
logprint(DEBUG, "pipewire: registered event %p", cast->event);
enum spa_video_format format = xdpw_format_pw_from_wl_shm(cast);
enum spa_video_format format = xdpw_format_pw_from_wl_shm(cast->simple_frame.format);
enum spa_video_format format_without_alpha =
xdpw_format_pw_strip_alpha(format);

View File

@ -12,9 +12,8 @@ void randname(char *buf) {
}
}
enum spa_video_format xdpw_format_pw_from_wl_shm(
struct xdpw_screencast_instance *cast) {
switch (cast->simple_frame.format) {
enum spa_video_format xdpw_format_pw_from_wl_shm(enum wl_shm_format format) {
switch (format) {
case WL_SHM_FORMAT_ARGB8888:
return SPA_VIDEO_FORMAT_BGRA;
case WL_SHM_FORMAT_XRGB8888: