Mercurial > libavcodec.hg
comparison rawdec.c @ 11752:3ba304b8cbd2 libavcodec
Rename findPixelFormat() to find_pix_fmt().
Less ugly and more consistent with the FFmpeg predominant style.
author | stefano |
---|---|
date | Fri, 21 May 2010 23:19:45 +0000 |
parents | 378caf7b42ef |
children | 4c894b716948 |
comparison
equal
deleted
inserted
replaced
11751:378caf7b42ef | 11752:3ba304b8cbd2 |
---|---|
56 { PIX_FMT_RGB24, 24 }, | 56 { PIX_FMT_RGB24, 24 }, |
57 { PIX_FMT_ARGB, 32 }, | 57 { PIX_FMT_ARGB, 32 }, |
58 { PIX_FMT_NONE, 0 }, | 58 { PIX_FMT_NONE, 0 }, |
59 }; | 59 }; |
60 | 60 |
61 static enum PixelFormat findPixelFormat(const PixelFormatTag *tags, unsigned int fourcc) | 61 static enum PixelFormat find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc) |
62 { | 62 { |
63 while (tags->pix_fmt >= 0) { | 63 while (tags->pix_fmt >= 0) { |
64 if (tags->fourcc == fourcc) | 64 if (tags->fourcc == fourcc) |
65 return tags->pix_fmt; | 65 return tags->pix_fmt; |
66 tags++; | 66 tags++; |
71 static av_cold int raw_init_decoder(AVCodecContext *avctx) | 71 static av_cold int raw_init_decoder(AVCodecContext *avctx) |
72 { | 72 { |
73 RawVideoContext *context = avctx->priv_data; | 73 RawVideoContext *context = avctx->priv_data; |
74 | 74 |
75 if (avctx->codec_tag == MKTAG('r','a','w',' ')) | 75 if (avctx->codec_tag == MKTAG('r','a','w',' ')) |
76 avctx->pix_fmt = findPixelFormat(pixelFormatBpsMOV, avctx->bits_per_coded_sample); | 76 avctx->pix_fmt = find_pix_fmt(pixelFormatBpsMOV, avctx->bits_per_coded_sample); |
77 else if (avctx->codec_tag) | 77 else if (avctx->codec_tag) |
78 avctx->pix_fmt = findPixelFormat(ff_raw_pix_fmt_tags, avctx->codec_tag); | 78 avctx->pix_fmt = find_pix_fmt(ff_raw_pix_fmt_tags, avctx->codec_tag); |
79 else if (avctx->bits_per_coded_sample) | 79 else if (avctx->bits_per_coded_sample) |
80 avctx->pix_fmt = findPixelFormat(pixelFormatBpsAVI, avctx->bits_per_coded_sample); | 80 avctx->pix_fmt = find_pix_fmt(pixelFormatBpsAVI, avctx->bits_per_coded_sample); |
81 | 81 |
82 context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); | 82 context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); |
83 context->buffer = av_malloc(context->length); | 83 context->buffer = av_malloc(context->length); |
84 context->pic.pict_type = FF_I_TYPE; | 84 context->pic.pict_type = FF_I_TYPE; |
85 context->pic.key_frame = 1; | 85 context->pic.key_frame = 1; |