Add MPEG 4 codec

This patch introduces the support of MPEG4 video decoding. It basically
just copies data from VA's frame/slice headers data structures to v4l's
MPEG4 frame header extended controls data structures.
This commit is contained in:
Florent Revest
2016-08-25 15:50:40 +02:00
parent 728b1b41b9
commit f645948921
8 changed files with 232 additions and 2 deletions
+19
View File
@@ -31,6 +31,7 @@
#include "va_config.h"
#include "mpeg2.h"
#include "mpeg4.h"
#include <assert.h>
#include <string.h>
@@ -118,6 +119,16 @@ VAStatus sunxi_cedrus_RenderPicture(VADriverContextP ctx, VAContextID context,
else if(obj_buffer->type == VAPictureParameterBufferType)
vaStatus = sunxi_cedrus_render_mpeg2_picture_parameter(ctx, obj_context, obj_surface, obj_buffer);
break;
case VAProfileMPEG4Simple:
case VAProfileMPEG4AdvancedSimple:
case VAProfileMPEG4Main:
if(obj_buffer->type == VASliceDataBufferType)
vaStatus = sunxi_cedrus_render_mpeg4_slice_data(ctx, obj_context, obj_surface, obj_buffer);
else if(obj_buffer->type == VAPictureParameterBufferType)
vaStatus = sunxi_cedrus_render_mpeg4_picture_parameter(ctx, obj_context, obj_surface, obj_buffer);
else if(obj_buffer->type == VASliceParameterBufferType)
vaStatus = sunxi_cedrus_render_mpeg4_slice_parameter(ctx, obj_context, obj_surface, obj_buffer);
break;
default:
break;
}
@@ -168,6 +179,14 @@ VAStatus sunxi_cedrus_EndPicture(VADriverContextP ctx, VAContextID context)
ctrl.ptr = &obj_context->mpeg2_frame_hdr;
ctrl.size = sizeof(obj_context->mpeg2_frame_hdr);
break;
case VAProfileMPEG4Simple:
case VAProfileMPEG4AdvancedSimple:
case VAProfileMPEG4Main:
out_buf.m.planes[0].bytesused = obj_context->mpeg4_frame_hdr.slice_len/8;
ctrl.id = V4L2_CID_MPEG_VIDEO_MPEG4_FRAME_HDR;
ctrl.ptr = &obj_context->mpeg4_frame_hdr;
ctrl.size = sizeof(obj_context->mpeg4_frame_hdr);
break;
default:
out_buf.m.planes[0].bytesused = 0;
ctrl.id = V4L2_CID_MPEG_VIDEO_MPEG2_FRAME_HDR;