On Tue, Feb 22, 2005 at 01:07:41AM +0100, Gaubatz Patrick wrote:
> Hi all,
>
> as I'm tyring to program a little application for my VDR, which should
> simply work just as fbtv does except that fact that my application
> should be able to deinterlace with ffmpeg's help, I thought that
> DirectFB would probably just be perfect for my needs.
> I dug through the source of ffmpeg and finally found the following function:
>
> int avpicture_deinterlace( AVPicture *dst,
> const AVPicture *src,
> int pix_fmt,
> int width,
> int height )
>
> You can clearly see that I need an AVPicture, which simply looks like that:
>
> typedef struct AVPicture {
> uint8_t *data[4];
> int linesize[4];
> } AVPicture;
This is just a guess from seeing what AVPitcure struct contains.
void *ptr;
int pitch;
AVPicture dst;
surface->GetSize( surface, &w, &h );
surface->Lock( surface, DSLF_WRITE, &ptr, &pitch );
dst.data[0] = ptr;
dst.linesize[0] = pitch;
// For I420/YV12
dst.data[1] = dst.data[0] + h * pitch;
dst.data[2] = dst.data[1] + h/2 * pitch/2;
dst.linesize[1] = dst.linesize[2] = pitch/2;
avpicture_deinterlace( &dst, src, fmt, w, h );
surface->Unlock( surface );
Obviosly you need to get "src" and "fmt" from somewhere. "surface" can be
your output surface if you don't need to perform any other oprations on
the data.
> My "problem" now is, that I've no idea how to copy an AVPicture back to
> the framebuffer...
> By the way, I don't really know if it's a good idea but, as I haven't
> really figured out how to read data from /dev/video0 with ffmpeg's
> functions, I thought it could work like that:
>
> DirectFB-Videoprovider(reads from /dev/video0) -> "BufferSurface" ->
> "convert" the data from "BufferSurface" to an AVPicture -> deinterlace
> this AVPicture -> Blit the deinterlaced AVPicture onto the screen-Surface
For this scenario you simply lock the source surface with DSLF_READ and
fill another AVPicture struct with the results.
--
Ville Syrj�l�
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/
_______________________________________________
directfb-dev mailing list
[email protected]
http://www.directfb.org/cgi-bin/mailman/listinfo/directfb-dev