[Ffmpeg-devel] [PATCH] nuv/MythTV Video/RTjpeg support
Michael Niedermayer
michaelni
Mon Mar 27 14:06:52 CEST 2006
Hi
On Mon, Mar 27, 2006 at 12:58:32PM +0200, Reimar D?ffinger wrote:
> Hi,
> attached patch adds support for these to ffmpeg.
> Compared to the last version I sent a long time ago, this one has a few
> additional comments, does some extra sanity checks in the demuxer and
> should properly support audio- and video-only files and make it easy to
> add support for text streams (this is not well tested since I
> do not have any samples for these cases).
> Some additional testing would be nice if you have any videos in this
> format, otherwise I hope it is okay for inclusion.
>
> Greetings,
> Reimar D?ffinger
[...]
> +/**
> + * \brief copy frame data from buffer to AVFrame, handling stride.
> + * \param f destination AVFrame
> + * \param src source buffer, does not use any line-stride
> + * \param width width of the video frame
> + * \param height height of the video frame
> + */
> +static void copy_frame(AVFrame *f, uint8_t *src,
> + int width, int height) {
> + int i;
> + uint8_t *dst = f->data[0];
> + for (i = height; i > 0; i--) {
> + memcpy(dst, src, width);
> + src += width;
> + dst += f->linesize[0];
> + }
> + width /= 2;
> + height /= 2;
> + dst = f->data[1];
> + for (i = height; i > 0; i--) {
> + memcpy(dst, src, width);
> + src += width;
> + dst += f->linesize[1];
> + }
> + dst = f->data[2];
> + for (i = height; i > 0; i--) {
> + memcpy(dst, src, width);
> + src += width;
> + dst += f->linesize[2];
> + }
> +}
what about using avpicture_fill() and img_copy()
except that patch looks ok
[...]
--
Michael
More information about the ffmpeg-devel
mailing list