mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-11 06:28:09 +02:00
vdpau: Implement basic output functionality
Even with totally wrong color space conversion we finally se a picture with VDPAU. Yeah!
This commit is contained in:
parent
f3ead63e70
commit
cae77aa80b
3 changed files with 33 additions and 2 deletions
|
|
@ -69,6 +69,7 @@ vlVdpPresentationQueueCreate(VdpDevice device,
|
|||
|
||||
pq->device = dev;
|
||||
pq->compositor = context->create_compositor(context);
|
||||
pq->drawable = pqt->drawable;
|
||||
if (!pq->compositor) {
|
||||
ret = VDP_STATUS_ERROR;
|
||||
goto no_compositor;
|
||||
|
|
@ -130,7 +131,36 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
|
|||
uint32_t clip_height,
|
||||
VdpTime earliest_presentation_time)
|
||||
{
|
||||
return VDP_STATUS_NO_IMPLEMENTATION;
|
||||
vlVdpPresentationQueue *pq;
|
||||
vlVdpOutputSurface *surf;
|
||||
struct pipe_surface *drawable_surface;
|
||||
|
||||
pq = vlGetDataHTAB(presentation_queue);
|
||||
if (!pq)
|
||||
return VDP_STATUS_INVALID_HANDLE;
|
||||
|
||||
drawable_surface = vl_drawable_surface_get(pq->device->context, pq->drawable);
|
||||
if (!drawable_surface)
|
||||
return VDP_STATUS_INVALID_HANDLE;
|
||||
|
||||
surf = vlGetDataHTAB(surface);
|
||||
if (!surf)
|
||||
return VDP_STATUS_INVALID_HANDLE;
|
||||
|
||||
pq->compositor->clear_layers(pq->compositor);
|
||||
pq->compositor->set_rgba_layer(pq->compositor, 0, surf->sampler_view, NULL, NULL);
|
||||
pq->compositor->render_picture(pq->compositor, PIPE_MPEG12_PICTURE_TYPE_FRAME,
|
||||
drawable_surface, NULL, NULL);
|
||||
|
||||
pq->device->context->vpipe->screen->flush_frontbuffer
|
||||
(
|
||||
pq->device->context->vpipe->screen,
|
||||
drawable_surface->texture,
|
||||
0, 0,
|
||||
vl_contextprivate_get(pq->device->context, drawable_surface)
|
||||
);
|
||||
|
||||
return VDP_STATUS_OK;
|
||||
}
|
||||
|
||||
VdpStatus
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ vlVdpVideoSurfacePutBitsYCbCr(VdpVideoSurface surface,
|
|||
|
||||
for (i = 0; i < 3; ++i) { //TODO put nr of planes into util format
|
||||
struct pipe_sampler_view *sv = sampler_views[i];
|
||||
struct pipe_box dst_box = { 0, 0, sv->texture->width0, sv->texture->height0 };
|
||||
struct pipe_box dst_box = { 0, 0, 0, sv->texture->width0, sv->texture->height0, 1 };
|
||||
context->upload_sampler(context, sv, &dst_box, source_data[i], source_pitches[i], 0, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ typedef struct
|
|||
typedef struct
|
||||
{
|
||||
vlVdpDevice *device;
|
||||
Drawable drawable;
|
||||
struct pipe_video_compositor *compositor;
|
||||
} vlVdpPresentationQueue;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue