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/auxiliary/vl/vl_decoder.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/gallium/auxiliary/vl/vl_decoder.c') diff --git a/src/gallium/auxiliary/vl/vl_decoder.c b/src/gallium/auxiliary/vl/vl_decoder.c index 16f09b501e6..dcbb77c9bfd 100644 --- a/src/gallium/auxiliary/vl/vl_decoder.c +++ b/src/gallium/auxiliary/vl/vl_decoder.c @@ -61,13 +61,10 @@ vl_level_supported(struct pipe_screen *screen, enum pipe_video_profile profile) struct pipe_video_decoder * vl_create_decoder(struct pipe_context *pipe, - enum pipe_video_profile profile, - enum pipe_video_entrypoint entrypoint, - enum pipe_video_chroma_format chroma_format, - unsigned width, unsigned height, unsigned max_references, - bool expect_chunked_decode) + const struct pipe_video_decoder *templat) { - unsigned buffer_width, buffer_height; + unsigned width = templat->width, height = templat->height; + struct pipe_video_decoder temp; bool pot_buffers; assert(pipe); @@ -76,18 +73,18 @@ vl_create_decoder(struct pipe_context *pipe, pot_buffers = !pipe->screen->get_video_param ( pipe->screen, - profile, + templat->profile, PIPE_VIDEO_CAP_NPOT_TEXTURES ); - buffer_width = pot_buffers ? util_next_power_of_two(width) : align(width, VL_MACROBLOCK_WIDTH); - buffer_height = pot_buffers ? util_next_power_of_two(height) : align(height, VL_MACROBLOCK_HEIGHT); + temp = *templat; + temp.width = pot_buffers ? util_next_power_of_two(width) : align(width, VL_MACROBLOCK_WIDTH); + temp.height = pot_buffers ? util_next_power_of_two(height) : align(height, VL_MACROBLOCK_HEIGHT); - switch (u_reduce_video_profile(profile)) { + switch (u_reduce_video_profile(temp.profile)) { case PIPE_VIDEO_CODEC_MPEG12: - return vl_create_mpeg12_decoder(pipe, profile, entrypoint, chroma_format, - buffer_width, buffer_height, max_references, - expect_chunked_decode); + return vl_create_mpeg12_decoder(pipe, &temp); + default: return NULL; } -- cgit v1.2.3