[FFmpeg-devel] [Ffmpeg-devel] [PATCH] video grab support VIDEO_PALETTE_RGB565
Michael Niedermayer
michaelni
Wed May 9 00:42:30 CEST 2007
Hi
On Tue, May 08, 2007 at 04:50:42PM +0800, yi li wrote:
> Hi,
>
> Made more changes accordingly. (And sorry for my late response due to
> holiday).
>
> >this would be more readable if things where vertically aligned like:
>
> >{.palette = VIDEO_PALETTE_RGB565, .depth = 16, .pix_fmt = PIX_FMT_BGR565},
> >{.palette = VIDEO_PALETTE_GREY , .depth = 8, .pix_fmt = PIX_FMT_GRAY8}
>
> >also i think the .palette, .depth, ... hurts readability more than it
> helps
>
> I copy the name from v4l header "linux/videodev.h" "struct video_picture"
> definition, and would like to keep them compatible.
what i meant was
{VIDEO_PALETTE_RGB565, 16, PIX_FMT_BGR565},
{VIDEO_PALETTE_GREY , 8, PIX_FMT_GRAY8 },
is more readable IMHO, but this is not a big issue, if you prefer iam fine
with leaving it with the .palette, .depth, .pix_fmt
>
> >>+ if (-1 != ioctl(video_fd, VIDIOCSPICT, &pict))
> >>+ break;
>
> >i think this should rather stay <0 instead of ==-1
>
> I made change in the new patch since I saw the similar "<0" usage in grab.c.
> However, "ioctl" mannual states that: "Upon successful completion, ioctl()
> shall return a value other than -1 that depends upon the STREAMS device
> control function. Otherwise, it shall return -1 and set errno to indicate
> the error."
what ioctl manual?
man ioctl says:
Usually, on success zero is returned. A few ioctl() requests use the
return value as an output parameter and return a nonnegative value on
success. On error, -1 is returned, and errno is set appropriately.
which would mean that both ==-1 and <0 should work ...
[...]
> +
trailing whitespace
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
No great genius has ever existed without some touch of madness. -- 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/20070509/72e31954/attachment.pgp>
More information about the ffmpeg-devel
mailing list