c->keyint = 0;
else
c->keyint++;
- p->pict_type= keyframe ? FF_I_TYPE : FF_P_TYPE;
+ p->pict_type= keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
p->key_frame= keyframe;
return dst - buf;
if (av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0) {
return -1;
}
+ if((avctx->width&3) || (avctx->height&3)){
+ av_log(avctx, AV_LOG_ERROR, "width and height must be multiplies of 4\n");
+ return -1;
+ }
avcodec_get_frame_defaults(&c->pic);
avctx->coded_frame = (AVFrame*)&c->pic;
}
AVCodec ff_msvideo1_encoder = {
- "msvideo1",
- AVMEDIA_TYPE_VIDEO,
- CODEC_ID_MSVIDEO1,
- sizeof(Msvideo1EncContext),
- encode_init,
- encode_frame,
- encode_end,
+ .name = "msvideo1",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = CODEC_ID_MSVIDEO1,
+ .priv_data_size = sizeof(Msvideo1EncContext),
+ .init = encode_init,
+ .encode = encode_frame,
+ .close = encode_end,
.pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB555, PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("Microsoft Video-1"),
};