From 53e20b8b418cc85e13d70f41ce160e17847a5096 Mon Sep 17 00:00:00 2001 From: Christian König Date: Mon, 15 Jul 2013 01:50:24 -0600 Subject: vl: use a template for create_video_decoder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- src/gallium/state_trackers/vdpau/decode.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/gallium/state_trackers/vdpau') 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; -- cgit v1.2.3