diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-05-28 11:33:28 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-05-28 11:33:28 +0000 |
commit | e2d09b65e8166d6f3880bdf7195069e09d470a99 (patch) | |
tree | 8361c1bb427d7d3fe4dfc8f85af043e15099d34f | |
parent | bf1310c7b10decb50ce32ff0d2ae44fafc0e1740 (diff) | |
download | ffmpeg-e2d09b65e8166d6f3880bdf7195069e09d470a99.tar.gz |
set coded_frame
Originally committed as revision 13492 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/targaenc.c | 12 | ||||
-rw-r--r-- | libavcodec/tiffenc.c | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c index 90dc8cba61..35e667996d 100644 --- a/libavcodec/targaenc.c +++ b/libavcodec/targaenc.c @@ -21,6 +21,10 @@ #include "avcodec.h" #include "rle.h" +typedef struct TargaContext { + AVFrame picture; +} TargaContext; + /** * RLE compress the image, with maximum size of out_size * @param outbuf Output buffer @@ -135,6 +139,12 @@ static int targa_encode_frame(AVCodecContext *avctx, static av_cold int targa_encode_init(AVCodecContext *avctx) { + TargaContext *s = avctx->priv_data; + + avcodec_get_frame_defaults(&s->picture); + s->picture.key_frame= 1; + avctx->coded_frame= &s->picture; + return 0; } @@ -142,7 +152,7 @@ AVCodec targa_encoder = { .name = "targa", .type = CODEC_TYPE_VIDEO, .id = CODEC_ID_TARGA, - .priv_data_size = 0, + .priv_data_size = sizeof(TargaContext), .init = targa_encode_init, .encode = targa_encode_frame, .pix_fmts= (enum PixelFormat[]){PIX_FMT_BGR24, PIX_FMT_RGB555, PIX_FMT_GRAY8, PIX_FMT_NONE}, diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index c2b942f1d9..1ec27efe20 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -222,6 +222,7 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf, *p = *pict; p->pict_type = FF_I_TYPE; p->key_frame = 1; + avctx->coded_frame= &s->picture; s->compr = TIFF_PACKBITS; if (avctx->compression_level == 0) { |