[Ffmpeg-devel] [PATCH] video grab support VIDEO_PALETTE_RGB565

Michael Niedermayer michaelni
Sun Apr 29 11:20:04 CEST 2007


Hi

On Sun, Apr 29, 2007 at 03:20:03PM +0800, yi li wrote:
> Hi,
> 
> A small patch for libavformat/grab.c to make it support v4l device with
> "VIDEO_PALETTE_RGB565" format.
> Any comments?
> 
> Regards,
> 
> -Yi

> --- grab.c.orig	2007-04-29 15:14:43.000000000 +0800
> +++ grab.c	2007-04-29 15:13:36.000000000 +0800
> @@ -174,8 +174,13 @@
>                      pict.palette=VIDEO_PALETTE_GREY;
>                      pict.depth=8;
>                      ret = ioctl(video_fd, VIDIOCSPICT, &pict);
> -                    if (ret < 0)
> -                        goto fail1;
> +                    if (ret < 0) {
> +			pict.palette=VIDEO_PALETTE_RGB565;
> +    			pict.depth=16;
> +			ret = ioctl(video_fd, VIDIOCSPICT, &pict);
> +			if (ret < 0)
> +                        	goto fail1;
> +		    }
>                  }

tabs are forbidden in svn
rgb565 should be checked before gray
and ideally the whole should be simplified, a simple table with 
VIDEO_PALETTE_*, depth, pix_fmt and frame_size factor could be used

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070429/8ab0bb47/attachment.pgp>



More information about the ffmpeg-devel mailing list