mmaldec: support MPEG-4

I guess this means part 2 in both cases. Not sure which profiles exactly
are actually supported properly.
This commit is contained in:
wm4 2016-01-28 17:24:40 +01:00
parent d27a12cb09
commit 7b1b53f3a4
3 changed files with 16 additions and 0 deletions

3
configure vendored
View File

@ -2551,6 +2551,9 @@ mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
mpeg2_xvmc_hwaccel_deps="xvmc" mpeg2_xvmc_hwaccel_deps="xvmc"
mpeg2_xvmc_hwaccel_select="mpeg2video_decoder" mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
mpeg4_crystalhd_decoder_select="crystalhd" mpeg4_crystalhd_decoder_select="crystalhd"
mpeg4_mmal_decoder_deps="mmal"
mpeg4_mmal_decoder_select="mmal"
mpeg4_mmal_hwaccel_deps="mmal"
mpeg4_vaapi_hwaccel_deps="vaapi" mpeg4_vaapi_hwaccel_deps="vaapi"
mpeg4_vaapi_hwaccel_select="mpeg4_decoder" mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
mpeg4_vdpau_decoder_deps="vdpau" mpeg4_vdpau_decoder_deps="vdpau"

View File

@ -101,6 +101,7 @@ void avcodec_register_all(void)
REGISTER_HWACCEL(MPEG2_VAAPI, mpeg2_vaapi); REGISTER_HWACCEL(MPEG2_VAAPI, mpeg2_vaapi);
REGISTER_HWACCEL(MPEG2_VDPAU, mpeg2_vdpau); REGISTER_HWACCEL(MPEG2_VDPAU, mpeg2_vdpau);
REGISTER_HWACCEL(MPEG2_VIDEOTOOLBOX, mpeg2_videotoolbox); REGISTER_HWACCEL(MPEG2_VIDEOTOOLBOX, mpeg2_videotoolbox);
REGISTER_HWACCEL(MPEG4_MMAL, mpeg4_mmal);
REGISTER_HWACCEL(MPEG4_VAAPI, mpeg4_vaapi); REGISTER_HWACCEL(MPEG4_VAAPI, mpeg4_vaapi);
REGISTER_HWACCEL(MPEG4_VDPAU, mpeg4_vdpau); REGISTER_HWACCEL(MPEG4_VDPAU, mpeg4_vdpau);
REGISTER_HWACCEL(MPEG4_VIDEOTOOLBOX, mpeg4_videotoolbox); REGISTER_HWACCEL(MPEG4_VIDEOTOOLBOX, mpeg4_videotoolbox);
@ -235,6 +236,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (MPEG2VIDEO, mpeg2video); REGISTER_ENCDEC (MPEG2VIDEO, mpeg2video);
REGISTER_ENCDEC (MPEG4, mpeg4); REGISTER_ENCDEC (MPEG4, mpeg4);
REGISTER_DECODER(MPEG4_CRYSTALHD, mpeg4_crystalhd); REGISTER_DECODER(MPEG4_CRYSTALHD, mpeg4_crystalhd);
REGISTER_DECODER(MPEG4_MMAL, mpeg4_mmal);
#if FF_API_VDPAU #if FF_API_VDPAU
REGISTER_DECODER(MPEG4_VDPAU, mpeg4_vdpau); REGISTER_DECODER(MPEG4_VDPAU, mpeg4_vdpau);
#endif #endif

View File

@ -358,6 +358,9 @@ static av_cold int ffmmal_init_decoder(AVCodecContext *avctx)
case AV_CODEC_ID_MPEG2VIDEO: case AV_CODEC_ID_MPEG2VIDEO:
format_in->encoding = MMAL_ENCODING_MP2V; format_in->encoding = MMAL_ENCODING_MP2V;
break; break;
case AV_CODEC_ID_MPEG4:
format_in->encoding = MMAL_ENCODING_MP4V;
break;
case AV_CODEC_ID_VC1: case AV_CODEC_ID_VC1:
format_in->encoding = MMAL_ENCODING_WVC1; format_in->encoding = MMAL_ENCODING_WVC1;
break; break;
@ -793,6 +796,13 @@ AVHWAccel ff_mpeg2_mmal_hwaccel = {
.pix_fmt = AV_PIX_FMT_MMAL, .pix_fmt = AV_PIX_FMT_MMAL,
}; };
AVHWAccel ff_mpeg4_mmal_hwaccel = {
.name = "mpeg4_mmal",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MPEG4,
.pix_fmt = AV_PIX_FMT_MMAL,
};
AVHWAccel ff_vc1_mmal_hwaccel = { AVHWAccel ff_vc1_mmal_hwaccel = {
.name = "vc1_mmal", .name = "vc1_mmal",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
@ -834,4 +844,5 @@ static const AVOption options[]={
FFMMAL_DEC(h264, AV_CODEC_ID_H264) FFMMAL_DEC(h264, AV_CODEC_ID_H264)
FFMMAL_DEC(mpeg2, AV_CODEC_ID_MPEG2VIDEO) FFMMAL_DEC(mpeg2, AV_CODEC_ID_MPEG2VIDEO)
FFMMAL_DEC(mpeg4, AV_CODEC_ID_MPEG4)
FFMMAL_DEC(vc1, AV_CODEC_ID_VC1) FFMMAL_DEC(vc1, AV_CODEC_ID_VC1)