static av_cold int xwd_encode_init(AVCodecContext *avctx)
{
- avctx->coded_frame = avcodec_alloc_frame();
+ avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
const AVFrame *p, int *got_packet)
{
enum AVPixelFormat pix_fmt = avctx->pix_fmt;
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
uint32_t pixdepth, bpp, bpad, ncolors = 0, lsize, vclass, be = 0;
uint32_t rgb[3] = { 0 }, bitorder = 0;
uint32_t header_size;
int i, out_size, ret;
uint8_t *ptr, *buf;
- pixdepth = av_get_bits_per_pixel(&av_pix_fmt_descriptors[pix_fmt]);
- if (av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_BE)
+ pixdepth = av_get_bits_per_pixel(desc);
+ if (desc->flags & AV_PIX_FMT_FLAG_BE)
be = 1;
switch (pix_fmt) {
case AV_PIX_FMT_ARGB:
AVCodec ff_xwd_encoder = {
.name = "xwd",
+ .long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_XWD,
.init = xwd_encode_init,
AV_PIX_FMT_PAL8,
AV_PIX_FMT_MONOWHITE,
AV_PIX_FMT_NONE },
- .long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"),
};