short subx, short suby, unsigned short subw, unsigned short subh,
short surfx, short surfy, unsigned short surfw, unsigned short surfh)
{
+ struct pipe_video_rect src_rect = {subx, suby, subw, subh};
+ struct pipe_video_rect dst_rect = {surfx, surfy, surfw, surfh};
+
XvMCSurfacePrivate *surface_priv;
XvMCSubpicturePrivate *subpicture_priv;
subpicture_priv = subpicture->privData;
/* TODO: Assert rects are within bounds? Or clip? */
+ subpicture_priv->src_rect = src_rect;
+ subpicture_priv->dst_rect = dst_rect;
surface_priv->subpicture = subpicture;
- surface_priv->subx = subx;
- surface_priv->suby = suby;
- surface_priv->subw = subw;
- surface_priv->subh = subh;
- surface_priv->surfx = surfx;
- surface_priv->surfy = surfy;
- surface_priv->surfw = surfw;
- surface_priv->surfh = surfh;
subpicture_priv->surface = target_surface;
return Success;
compositor->set_buffer_layer(compositor, 0, surface_priv->video_buffer, &src_rect, NULL);
if (subpicture_priv) {
- struct pipe_video_rect src_rect = {surface_priv->subx, surface_priv->suby, surface_priv->subw, surface_priv->subh};
- struct pipe_video_rect dst_rect = {surface_priv->surfx, surface_priv->surfy, surface_priv->surfw, surface_priv->surfh};
-
XVMC_MSG(XVMC_TRACE, "[XvMC] Surface %p has subpicture %p.\n", surface, surface_priv->subpicture);
assert(subpicture_priv->surface == surface);
+
if (subpicture_priv->palette)
- compositor->set_palette_layer(compositor, 1, subpicture_priv->sampler, subpicture_priv->palette, &src_rect, &dst_rect);
+ compositor->set_palette_layer(compositor, 1, subpicture_priv->sampler, subpicture_priv->palette,
+ &subpicture_priv->src_rect, &subpicture_priv->dst_rect);
else
compositor->set_rgba_layer(compositor, 1, subpicture_priv->sampler, &src_rect, &dst_rect);
#include <X11/Xlib.h>
#include <X11/extensions/XvMClib.h>
+#include <pipe/p_video_state.h>
+
#include <util/u_debug.h>
#include <util/u_math.h>
/* The subpicture associated with this surface, if any. */
XvMCSubpicture *subpicture;
- short subx, suby;
- unsigned short subw, subh;
- short surfx, surfy;
- unsigned short surfw, surfh;
/* Some XvMC functions take a surface but not a context,
so we keep track of which context each surface belongs to. */
/* optional palette for this subpicture */
struct pipe_sampler_view *palette;
+ struct pipe_video_rect src_rect;
+ struct pipe_video_rect dst_rect;
+
/* The surface this subpicture is currently associated with, if any. */
XvMCSurface *surface;