X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fflvdec.c;h=29d680849dd1e33edb4432f91fcc1c0f531d3383;hb=4424fe9c029ccefc5868823b4967c792e51487f3;hp=b21a9e4a341881249e7e0e81ed3eaf130b164f20;hpb=0fd0ef7947ad31b2e1b9506cb70d85dcfdf6cba6;p=ffmpeg diff --git a/libavcodec/flvdec.c b/libavcodec/flvdec.c index b21a9e4a341..29d680849dd 100644 --- a/libavcodec/flvdec.c +++ b/libavcodec/flvdec.c @@ -1,25 +1,26 @@ /* * FLV decoding. - * This file is part of FFmpeg. + * This file is part of Libav. * - * FFmpeg is free software; you can redistribute it and/or + * Libav 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. * - * FFmpeg is distributed in the hope that it will be useful, + * Libav 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 FFmpeg; if not, write to the Free Software + * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "mpegvideo.h" #include "h263.h" #include "flv.h" +#include "libavutil/imgutils.h" void ff_flv2_decode_ac_esc(GetBitContext *gb, int *level, int *run, int *last){ int is11 = get_bits1(gb); @@ -82,15 +83,15 @@ int ff_flv_decode_picture_header(MpegEncContext *s) width = height = 0; break; } - if(avcodec_check_dimensions(s->avctx, width, height)) + if(av_image_check_size(width, height, 0, s->avctx)) return -1; s->width = width; s->height = height; - s->pict_type = FF_I_TYPE + get_bits(&s->gb, 2); - s->dropable= s->pict_type > FF_P_TYPE; + s->pict_type = AV_PICTURE_TYPE_I + get_bits(&s->gb, 2); + s->dropable= s->pict_type > AV_PICTURE_TYPE_P; if (s->dropable) - s->pict_type = FF_P_TYPE; + s->pict_type = AV_PICTURE_TYPE_P; skip_bits1(&s->gb); /* deblocking flag */ s->chroma_qscale= s->qscale = get_bits(&s->gb, 5); @@ -108,7 +109,7 @@ int ff_flv_decode_picture_header(MpegEncContext *s) if(s->avctx->debug & FF_DEBUG_PICT_INFO){ av_log(s->avctx, AV_LOG_DEBUG, "%c esc_type:%d, qp:%d num:%d\n", - s->dropable ? 'D' : av_get_pict_type_char(s->pict_type), s->h263_flv-1, s->qscale, s->picture_number); + s->dropable ? 'D' : av_get_picture_type_char(s->pict_type), s->h263_flv-1, s->qscale, s->picture_number); } s->y_dc_scale_table= @@ -117,16 +118,15 @@ int ff_flv_decode_picture_header(MpegEncContext *s) return 0; } -AVCodec flv_decoder = { - "flv", - AVMEDIA_TYPE_VIDEO, - CODEC_ID_FLV1, - sizeof(MpegEncContext), - ff_h263_decode_init, - NULL, - ff_h263_decode_end, - ff_h263_decode_frame, - CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1, +AVCodec ff_flv_decoder = { + .name = "flv", + .type = AVMEDIA_TYPE_VIDEO, + .id = CODEC_ID_FLV1, + .priv_data_size = sizeof(MpegEncContext), + .init = ff_h263_decode_init, + .close = ff_h263_decode_end, + .decode = ff_h263_decode_frame, + .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1, .max_lowres= 3, .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"), .pix_fmts= ff_pixfmt_list_420,