Skip to content

Commit

Permalink
Move xdpw_format_pw_from_wl_shm to screencast_scp_shm.c
Browse files Browse the repository at this point in the history
  • Loading branch information
columbarius committed Sep 3, 2020
1 parent 0a77273 commit 4a9e576
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/screencast/screencast_scp_shm.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "screencast_scp_shm.h"

enum spa_video_format xdpw_format_pw_from_wl_shm(
struct xdpw_frame_scp_shm *frame) {
switch (frame->format) {
case WL_SHM_FORMAT_ARGB8888:
return SPA_VIDEO_FORMAT_BGRA;
case WL_SHM_FORMAT_XRGB8888:
return SPA_VIDEO_FORMAT_BGRx;
case WL_SHM_FORMAT_RGBA8888:
return SPA_VIDEO_FORMAT_ABGR;
case WL_SHM_FORMAT_RGBX8888:
return SPA_VIDEO_FORMAT_xBGR;
case WL_SHM_FORMAT_ABGR8888:
return SPA_VIDEO_FORMAT_RGBA;
case WL_SHM_FORMAT_XBGR8888:
return SPA_VIDEO_FORMAT_RGBx;
case WL_SHM_FORMAT_BGRA8888:
return SPA_VIDEO_FORMAT_ARGB;
case WL_SHM_FORMAT_BGRX8888:
return SPA_VIDEO_FORMAT_xRGB;
case WL_SHM_FORMAT_NV12:
return SPA_VIDEO_FORMAT_NV12;
default:
abort();
}
}


0 comments on commit 4a9e576

Please sign in to comment.