# HG changeset patch # User michael # Date 1211974408 0 # Node ID 7cf90c252373b1e2025114e2f17e48eb6286ad5f # Parent c1b722b7964971868726702a08f6a90129147b83 set coded_frame diff -r c1b722b79649 -r 7cf90c252373 targaenc.c --- a/targaenc.c Wed May 28 09:20:59 2008 +0000 +++ b/targaenc.c Wed May 28 11:33:28 2008 +0000 @@ -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 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 @@ .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 -r c1b722b79649 -r 7cf90c252373 tiffenc.c --- a/tiffenc.c Wed May 28 09:20:59 2008 +0000 +++ b/tiffenc.c Wed May 28 11:33:28 2008 +0000 @@ -222,6 +222,7 @@ *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) {