diff options
author | Christian König <[email protected]> | 2012-01-02 14:22:33 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2012-01-15 12:40:44 +0100 |
commit | e027759336bf49e3f568bd73b9e5f26d56ef6f83 (patch) | |
tree | b82a3cd8c9f0ca6ce718567aa1ec128b14c7c0b3 /src/gallium/state_trackers | |
parent | 39491d1d31d9f03437816fbb4f2872761ae1157c (diff) |
vl/video_buffer: use template style create params
Just like in the rest of gallium, this reduces the
number of parameters significantly.
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/vdpau/surface.c | 10 | ||||
-rw-r--r-- | src/gallium/state_trackers/xorg/xvmc/surface.c | 14 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c index 77503cfff49..206a8397e9f 100644 --- a/src/gallium/state_trackers/vdpau/surface.c +++ b/src/gallium/state_trackers/vdpau/surface.c @@ -44,6 +44,7 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type, uint32_t width, uint32_t height, VdpVideoSurface *surface) { + struct pipe_video_buffer tmpl; vlVdpSurface *p_surf; VdpStatus ret; @@ -72,12 +73,15 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type, } p_surf->device = dev; + memset(&tmpl, 0, sizeof(tmpl)); + tmpl.buffer_format = PIPE_FORMAT_YV12; + tmpl.chroma_format = ChromaToPipe(chroma_type); + tmpl.width = width; + tmpl.height = height; p_surf->video_buffer = dev->context->pipe->create_video_buffer ( dev->context->pipe, - PIPE_FORMAT_YV12, // most common used - ChromaToPipe(chroma_type), - width, height + &tmpl ); *surface = vlAddDataHTAB(p_surf); diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c index b4447c44609..ddc937c64c1 100644 --- a/src/gallium/state_trackers/xorg/xvmc/surface.c +++ b/src/gallium/state_trackers/xorg/xvmc/surface.c @@ -167,6 +167,7 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surfac XvMCContextPrivate *context_priv; struct pipe_context *pipe; XvMCSurfacePrivate *surface_priv; + struct pipe_video_buffer tmpl; XVMC_MSG(XVMC_TRACE, "[XvMC] Creating surface %p.\n", surface); @@ -184,12 +185,13 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surfac if (!surface_priv) return BadAlloc; - surface_priv->video_buffer = pipe->create_video_buffer - ( - pipe, PIPE_FORMAT_NV12, context_priv->decoder->chroma_format, - context_priv->decoder->width, context_priv->decoder->height - ); - + memset(&tmpl, 0, sizeof(tmpl)); + tmpl.buffer_format = PIPE_FORMAT_NV12; + tmpl.chroma_format = context_priv->decoder->chroma_format; + tmpl.width = context_priv->decoder->width; + tmpl.height = context_priv->decoder->height; + + surface_priv->video_buffer = pipe->create_video_buffer(pipe, &tmpl); surface_priv->context = context; surface->surface_id = XAllocID(dpy); |