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

yi li liyi.dev
Wed May 9 06:46:43 CEST 2007


Fixed. Yes you are right. Your manual is "Linux programmer's manual".
I was using "Posix Programmer's manual".

-Yi

On 5/9/07, Michael Niedermayer <michaelni at gmx.at> wrote:
>
> 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
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grab.c.rgb565.3.patch
Type: text/x-patch
Size: 3430 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070509/c620cfe8/attachment.bin>



More information about the ffmpeg-devel mailing list