} else if (p_surf->templat.chroma_format == PIPE_VIDEO_CHROMA_FORMAT_422) {
*height /= 2;
}
- if (p_surf->templat.interlaced)
- *height /= 2;
}
+ if (p_surf->templat.interlaced)
+ *height /= 2;
}
/**
struct pipe_transfer *transfer;
uint8_t *map;
- transfer = pipe->get_transfer(pipe, sv->texture, 0, PIPE_TRANSFER_READ, &box);
- if (transfer == NULL) {
- pipe_mutex_unlock(vlsurface->device->mutex);
- return VDP_STATUS_RESOURCES;
- }
-
- map = pipe_transfer_map(pipe, transfer);
- if (map == NULL) {
- pipe_transfer_destroy(pipe, transfer);
+ map = pipe->transfer_map(pipe, sv->texture, 0,
+ PIPE_TRANSFER_READ, &box, &transfer);
+ if (!map) {
pipe_mutex_unlock(vlsurface->device->mutex);
return VDP_STATUS_RESOURCES;
}
box.width, box.height, map, transfer->stride, 0, 0);
pipe_transfer_unmap(pipe, transfer);
- pipe_transfer_destroy(pipe, transfer);
}
}
pipe_mutex_unlock(vlsurface->device->mutex);
surfaces = vlsurf->video_buffer->get_surfaces(vlsurf->video_buffer);
for (i = 0; i < VL_MAX_SURFACES; ++i) {
- union pipe_color_union black = {};
+ union pipe_color_union c = {};
if (!surfaces[i])
continue;
- pipe->clear_render_target(pipe, surfaces[i], &black, 0, 0,
+ if (i > !!vlsurf->templat.interlaced)
+ c.f[0] = c.f[1] = c.f[2] = c.f[3] = 0.5f;
+
+ pipe->clear_render_target(pipe, surfaces[i], &c, 0, 0,
surfaces[i]->width, surfaces[i]->height);
}
- pipe->flush(pipe, NULL);
+ pipe->flush(pipe, NULL, 0);
}