#include <assert.h>
#include <math.h>
#include <stdlib.h>
+#include <string.h>
#include <uuid.h>
#include <wtz-video-shell-server-protocol.h>
#include <Eina.h>
}
static void
+_viewport_name_init(E_Video_Viewport *viewport)
+{
+ E_Surface *parent_surface = e_subsurface_parent_get(viewport->subsurface);
+ E_Client *parent_ec = e_surface_ec_get(parent_surface);
+ char name[256];
+
+ snprintf(name, sizeof(name), "VS::Viewport(Parent 0x%08zx)", e_log_client_util_win_get(parent_ec));
+ e_surface_name_set(e_subsurface_surface_get(viewport->subsurface), name);
+}
+
+static void
_video_shell_cb_export_viewport(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *subsurface_resource)
{
E_Video_Viewport *viewport;
e_object_ref(E_OBJECT(viewport->shell));
_viewport_export_handle_generate(viewport);
+ _viewport_name_init(viewport);
VS_INF("VIEWPORT %p| Created with E_Subsurface(%p)", viewport, viewport->subsurface);
}
}
static void
+_video_surface_name_update(E_Video_Surface *surface)
+{
+ char name[256];
+ char suffix[256];
+ E_Client *ec;
+
+ if (surface->role == E_VIDEO_SURFACE_ROLE_SUBSURFACE)
+ {
+ ec = e_surface_ec_get(e_subsurface_parent_get(surface->subsurface));
+ snprintf(suffix, sizeof(suffix), "VS::Subsurface(Parent 0x%08zx)", e_log_client_util_win_get(ec));
+ }
+ else if (surface->role == E_VIDEO_SURFACE_ROLE_VIEWPORT_SOURCE)
+ {
+ if (surface->source->viewport)
+ {
+ ec = e_surface_ec_get(e_subsurface_surface_get(surface->source->viewport->subsurface));
+ snprintf(suffix, sizeof(suffix), "VS::Source(Viewport 0x%08zx)", e_log_client_util_win_get(ec));
+ }
+ else
+ {
+ snprintf(suffix, sizeof(suffix), "VS::Source(Viewport null)");
+ }
+ }
+ else
+ {
+ snprintf(suffix, sizeof(suffix), "VS::Surface");
+ }
+
+ if (surface->name)
+ {
+ snprintf(name, sizeof(name), "%s [%s]", surface->name, suffix);
+ e_surface_name_set(surface->surface, name);
+ }
+ else
+ {
+ e_surface_name_set(surface->surface, suffix);
+ }
+}
+
+static void
_video_surface_cb_source_destroy(struct wl_listener *listener, void *data)
{
E_Video_Surface *surface = wl_container_of(listener, surface, source_destroy);
wl_list_remove(&surface->source_destroy.link);
surface->source = NULL;
surface->role = E_VIDEO_SURFACE_ROLE_NONE;
+
+ _video_surface_name_update(surface);
}
static void
return;
}
+ _video_surface_name_update(surface);
+
VS_INF("SOURCE %p| Created with E_Video_Surface(%p), Viewport(%p)", source, surface, viewport);
}
surface->subsurface = NULL;
surface->role = E_VIDEO_SURFACE_ROLE_NONE;
+ _video_surface_name_update(surface);
+
// HACK
// Restore surface role to prevent it from being used as another role
e_surface_role_unset(surface->surface);
surface->role = E_VIDEO_SURFACE_ROLE_SUBSURFACE;
+ _video_surface_name_update(surface);
+
VS_INF("SURFACE %p| Subsurface(%p) created with Parent E_Surface(%p)",
surface, surface->subsurface, parent_surface);
}
free(surface->name);
surface->name = tmp;
- e_surface_name_set(surface->surface, tmp);
+ _video_surface_name_update(surface);
}
static void