diff --git a/include/screencast_common.h b/include/screencast_common.h index ea40d40..0724bd1 100644 --- a/include/screencast_common.h +++ b/include/screencast_common.h @@ -59,7 +59,6 @@ struct xdpw_screencast_context { // cli options const char *output_name; - const char *forced_pixelformat; // sessions struct wl_list screencast_instances; diff --git a/include/xdpw.h b/include/xdpw.h index 52aa9cc..3dfb47a 100644 --- a/include/xdpw.h +++ b/include/xdpw.h @@ -39,8 +39,7 @@ enum { }; int xdpw_screenshot_init(struct xdpw_state *state); -int xdpw_screencast_init(struct xdpw_state *state, const char *output_name, - const char *forced_pixelformat); +int xdpw_screencast_init(struct xdpw_state *state, const char *output_name); struct xdpw_request *xdpw_request_create(sd_bus *bus, const char *object_path); void xdpw_request_destroy(struct xdpw_request *req); diff --git a/src/core/main.c b/src/core/main.c index 5783bbf..6421b17 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -23,7 +23,6 @@ int xdpw_usage(FILE* stream, int rc) { " -l, --loglevel= Select log level (default is ERROR).\n" " QUIET, ERROR, WARN, INFO, DEBUG, TRACE\n" " -o, --output= Select output to capture.\n" - " -p,--pixelformat=BGRx|RGBx Force a pixelformat in pipewire\n" " metadata (performs no conversion).\n" " -h,--help Get help (this text).\n" "\n"; @@ -34,14 +33,12 @@ int xdpw_usage(FILE* stream, int rc) { int main(int argc, char *argv[]) { const char* output_name = NULL; - const char* forced_pixelformat = NULL; enum LOGLEVEL loglevel = ERROR; static const char* shortopts = "l:o:p:h"; static const struct option longopts[] = { { "loglevel", required_argument, NULL, 'l' }, { "output", required_argument, NULL, 'o' }, - { "pixelformat", required_argument, NULL, 'p' }, { "help", no_argument, NULL, 'h' }, { NULL, 0, NULL, 0 } }; @@ -58,9 +55,6 @@ int main(int argc, char *argv[]) { case 'o': output_name = optarg; break; - case 'p': - forced_pixelformat = optarg; - break; case 'h': return xdpw_usage(stdout, 0); default: @@ -107,7 +101,7 @@ int main(int argc, char *argv[]) { wl_list_init(&state.xdpw_sessions); xdpw_screenshot_init(&state); - ret = xdpw_screencast_init(&state, output_name, forced_pixelformat); + ret = xdpw_screencast_init(&state, output_name); if (ret < 0) { logprint(ERROR, "xdpw: failed to initialize screencast"); goto error; diff --git a/src/screencast/screencast.c b/src/screencast/screencast.c index 2521c4b..8966c47 100644 --- a/src/screencast/screencast.c +++ b/src/screencast/screencast.c @@ -436,12 +436,11 @@ static const sd_bus_vtable screencast_vtable[] = { SD_BUS_VTABLE_END }; -int xdpw_screencast_init(struct xdpw_state *state, const char *output_name, const char *forced_pixelformat) { +int xdpw_screencast_init(struct xdpw_state *state, const char *output_name) { sd_bus_slot *slot = NULL; state->screencast = (struct xdpw_screencast_context) { 0 }; state->screencast.state = state; - state->screencast.forced_pixelformat = forced_pixelformat; state->screencast.output_name = output_name; int err; diff --git a/src/screencast/screencast_common.c b/src/screencast/screencast_common.c index a7162fe..f185ad7 100644 --- a/src/screencast/screencast_common.c +++ b/src/screencast/screencast_common.c @@ -14,15 +14,6 @@ void randname(char *buf) { enum spa_video_format xdpw_format_pw_from_wl_shm( struct xdpw_screencast_instance *cast) { - if (cast->ctx->forced_pixelformat) { - if (strcmp(cast->ctx->forced_pixelformat, "BGRx") == 0) { - return SPA_VIDEO_FORMAT_BGRx; - } - if (strcmp(cast->ctx->forced_pixelformat, "RGBx") == 0) { - return SPA_VIDEO_FORMAT_RGBx; - } - } - switch (cast->simple_frame.format) { case WL_SHM_FORMAT_ARGB8888: return SPA_VIDEO_FORMAT_BGRA;