| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Targa (.tga) image decoder | 2 * Targa (.tga) image decoder |
| 3 * Copyright (c) 2006 Konstantin Shishkov | 3 * Copyright (c) 2006 Konstantin Shishkov |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 avctx->pix_fmt = PIX_FMT_RGB32; | 139 avctx->pix_fmt = PIX_FMT_RGB32; |
| 140 break; | 140 break; |
| 141 default: | 141 default: |
| 142 av_log(avctx, AV_LOG_ERROR, "Bit depth %i is not supported\n", s->bpp); | 142 av_log(avctx, AV_LOG_ERROR, "Bit depth %i is not supported\n", s->bpp); |
| 143 return -1; | 143 return -1; |
| 144 } | 144 } |
| 145 | 145 |
| 146 if(s->picture.data[0]) | 146 if(s->picture.data[0]) |
| 147 avctx->release_buffer(avctx, &s->picture); | 147 avctx->release_buffer(avctx, &s->picture); |
| 148 | 148 |
| 149 if(av_check_image_size(w, h, 0, avctx)) | 149 if(av_image_check_size(w, h, 0, avctx)) |
| 150 return -1; | 150 return -1; |
| 151 if(w != avctx->width || h != avctx->height) | 151 if(w != avctx->width || h != avctx->height) |
| 152 avcodec_set_dimensions(avctx, w, h); | 152 avcodec_set_dimensions(avctx, w, h); |
| 153 if(avctx->get_buffer(avctx, p) < 0){ | 153 if(avctx->get_buffer(avctx, p) < 0){ |
| 154 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 154 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 155 return -1; | 155 return -1; |
| 156 } | 156 } |
| 157 if(flags & 0x20){ | 157 if(flags & 0x20){ |
| 158 dst = p->data[0]; | 158 dst = p->data[0]; |
| 159 stride = p->linesize[0]; | 159 stride = p->linesize[0]; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 CODEC_ID_TARGA, | 248 CODEC_ID_TARGA, |
| 249 sizeof(TargaContext), | 249 sizeof(TargaContext), |
| 250 targa_init, | 250 targa_init, |
| 251 NULL, | 251 NULL, |
| 252 targa_end, | 252 targa_end, |
| 253 decode_frame, | 253 decode_frame, |
| 254 CODEC_CAP_DR1, | 254 CODEC_CAP_DR1, |
| 255 NULL, | 255 NULL, |
| 256 .long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"), | 256 .long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"), |
| 257 }; | 257 }; |
| OLD | NEW |