diff options
author | Christian König <[email protected]> | 2011-04-09 01:32:25 +0200 |
---|---|---|
committer | Christian König <[email protected]> | 2011-04-09 01:34:02 +0200 |
commit | cae77aa80b3629a147ce3ae4526646014efae595 (patch) | |
tree | de3c01955a0cca63bbccc24ee3d9e2f16db45b62 /src/gallium/state_trackers/vdpau/presentation.c | |
parent | f3ead63e7023f61557cb92be30cae6fe9efb280a (diff) |
vdpau: Implement basic output functionality
Even with totally wrong color space conversion
we finally se a picture with VDPAU. Yeah!
Diffstat (limited to 'src/gallium/state_trackers/vdpau/presentation.c')
-rw-r--r-- | src/gallium/state_trackers/vdpau/presentation.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c index fadc57e70c0..fdd0144fe22 100644 --- a/src/gallium/state_trackers/vdpau/presentation.c +++ b/src/gallium/state_trackers/vdpau/presentation.c @@ -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 |