#include <X11/extensions/XvMClib.h>
#include "pipe/p_screen.h"
-#include "pipe/p_video_decoder.h"
+#include "pipe/p_video_codec.h"
#include "pipe/p_state.h"
#include "util/u_memory.h"
#include "util/u_math.h"
#include "util/u_format.h"
#include "util/u_sampler.h"
+#include "util/u_surface.h"
#include "util/u_rect.h"
#include "vl/vl_winsys.h"
subpictures = XvMCListSubpictureTypes(dpy, port, surface_type_id, &num_subpics);
if (num_subpics < 1) {
- if (subpictures)
- free(subpictures);
+ free(subpictures);
return BadMatch;
}
if (!subpictures)
struct pipe_transfer *transfer;
void *map;
- transfer = pipe->get_transfer(pipe, dst->texture, 0, PIPE_TRANSFER_WRITE, dst_box);
- if (!transfer)
+ map = pipe->transfer_map(pipe, dst->texture, 0, PIPE_TRANSFER_WRITE,
+ dst_box, &transfer);
+ if (!map)
return;
- map = pipe->transfer_map(pipe, transfer);
- if (map) {
- util_copy_rect(map, dst->texture->format, transfer->stride, 0, 0,
- dst_box->width, dst_box->height,
- src, src_stride, src_x, src_y);
+ util_copy_rect(map, dst->texture->format, transfer->stride, 0, 0,
+ dst_box->width, dst_box->height,
+ src, src_stride, src_x, src_y);
- pipe->transfer_unmap(pipe, transfer);
- }
-
- pipe->transfer_destroy(pipe, transfer);
+ pipe->transfer_unmap(pipe, transfer);
}
PUBLIC
tex_templ.last_level = 0;
if (pipe->screen->get_video_param(pipe->screen,
PIPE_VIDEO_PROFILE_UNKNOWN,
+ PIPE_VIDEO_ENTRYPOINT_UNKNOWN,
PIPE_VIDEO_CAP_NPOT_TEXTURES)) {
tex_templ.width0 = width;
tex_templ.height0 = height;
dst = subpicture_priv->sampler;
/* TODO: Assert clear rect is within bounds? Or clip? */
- transfer = pipe->get_transfer(pipe, dst->texture, 0, PIPE_TRANSFER_WRITE, &dst_box);
- if (!transfer)
+ map = pipe->transfer_map(pipe, dst->texture, 0, PIPE_TRANSFER_WRITE,
+ &dst_box, &transfer);
+ if (!map)
return XvMCBadSubpicture;
- map = pipe->transfer_map(pipe, transfer);
- if (map) {
- util_fill_rect(map, dst->texture->format, transfer->stride, 0, 0,
- dst_box.width, dst_box.height, &uc);
-
- pipe->transfer_unmap(pipe, transfer);
- }
-
- pipe->transfer_destroy(pipe, transfer);
+ util_fill_rect(map, dst->texture->format, transfer->stride, 0, 0,
+ dst_box.width, dst_box.height, &uc);
+ pipe->transfer_unmap(pipe, transfer);
return Success;
}