summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorChristian König <[email protected]>2013-07-15 01:50:24 -0600
committerChristian König <[email protected]>2013-08-19 10:21:14 +0200
commit53e20b8b418cc85e13d70f41ce160e17847a5096 (patch)
treefab98050b72995f12e7126c3df148d5aaab77415 /src/gallium/state_trackers
parentd13003f544417db6de44c65a0c118bd2b189458a (diff)
vl: use a template for create_video_decoder
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/vdpau/decode.c23
-rw-r--r--src/gallium/state_trackers/xvmc/context.c18
2 files changed, 21 insertions, 20 deletions
diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c
index 2ffd8dd29f9..c0af83bdc7d 100644
--- a/src/gallium/state_trackers/vdpau/decode.c
+++ b/src/gallium/state_trackers/vdpau/decode.c
@@ -44,7 +44,7 @@ vlVdpDecoderCreate(VdpDevice device,
uint32_t max_references,
VdpDecoder *decoder)
{
- enum pipe_video_profile p_profile;
+ struct pipe_video_decoder templat = {};
struct pipe_context *pipe;
struct pipe_screen *screen;
vlVdpDevice *dev;
@@ -59,8 +59,8 @@ vlVdpDecoderCreate(VdpDevice device,
if (!(width && height))
return VDP_STATUS_INVALID_VALUE;
- p_profile = ProfileToPipe(profile);
- if (p_profile == PIPE_VIDEO_PROFILE_UNKNOWN)
+ templat.profile = ProfileToPipe(profile);
+ if (templat.profile == PIPE_VIDEO_PROFILE_UNKNOWN)
return VDP_STATUS_INVALID_DECODER_PROFILE;
dev = vlGetDataHTAB(device);
@@ -75,7 +75,7 @@ vlVdpDecoderCreate(VdpDevice device,
supported = screen->get_video_param
(
screen,
- p_profile,
+ templat.profile,
PIPE_VIDEO_CAP_SUPPORTED
);
if (!supported) {
@@ -91,14 +91,13 @@ vlVdpDecoderCreate(VdpDevice device,
vldecoder->device = dev;
- vldecoder->decoder = pipe->create_video_decoder
- (
- pipe, p_profile,
- PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
- PIPE_VIDEO_CHROMA_FORMAT_420,
- width, height, max_references,
- false
- );
+ templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;
+ templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
+ templat.width = width;
+ templat.height = height;
+ templat.max_references = max_references;
+
+ vldecoder->decoder = pipe->create_video_decoder(pipe, &templat);
if (!vldecoder->decoder) {
ret = VDP_STATUS_ERROR;
diff --git a/src/gallium/state_trackers/xvmc/context.c b/src/gallium/state_trackers/xvmc/context.c
index 23f9d10ca92..d6301335b4b 100644
--- a/src/gallium/state_trackers/xvmc/context.c
+++ b/src/gallium/state_trackers/xvmc/context.c
@@ -191,6 +191,7 @@ Status XvMCCreateContext(Display *dpy, XvPortID port, int surface_type_id,
Status ret;
struct vl_screen *vscreen;
struct pipe_context *pipe;
+ struct pipe_video_decoder templat = {};
XvMCContextPrivate *context_priv;
vl_csc_matrix csc;
@@ -244,14 +245,15 @@ Status XvMCCreateContext(Display *dpy, XvPortID port, int surface_type_id,
return BadAlloc;
}
- context_priv->decoder = pipe->create_video_decoder
- (
- pipe, ProfileToPipe(mc_type),
- (mc_type & XVMC_IDCT) ? PIPE_VIDEO_ENTRYPOINT_IDCT : PIPE_VIDEO_ENTRYPOINT_MC,
- FormatToPipe(chroma_format),
- width, height, 2,
- true
- );
+ templat.profile = ProfileToPipe(mc_type);
+ templat.entrypoint = (mc_type & XVMC_IDCT) ? PIPE_VIDEO_ENTRYPOINT_IDCT : PIPE_VIDEO_ENTRYPOINT_MC;
+ templat.chroma_format = FormatToPipe(chroma_format);
+ templat.width = width;
+ templat.height = height;
+ templat.max_references = 2;
+ templat.expect_chunked_decode = true;
+
+ context_priv->decoder = pipe->create_video_decoder(pipe, &templat);
if (!context_priv->decoder) {
XVMC_MSG(XVMC_ERR, "[XvMC] Could not create VL decoder.\n");