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/state_trackers/vdpau/decode.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/state_trackers/vdpau/decode.c')
-rw-r--r-- | src/gallium/state_trackers/vdpau/decode.c | 23 |
1 files changed, 11 insertions, 12 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; |