aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-07-21 01:21:06 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-07-21 01:21:06 +0000
commit627c50b7fc3c9634921c90cd7bfdde02fd5622bc (patch)
treee2e6b54b46a87aed0781497a2e6578ff06b8be38
parentf1dc14a9fa364fa0532bc38103cfaab6d4161da8 (diff)
downloadffmpeg-627c50b7fc3c9634921c90cd7bfdde02fd5622bc.tar.gz
raw rgb support
Originally committed as revision 3330 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/raw.c8
-rw-r--r--libavformat/avienc.c1
2 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index 8c554c41c5..b6fe0534ef 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -83,6 +83,14 @@ static int raw_init_decoder(AVCodecContext *avctx)
if (avctx->codec_tag)
avctx->pix_fmt = findPixelFormat(avctx->codec_tag);
+ else if (avctx->bits_per_sample){
+ switch(avctx->bits_per_sample){
+ case 15: avctx->pix_fmt= PIX_FMT_RGB555; break;
+ case 16: avctx->pix_fmt= PIX_FMT_RGB565; break;
+ case 24: avctx->pix_fmt= PIX_FMT_BGR24 ; break;
+ case 32: avctx->pix_fmt= PIX_FMT_RGBA32; break;
+ }
+ }
context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
context->buffer = av_malloc(context->length);
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 1c47760627..1306efeb2d 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -164,6 +164,7 @@ const CodecTag codec_bmp_tags[] = {
{ CODEC_ID_4XM, MKTAG('4', 'X', 'M', 'V') },
{ CODEC_ID_FLV1, MKTAG('F', 'L', 'V', '1') },
{ CODEC_ID_SVQ1, MKTAG('s', 'v', 'q', '1') },
+ { CODEC_ID_RAWVIDEO, 0 },
{ 0, 0 },
};