comparison raw.c @ 2133:29f774bb85fe libavcodec

raw rgb support
author michael
date Wed, 21 Jul 2004 01:21:06 +0000
parents 141a9539e270
children caacb3f9ee51
comparison
equal deleted inserted replaced
2132:572634dec306 2133:29f774bb85fe
81 { 81 {
82 RawVideoContext *context = avctx->priv_data; 82 RawVideoContext *context = avctx->priv_data;
83 83
84 if (avctx->codec_tag) 84 if (avctx->codec_tag)
85 avctx->pix_fmt = findPixelFormat(avctx->codec_tag); 85 avctx->pix_fmt = findPixelFormat(avctx->codec_tag);
86 else if (avctx->bits_per_sample){
87 switch(avctx->bits_per_sample){
88 case 15: avctx->pix_fmt= PIX_FMT_RGB555; break;
89 case 16: avctx->pix_fmt= PIX_FMT_RGB565; break;
90 case 24: avctx->pix_fmt= PIX_FMT_BGR24 ; break;
91 case 32: avctx->pix_fmt= PIX_FMT_RGBA32; break;
92 }
93 }
86 94
87 context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); 95 context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
88 context->buffer = av_malloc(context->length); 96 context->buffer = av_malloc(context->length);
89 context->p = context->buffer; 97 context->p = context->buffer;
90 context->pic.pict_type = FF_I_TYPE; 98 context->pic.pict_type = FF_I_TYPE;