summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2017-08-15 12:06:24 -0400
committerLeo Liu <[email protected]>2017-08-21 10:09:09 -0400
commit38b9686df0818c74696ea712a8ef844d354aaeb4 (patch)
tree5b9fbf4ad34900c9d7755714e11fdd03c1155c83 /src/gallium/state_trackers/va
parent0a5947737243e07b754fae7549c814160bbd4075 (diff)
st/va: create decoder for MJPEG format
Mjpeg doesn't need reference Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va')
-rw-r--r--src/gallium/state_trackers/va/picture.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c
index 338e0902d65..30617e8cfe7 100644
--- a/src/gallium/state_trackers/va/picture.c
+++ b/src/gallium/state_trackers/va/picture.c
@@ -170,14 +170,17 @@ handlePictureParameterBuffer(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *
/* Create the decoder once max_references is known. */
if (!context->decoder) {
+ enum pipe_video_format format =
+ u_reduce_video_profile(context->templat.profile);
+
if (!context->target)
return VA_STATUS_ERROR_INVALID_CONTEXT;
- if (context->templat.max_references == 0)
+ if (context->templat.max_references == 0 &&
+ format != PIPE_VIDEO_FORMAT_JPEG)
return VA_STATUS_ERROR_INVALID_BUFFER;
- if (u_reduce_video_profile(context->templat.profile) ==
- PIPE_VIDEO_FORMAT_MPEG4_AVC)
+ if (format == PIPE_VIDEO_FORMAT_MPEG4_AVC)
context->templat.level = u_get_h264_level(context->templat.width,
context->templat.height, &context->templat.max_references);