00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00027 #include "avcodec.h"
00028 #include "raw.h"
00029
00030 static av_cold int raw_init_encoder(AVCodecContext *avctx)
00031 {
00032 avctx->coded_frame = (AVFrame *)avctx->priv_data;
00033 avctx->coded_frame->pict_type = FF_I_TYPE;
00034 avctx->coded_frame->key_frame = 1;
00035 if(!avctx->codec_tag)
00036 avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt);
00037 return 0;
00038 }
00039
00040 static int raw_encode(AVCodecContext *avctx,
00041 unsigned char *frame, int buf_size, void *data)
00042 {
00043 return avpicture_layout((AVPicture *)data, avctx->pix_fmt, avctx->width,
00044 avctx->height, frame, buf_size);
00045 }
00046
00047 AVCodec rawvideo_encoder = {
00048 "rawvideo",
00049 CODEC_TYPE_VIDEO,
00050 CODEC_ID_RAWVIDEO,
00051 sizeof(AVFrame),
00052 raw_init_encoder,
00053 raw_encode,
00054 .long_name = NULL_IF_CONFIG_SMALL("raw video"),
00055 };