c->slice_stride = FFALIGN(avctx->width, 32);
switch (avctx->pix_fmt) {
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
c->planes = 3;
avctx->codec_tag = MKTAG('U', 'L', 'R', 'G');
original_format = UTVIDEO_RGB;
break;
- case PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGBA:
c->planes = 4;
avctx->codec_tag = MKTAG('U', 'L', 'R', 'A');
original_format = UTVIDEO_RGBA;
break;
- case PIX_FMT_YUV420P:
+ case AV_PIX_FMT_YUV420P:
if (avctx->width & 1 || avctx->height & 1) {
av_log(avctx, AV_LOG_ERROR,
"4:2:0 video requires even width and height.\n");
avctx->codec_tag = MKTAG('U', 'L', 'Y', '0');
original_format = UTVIDEO_420;
break;
- case PIX_FMT_YUV422P:
+ case AV_PIX_FMT_YUV422P:
if (avctx->width & 1) {
av_log(avctx, AV_LOG_ERROR,
"4:2:2 video requires even width.\n");
}
/* In case of RGB, mangle the planes to Ut Video's format */
- if (avctx->pix_fmt == PIX_FMT_RGBA || avctx->pix_fmt == PIX_FMT_RGB24)
+ if (avctx->pix_fmt == AV_PIX_FMT_RGBA || avctx->pix_fmt == AV_PIX_FMT_RGB24)
mangle_rgb_planes(c->slice_buffer, c->slice_stride, pic->data[0],
c->planes, pic->linesize[0], width, height);
/* Deal with the planes */
switch (avctx->pix_fmt) {
- case PIX_FMT_RGB24:
- case PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGBA:
for (i = 0; i < c->planes; i++) {
ret = encode_plane(avctx, c->slice_buffer[i] + 2 * c->slice_stride,
c->slice_buffer[i], c->slice_stride,
}
}
break;
- case PIX_FMT_YUV422P:
+ case AV_PIX_FMT_YUV422P:
for (i = 0; i < c->planes; i++) {
ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0],
pic->linesize[i], width >> !!i, height, &pb);
}
}
break;
- case PIX_FMT_YUV420P:
+ case AV_PIX_FMT_YUV420P:
for (i = 0; i < c->planes; i++) {
ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0],
pic->linesize[i], width >> !!i, height >> !!i,
.init = utvideo_encode_init,
.encode2 = utvideo_encode_frame,
.close = utvideo_encode_close,
- .pix_fmts = (const enum PixelFormat[]) {
- PIX_FMT_RGB24, PIX_FMT_RGBA, PIX_FMT_YUV422P,
- PIX_FMT_YUV420P, PIX_FMT_NONE
+ .pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_YUV422P,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("Ut Video"),
};