[FFmpeg-devel] [PATCH 3/4] mmaldec: support MPEG-4
wm4
nfxjfg at googlemail.com
Wed Jan 27 17:17:55 CET 2016
I guess this means part 2 in both cases. Not sure which profiles exactly
are actually supported properly.
---
configure | 3 +++
libavcodec/allcodecs.c | 2 ++
libavcodec/mmaldec.c | 11 +++++++++++
3 files changed, 16 insertions(+)
diff --git a/configure b/configure
index dbce069..9b195c9 100755
--- a/configure
+++ b/configure
@@ -2550,6 +2550,9 @@ mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
mpeg2_xvmc_hwaccel_deps="xvmc"
mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
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_select="mpeg4_decoder"
mpeg4_vdpau_decoder_deps="vdpau"
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 2128546..3cb370c 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -101,6 +101,7 @@ void avcodec_register_all(void)
REGISTER_HWACCEL(MPEG2_VAAPI, mpeg2_vaapi);
REGISTER_HWACCEL(MPEG2_VDPAU, mpeg2_vdpau);
REGISTER_HWACCEL(MPEG2_VIDEOTOOLBOX, mpeg2_videotoolbox);
+ REGISTER_HWACCEL(MPEG4_MMAL, mpeg4_mmal);
REGISTER_HWACCEL(MPEG4_VAAPI, mpeg4_vaapi);
REGISTER_HWACCEL(MPEG4_VDPAU, mpeg4_vdpau);
REGISTER_HWACCEL(MPEG4_VIDEOTOOLBOX, mpeg4_videotoolbox);
@@ -234,6 +235,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (MPEG2VIDEO, mpeg2video);
REGISTER_ENCDEC (MPEG4, mpeg4);
REGISTER_DECODER(MPEG4_CRYSTALHD, mpeg4_crystalhd);
+ REGISTER_DECODER(MPEG4_MMAL, mpeg4_mmal);
#if FF_API_VDPAU
REGISTER_DECODER(MPEG4_VDPAU, mpeg4_vdpau);
#endif
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index 73c6fad..83431e6 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -358,6 +358,9 @@ static av_cold int ffmmal_init_decoder(AVCodecContext *avctx)
case AV_CODEC_ID_MPEG2VIDEO:
format_in->encoding = MMAL_ENCODING_MP2V;
break;
+ case AV_CODEC_ID_MPEG4:
+ format_in->encoding = MMAL_ENCODING_MP4V;
+ break;
case AV_CODEC_ID_VC1:
format_in->encoding = MMAL_ENCODING_WVC1;
break;
@@ -793,6 +796,13 @@ AVHWAccel ff_mpeg2_mmal_hwaccel = {
.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 = {
.name = "vc1_mmal",
.type = AVMEDIA_TYPE_VIDEO,
@@ -834,4 +844,5 @@ static const AVOption options[]={
FFMMAL_DEC(h264, AV_CODEC_ID_H264)
FFMMAL_DEC(mpeg2, AV_CODEC_ID_MPEG2VIDEO)
+FFMMAL_DEC(mpeg4, AV_CODEC_ID_MPEG4)
FFMMAL_DEC(vc1, AV_CODEC_ID_VC1)
--
2.7.0
More information about the ffmpeg-devel
mailing list