From fc68c9269d04d02d53628e75a8bc060aa7e7a5ca Mon Sep 17 00:00:00 2001 From: Alexander Preisinger Date: Wed, 3 Sep 2014 21:30:19 +0200 Subject: wayland: print some useful outptu info Prints output informations, useful for finding out if we detect the right mode and for debugging. --- video/out/wayland_common.c | 34 +++++++++++++++++++--------------- video/out/wayland_common.h | 2 ++ 2 files changed, 21 insertions(+), 15 deletions(-) (limited to 'video/out') diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index ade9142cac..614f9fd770 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -153,19 +153,9 @@ static void output_handle_geometry(void *data, const char *model, int32_t transform) { - /* Ignore transforms for now */ - switch (transform) { - case WL_OUTPUT_TRANSFORM_NORMAL: - case WL_OUTPUT_TRANSFORM_90: - case WL_OUTPUT_TRANSFORM_180: - case WL_OUTPUT_TRANSFORM_270: - case WL_OUTPUT_TRANSFORM_FLIPPED: - case WL_OUTPUT_TRANSFORM_FLIPPED_90: - case WL_OUTPUT_TRANSFORM_FLIPPED_180: - case WL_OUTPUT_TRANSFORM_FLIPPED_270: - default: - break; - } + struct vo_wayland_output *output = data; + output->make = make; + output->model = model; } static void output_handle_mode(void *data, @@ -938,6 +928,22 @@ int vo_wayland_init (struct vo *vo) return false; } + // create_display's roundtrip only adds the interfaces + // the second roundtrip receives output modes, geometry and more ... + wl_display_roundtrip(wl->display.display); + + struct vo_wayland_output *o = NULL; + wl_list_for_each(o, &wl->display.output_list, link) { + MP_VERBOSE(wl, "output received:\n" + "\tvendor: %s\n" + "\tmodel: %s\n" + "\tw: %d, h: %d\n" + "\tHz: %d\n", + o->make, o->model, + o->width, o->height, + o->refresh_rate / 1000); + } + vo->event_fd = wl->display.display_fd; return true; @@ -1087,8 +1093,6 @@ static void vo_wayland_update_screeninfo(struct vo *vo, struct mp_rect *screenrc struct vo_wayland_state *wl = vo->wayland; struct mp_vo_opts *opts = vo->opts; - wl_display_roundtrip(wl->display.display); - *screenrc = (struct mp_rect){0}; int screen_id = 0; diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h index 5702372731..86af54be45 100644 --- a/video/out/wayland_common.h +++ b/video/out/wayland_common.h @@ -42,6 +42,8 @@ struct vo_wayland_output { int32_t width; int32_t height; int32_t refresh_rate; // fps (mHz) + const char *make; + const char *model; struct wl_list link; }; -- cgit v1.2.3