diff options
Diffstat (limited to 'libavcodec/xwdenc.c')
-rw-r--r-- | libavcodec/xwdenc.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libavcodec/xwdenc.c b/libavcodec/xwdenc.c index c9a2a56..fac3d0b 100644 --- a/libavcodec/xwdenc.c +++ b/libavcodec/xwdenc.c @@ -3,20 +3,20 @@ * * Copyright (c) 2012 Paul B Mahol * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -133,6 +133,11 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, bpad = 8; ncolors = 256; break; + case AV_PIX_FMT_GRAY8: + bpp = 8; + bpad = 8; + vclass = XWD_STATIC_GRAY; + break; case AV_PIX_FMT_MONOWHITE: be = 1; bitorder = 1; @@ -149,10 +154,8 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, header_size = XWD_HEADER_SIZE + WINDOW_NAME_SIZE; out_size = header_size + ncolors * XWD_CMAP_SIZE + avctx->height * lsize; - if ((ret = ff_alloc_packet(pkt, out_size)) < 0) { - av_log(avctx, AV_LOG_ERROR, "output buffer too small\n"); + if ((ret = ff_alloc_packet2(avctx, pkt, out_size)) < 0) return ret; - } buf = pkt->data; avctx->coded_frame->key_frame = 1; @@ -246,6 +249,7 @@ AVCodec ff_xwd_encoder = { AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, AV_PIX_FMT_PAL8, + AV_PIX_FMT_GRAY8, AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"), |