aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/va/picture.c
diff options
context:
space:
mode:
authorBoyuan Zhang <[email protected]>2018-10-17 15:03:24 -0400
committerLeo Liu <[email protected]>2018-10-23 08:50:02 -0400
commit4fc2368e3b77d8016798599fab6560d5d37702e1 (patch)
tree0b7705cd03d0830b001b42bcbaa95cdc00083462 /src/gallium/state_trackers/va/picture.c
parentc7a5ef26adecb6454039ae0bed672cbd30dbede6 (diff)
st/va: get mjpeg slice header
Move the previous get_mjpeg_slice_heaeder function and eoi from "radeon/vcn" to "st/va". Signed-off-by: Boyuan Zhang <[email protected]> Reviewed-by: Leo Liu <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va/picture.c')
-rw-r--r--src/gallium/state_trackers/va/picture.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c
index e2cdb2b40cd..04d2da0afeb 100644
--- a/src/gallium/state_trackers/va/picture.c
+++ b/src/gallium/state_trackers/va/picture.c
@@ -259,11 +259,12 @@ handleVASliceDataBufferType(vlVaContext *context, vlVaBuffer *buf)
{
enum pipe_video_format format;
unsigned num_buffers = 0;
- void * const *buffers[2];
- unsigned sizes[2];
+ void * const *buffers[3];
+ unsigned sizes[3];
static const uint8_t start_code_h264[] = { 0x00, 0x00, 0x01 };
static const uint8_t start_code_h265[] = { 0x00, 0x00, 0x01 };
static const uint8_t start_code_vc1[] = { 0x00, 0x00, 0x01, 0x0d };
+ static const uint8_t eoi_jpeg[] = { 0xff, 0xd9 };
format = u_reduce_video_profile(context->templat.profile);
switch (format) {
@@ -301,6 +302,9 @@ handleVASliceDataBufferType(vlVaContext *context, vlVaBuffer *buf)
sizes[num_buffers++] = context->mpeg4.start_code_size;
break;
case PIPE_VIDEO_FORMAT_JPEG:
+ vlVaGetJpegSliceHeader(context);
+ buffers[num_buffers] = (void *)context->mjpeg.slice_header;
+ sizes[num_buffers++] = context->mjpeg.slice_header_size;
break;
case PIPE_VIDEO_FORMAT_VP9:
vlVaDecoderVP9BitstreamHeader(context, buf);
@@ -313,6 +317,11 @@ handleVASliceDataBufferType(vlVaContext *context, vlVaBuffer *buf)
sizes[num_buffers] = buf->size;
++num_buffers;
+ if (format == PIPE_VIDEO_FORMAT_JPEG) {
+ buffers[num_buffers] = (void *const)&eoi_jpeg;
+ sizes[num_buffers++] = sizeof(eoi_jpeg);
+ }
+
if (context->needs_begin_frame) {
context->decoder->begin_frame(context->decoder, context->target,
&context->desc.base);