Mercurial > libavcodec.hg
comparison raw.c @ 2341:d9c9b42767da libavcodec
fix image stream copy
author | michael |
---|---|
date | Mon, 08 Nov 2004 23:36:32 +0000 |
parents | 10d28761f78c |
children | 24d3a50d1b8b |
comparison
equal
deleted
inserted
replaced
2340:a2073e67cb19 | 2341:d9c9b42767da |
---|---|
62 tags++; | 62 tags++; |
63 } | 63 } |
64 return PIX_FMT_YUV420P; | 64 return PIX_FMT_YUV420P; |
65 } | 65 } |
66 | 66 |
67 static unsigned int findFourCC(int fmt) | 67 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat fmt) |
68 { | 68 { |
69 const PixelFormatTag * tags = pixelFormatTags; | 69 const PixelFormatTag * tags = pixelFormatTags; |
70 while (tags->pix_fmt >= 0) { | 70 while (tags->pix_fmt >= 0) { |
71 if (tags->pix_fmt == fmt) | 71 if (tags->pix_fmt == fmt) |
72 return tags->fourcc; | 72 return tags->fourcc; |
150 { | 150 { |
151 avctx->coded_frame = (AVFrame *)avctx->priv_data; | 151 avctx->coded_frame = (AVFrame *)avctx->priv_data; |
152 avctx->coded_frame->pict_type = FF_I_TYPE; | 152 avctx->coded_frame->pict_type = FF_I_TYPE; |
153 avctx->coded_frame->key_frame = 1; | 153 avctx->coded_frame->key_frame = 1; |
154 if(!avctx->codec_tag) | 154 if(!avctx->codec_tag) |
155 avctx->codec_tag = findFourCC(avctx->pix_fmt); | 155 avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt); |
156 return 0; | 156 return 0; |
157 } | 157 } |
158 | 158 |
159 static int raw_encode(AVCodecContext *avctx, | 159 static int raw_encode(AVCodecContext *avctx, |
160 unsigned char *frame, int buf_size, void *data) | 160 unsigned char *frame, int buf_size, void *data) |