summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/state_trackers/va/picture.c11
-rw-r--r--src/gallium/state_trackers/va/va_private.h1
2 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c
index a8102a4284d..bf592eed8f1 100644
--- a/src/gallium/state_trackers/va/picture.c
+++ b/src/gallium/state_trackers/va/picture.c
@@ -81,7 +81,7 @@ vlVaBeginPicture(VADriverContextP ctx, VAContextID context_id, VASurfaceID rende
}
if (context->decoder->entrypoint != PIPE_VIDEO_ENTRYPOINT_ENCODE)
- context->decoder->begin_frame(context->decoder, context->target, &context->desc.base);
+ context->needs_begin_frame = true;
return VA_STATUS_SUCCESS;
}
@@ -179,8 +179,7 @@ handlePictureParameterBuffer(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *
if (!context->decoder)
return VA_STATUS_ERROR_ALLOCATION_FAILED;
- context->decoder->begin_frame(context->decoder, context->target,
- &context->desc.base);
+ context->needs_begin_frame = true;
}
return vaStatus;
@@ -310,6 +309,12 @@ handleVASliceDataBufferType(vlVaContext *context, vlVaBuffer *buf)
buffers[num_buffers] = buf->data;
sizes[num_buffers] = buf->size;
++num_buffers;
+
+ if (context->needs_begin_frame) {
+ context->decoder->begin_frame(context->decoder, context->target,
+ &context->desc.base);
+ context->needs_begin_frame = false;
+ }
context->decoder->decode_bitstream(context->decoder, context->target, &context->desc.base,
num_buffers, (const void * const*)buffers, sizes);
}
diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h
index c9a6a41f7d7..655f90eeb83 100644
--- a/src/gallium/state_trackers/va/va_private.h
+++ b/src/gallium/state_trackers/va/va_private.h
@@ -244,6 +244,7 @@ typedef struct {
struct vl_deint_filter *deint;
struct vlVaBuffer *coded_buf;
int target_id;
+ bool needs_begin_frame;
} vlVaContext;
typedef struct {