summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Preisinger <alexander.preisinger@gmail.com>2014-09-03 21:30:19 +0200
committerAlexander Preisinger <alexander.preisinger@gmail.com>2014-09-03 21:35:26 +0200
commitfc68c9269d04d02d53628e75a8bc060aa7e7a5ca (patch)
treed9ab6464f1167a5fc24244942399f028b8143c66
parent8bd5df3ac110feecfd5732f3a7c4d687c63d9155 (diff)
downloadmpv-fc68c9269d04d02d53628e75a8bc060aa7e7a5ca.tar.bz2
mpv-fc68c9269d04d02d53628e75a8bc060aa7e7a5ca.tar.xz
wayland: print some useful outptu info
Prints output informations, useful for finding out if we detect the right mode and for debugging.
-rw-r--r--video/out/wayland_common.c34
-rw-r--r--video/out/wayland_common.h2
2 files changed, 21 insertions, 15 deletions
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;
};