mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-22 14:35:57 +01:00
Remove --pixelformat flag
This hack is not needed anymore.
This commit is contained in:
parent
26b6bf69aa
commit
a7ea407e2f
5 changed files with 3 additions and 21 deletions
|
@ -59,7 +59,6 @@ struct xdpw_screencast_context {
|
|||
|
||||
// cli options
|
||||
const char *output_name;
|
||||
const char *forced_pixelformat;
|
||||
|
||||
// sessions
|
||||
struct wl_list screencast_instances;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -23,7 +23,6 @@ int xdpw_usage(FILE* stream, int rc) {
|
|||
" -l, --loglevel=<loglevel> Select log level (default is ERROR).\n"
|
||||
" QUIET, ERROR, WARN, INFO, DEBUG, TRACE\n"
|
||||
" -o, --output=<name> 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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue