• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavcodec/rawenc.c

Go to the documentation of this file.
00001 /*
00002  * Raw Video Encoder
00003  * Copyright (c) 2001 Fabrice Bellard
00004  *
00005  * This file is part of FFmpeg.
00006  *
00007  * FFmpeg is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * FFmpeg is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with FFmpeg; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
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 };

Generated on Sat Feb 16 2013 09:23:13 for ffmpeg by  doxygen 1.7.1