diff options
author | Christian König <[email protected]> | 2011-07-08 14:44:19 +0200 |
---|---|---|
committer | Christian König <[email protected]> | 2011-07-08 14:44:19 +0200 |
commit | bd5fd67a3e3cda4b7676dd4745fc5d5524709210 (patch) | |
tree | 03fc88a9763ad0edf639b2821383a7866c972ff5 /src/gallium/state_trackers/vdpau | |
parent | 10fd45114d4a7bbac4093755305ea5e4ba3ab6a5 (diff) |
[g3dvl] move compositor creation and handling directly into the state trackers
Diffstat (limited to 'src/gallium/state_trackers/vdpau')
-rw-r--r-- | src/gallium/state_trackers/vdpau/mixer.c | 14 | ||||
-rw-r--r-- | src/gallium/state_trackers/vdpau/presentation.c | 16 | ||||
-rw-r--r-- | src/gallium/state_trackers/vdpau/vdpau_private.h | 5 |
3 files changed, 18 insertions, 17 deletions
diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c index 85f4e1541ab..ea6d50d7457 100644 --- a/src/gallium/state_trackers/vdpau/mixer.c +++ b/src/gallium/state_trackers/vdpau/mixer.c @@ -61,7 +61,7 @@ vlVdpVideoMixerCreate(VdpDevice device, return VDP_STATUS_RESOURCES; vmixer->device = dev; - vmixer->compositor = context->create_compositor(context); + vl_compositor_init(&vmixer->compositor, dev->context->pipe); vl_csc_get_matrix ( @@ -69,7 +69,7 @@ vlVdpVideoMixerCreate(VdpDevice device, VL_CSC_COLOR_STANDARD_IDENTITY : VL_CSC_COLOR_STANDARD_BT_601, NULL, true, csc ); - vmixer->compositor->set_csc_matrix(vmixer->compositor, csc); + vl_compositor_set_csc_matrix(&vmixer->compositor, csc); /* * TODO: Handle features and parameters @@ -97,7 +97,7 @@ vlVdpVideoMixerDestroy(VdpVideoMixer mixer) if (!vmixer) return VDP_STATUS_INVALID_HANDLE; - vmixer->compositor->destroy(vmixer->compositor); + vl_compositor_cleanup(&vmixer->compositor); FREE(vmixer); @@ -158,10 +158,10 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, if (!dst) return VDP_STATUS_INVALID_HANDLE; - vmixer->compositor->clear_layers(vmixer->compositor); - vmixer->compositor->set_buffer_layer(vmixer->compositor, 0, surf->video_buffer, NULL, NULL); - vmixer->compositor->render_picture(vmixer->compositor, PIPE_MPEG12_PICTURE_TYPE_FRAME, - dst->surface, NULL, NULL); + vl_compositor_clear_layers(&vmixer->compositor); + vl_compositor_set_buffer_layer(&vmixer->compositor, 0, surf->video_buffer, NULL, NULL); + vl_compositor_render(&vmixer->compositor, PIPE_MPEG12_PICTURE_TYPE_FRAME, + dst->surface, NULL, NULL); return VDP_STATUS_OK; } diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c index 02fcfbd0746..0f87ca78972 100644 --- a/src/gallium/state_trackers/vdpau/presentation.c +++ b/src/gallium/state_trackers/vdpau/presentation.c @@ -67,8 +67,8 @@ vlVdpPresentationQueueCreate(VdpDevice device, pq->device = dev; pq->drawable = pqt->drawable; - pq->compositor = context->create_compositor(context); - if (!pq->compositor) { + + if (!vl_compositor_init(&pq->compositor, dev->context->pipe)) { ret = VDP_STATUS_ERROR; goto no_compositor; } @@ -97,7 +97,7 @@ vlVdpPresentationQueueDestroy(VdpPresentationQueue presentation_queue) if (!pq) return VDP_STATUS_INVALID_HANDLE; - pq->compositor->destroy(pq->compositor); + vl_compositor_cleanup(&pq->compositor); vlRemoveDataHTAB(presentation_queue); FREE(pq); @@ -120,7 +120,7 @@ vlVdpPresentationQueueSetBackgroundColor(VdpPresentationQueue presentation_queue if (!pq) return VDP_STATUS_INVALID_HANDLE; - pq->compositor->set_clear_color(pq->compositor, (float*)background_color); + vl_compositor_set_clear_color(&pq->compositor, (float*)background_color); return VDP_STATUS_OK; } @@ -170,10 +170,10 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue, 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); + vl_compositor_clear_layers(&pq->compositor); + vl_compositor_set_rgba_layer(&pq->compositor, 0, surf->sampler_view, NULL, NULL); + vl_compositor_render(&pq->compositor, PIPE_MPEG12_PICTURE_TYPE_FRAME, + drawable_surface, NULL, NULL); pq->device->context->vpipe->screen->flush_frontbuffer ( diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h index 1d6ca39fe39..ada17dfadc9 100644 --- a/src/gallium/state_trackers/vdpau/vdpau_private.h +++ b/src/gallium/state_trackers/vdpau/vdpau_private.h @@ -37,6 +37,7 @@ #include <pipe/p_video_context.h> #include <util/u_debug.h> +#include <vl/vl_compositor.h> #include <vl_winsys.h> @@ -188,13 +189,13 @@ typedef struct { vlVdpDevice *device; Drawable drawable; - struct pipe_video_compositor *compositor; + struct vl_compositor compositor; } vlVdpPresentationQueue; typedef struct { vlVdpDevice *device; - struct pipe_video_compositor *compositor; + struct vl_compositor compositor; } vlVdpVideoMixer; typedef struct |