diff options
author | Christian König <[email protected]> | 2013-07-15 01:50:24 -0600 |
---|---|---|
committer | Christian König <[email protected]> | 2013-08-19 10:21:14 +0200 |
commit | 53e20b8b418cc85e13d70f41ce160e17847a5096 (patch) | |
tree | fab98050b72995f12e7126c3df148d5aaab77415 /src/gallium/auxiliary/vl/vl_decoder.c | |
parent | d13003f544417db6de44c65a0c118bd2b189458a (diff) |
vl: use a template for create_video_decoder
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_decoder.c')
-rw-r--r-- | src/gallium/auxiliary/vl/vl_decoder.c | 23 |
1 files changed, 10 insertions, 13 deletions
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; } |