* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+#include "libavutil/intreadwrite.h"
#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
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;
}
.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},
- .long_name= "Truevision Targa image",
+ .long_name= NULL_IF_CONFIG_SMALL("Truevision Targa image"),
};