Skip to content

Commit

Permalink
omx: Try to add a separate wmv3 codec
Browse files Browse the repository at this point in the history
  • Loading branch information
mstorsjo committed Mar 31, 2016
1 parent 8acb59e commit cc09658
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2118,6 +2118,7 @@ omx_h264_encoder_deps="omx dlopen"
omx_mpeg4_decoder_deps="omx dlopen"
omx_mpeg4_encoder_deps="omx dlopen"
omx_vc1_decoder_deps="omx dlopen"
omx_wmv3_decoder_deps="omx dlopen"

# demuxers / muxers
ac3_demuxer_select="ac3_parser"
Expand Down
1 change: 1 addition & 0 deletions libavcodec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ OBJS-$(CONFIG_OMX_H264_ENCODER) += omx.o
OBJS-$(CONFIG_OMX_MPEG4_DECODER) += omx.o
OBJS-$(CONFIG_OMX_MPEG4_ENCODER) += omx.o
OBJS-$(CONFIG_OMX_VC1_DECODER) += omx.o
OBJS-$(CONFIG_OMX_WMV3_DECODER) += omx.o

# parsers
OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o \
Expand Down
1 change: 1 addition & 0 deletions libavcodec/allcodecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (OMX_H264, omx_h264);
REGISTER_ENCDEC (OMX_MPEG4, omx_mpeg4);
REGISTER_DECODER(OMX_VC1, omx_vc1);
REGISTER_DECODER(OMX_WMV3, omx_wmv3);
REGISTER_DECODER(PAF_VIDEO, paf_video);
REGISTER_ENCDEC (PAM, pam);
REGISTER_ENCDEC (PBM, pbm);
Expand Down
25 changes: 24 additions & 1 deletion libavcodec/omx.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ static av_cold int omx_component_init(AVCodecContext *avctx, const char *role, i
in_port_params.format.video.eCompressionFormat = OMX_VIDEO_CodingMPEG4;
else if (avctx->codec->id == AV_CODEC_ID_H264)
in_port_params.format.video.eCompressionFormat = OMX_VIDEO_CodingAVC;
else if (avctx->codec->id == AV_CODEC_ID_VC1)
else if (avctx->codec->id == AV_CODEC_ID_VC1 || avctx->codec->id == AV_CODEC_ID_WMV3)
in_port_params.format.video.eCompressionFormat = OMX_VIDEO_CodingWMV;
}
in_port_params.format.video.nFrameWidth = avctx->width;
Expand Down Expand Up @@ -927,6 +927,7 @@ static av_cold int omx_decode_init(AVCodecContext *avctx)
role = "video_decoder.avc";
break;
case AV_CODEC_ID_VC1:
case AV_CODEC_ID_WMV3:
role = "video_decoder.vc1";
break;
default:
Expand Down Expand Up @@ -1297,3 +1298,25 @@ AVCodec ff_omx_vc1_decoder = {
.priv_class = &omx_vc1dec_class,
};
#endif

#if CONFIG_OMX_WMV3_DECODER
static const AVClass omx_wmv3dec_class = {
.class_name = "OpenMAX WMV3 decoder",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
};
AVCodec ff_omx_wmv3_decoder = {
.name = "omx_wmv3",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_WMV3,
.priv_data_size = sizeof(OMXCodecContext),
.init = omx_decode_init,
.decode = omx_decode_frame,
.close = omx_decode_end,
.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("OpenMAX WMV3 video decoder"),
.capabilities = CODEC_CAP_DELAY,
.priv_class = &omx_wmv3dec_class,
};
#endif

0 comments on commit cc09658

Please sign in to comment.