How to blit image bitmap on to SDL_Overlay?

Hi.

I have a network video stream that I receive and display in sdl window.
When pointer arrow of mouse passes on window surface it should display some image, like options for full screen or exit.

I’m creating overlay using SDL_CreateYUVoverlay function. And using libavcodec to decode the picture.
Then I set the rectangle and call SDL_DisplayYUVOverlay to display frame on screen.

I have tried to make another overlay on top of the frame but of course, it flickers.
I also tried with SDL_BlitSurface but it still flickers.

I understand that I should write the bitmap directly on the overlay surface before blitting it to screen but I don’t know
how to do it.

Should I convert YUV surface to RGB and then blit on to it and show it that way?

Does anyone knows how to do this, or point me to the right direction?

Thanks.

ELMA Kurtalj d.o.o. (ELMA Kurtalj ltd.)
Vitezi?eva 1a, 10000 Zagreb, Hrvatska (Viteziceva 1a, 10000 Zagreb, Croatia)
Tel: 01/3035555, Faks: 01/3035599 (Tel: ++385-1-3035555, Fax: ++385-1-3035599 )

Www:
www.elma.hr; shop.elma.hr

E-mail:
elma at elma.hr (elma at elma.hr)
pitanje at elma.hr (questions at elma.hr)
primjedbe at elma.hr (complaints at elma.hr)
prodaja at elma.hr (sales at elma.hr)
servis at elma.hr (servicing at elma.hr)
shop at elma.hr (shop at elma.hr)
skladiste at elma.hr (warehouse at elma.hr)

In general, for true hardware overlays you need to convert your surface to
YUV and merge it into the output before displaying.

See ya,
–SamOn Tue, May 26, 2009 at 5:16 AM, Dario wrote:

Hi.

I have a network video stream that I receive and display in sdl window.
When pointer arrow of mouse passes on window surface it should display some
image, like options for full screen or exit.

I’m creating overlay using SDL_CreateYUVoverlay function. And using
libavcodec to decode the picture.
Then I set the rectangle and call SDL_DisplayYUVOverlay to display frame on
screen.

I have tried to make another overlay on top of the frame but of course, it
flickers.
I also tried with SDL_BlitSurface but it still flickers.

I understand that I should write the bitmap directly on the overlay surface
before blitting it to screen but I don’t know
how to do it.

Should I convert YUV surface to RGB and then blit on to it and show it that
way?

Does anyone knows how to do this, or point me to the right direction?

Thanks.


ELMA Kurtalj d.o.o. (ELMA Kurtalj ltd.)

Vitezi?eva 1a, 10000 Zagreb, Hrvatska (Viteziceva 1a, 10000 Zagreb, Croatia)

Tel: 01/3035555, Faks: 01/3035599 (Tel: ++385-1-3035555, Fax: ++385-1-3035599 )

Www:
www.elma.hr; shop.elma.hr

E-mail:
elma at elma.hr (elma at elma.hr)
pitanje at elma.hr (questions at elma.hr)
primjedbe at elma.hr (complaints at elma.hr)
prodaja at elma.hr (sales at elma.hr)
servis at elma.hr (servicing at elma.hr)
shop at elma.hr (shop at elma.hr)
skladiste at elma.hr (warehouse at elma.hr)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

In general, for true hardware overlays you need to convert your surface to>YUV and merge it into the output before displaying.>See ya,>–SamHow can I convert SDL_Surface to YUV and how do I merge it?Does SDL supports this? By the way, I browsed this newsgroup for some time, and found thatexact thing I want to achive is called OSD as On Screen Display.But I didn’t found anything else on the subject, just bits and pieces,and nothing cencrete.Do you know where can I learn about the subject? Theory is enough butsome lame example would be perfect.Regards.DarioPS:Sorry about the signature but our mail server does that automaticallyon every sent mail and it’s annoying as hell. I’ll try to have it removed.

ELMA Kurtalj d.o.o. (ELMA Kurtalj ltd.)
Vitezi?eva 1a, 10000 Zagreb, Hrvatska (Viteziceva 1a, 10000 Zagreb, Croatia)
Tel: 01/3035555, Faks: 01/3035599 (Tel: ++385-1-3035555, Fax: ++385-1-3035599 )

Www:
www.elma.hr; shop.elma.hr

E-mail:
elma at elma.hr (elma at elma.hr)
pitanje at elma.hr (questions at elma.hr)
primjedbe at elma.hr (complaints at elma.hr)
prodaja at elma.hr (sales at elma.hr)
servis at elma.hr (servicing at elma.hr)
shop at elma.hr (shop at elma.hr)
skladiste at elma.hr (warehouse at elma.hr)

There’s an example of this in testoverlay.c in the test subdirectory of the
SDL source archive.

See ya!
–SamOn Wed, May 27, 2009 at 2:05 AM, Dario wrote:

In general, for true hardware overlays you need to convert your surface to
YUV and merge it into the output before displaying.

See ya,
–Sam

How can I convert SDL_Surface to YUV and how do I merge it?
Does SDL supports this?

By the way, I browsed this newsgroup for some time, and found that
exact thing I want to achive is called OSD as On Screen Display.
But I didn’t found anything else on the subject, just bits and pieces,
and nothing cencrete.

Do you know where can I learn about the subject? Theory is enough but
some lame example would be perfect.

Regards.
Dario

PS:
Sorry about the signature but our mail server does that automatically
on every sent mail and it’s annoying as hell. I’ll try to have it removed.


ELMA Kurtalj d.o.o. (ELMA Kurtalj ltd.)

Vitezi?eva 1a, 10000 Zagreb, Hrvatska (Viteziceva 1a, 10000 Zagreb, Croatia)

Tel: 01/3035555, Faks: 01/3035599 (Tel: ++385-1-3035555, Fax: ++385-1-3035599 )

Www:
www.elma.hr; shop.elma.hr

E-mail:
elma at elma.hr (elma at elma.hr)
pitanje at elma.hr (questions at elma.hr)
primjedbe at elma.hr (complaints at elma.hr)
prodaja at elma.hr (sales at elma.hr)
servis at elma.hr (servicing at elma.hr)
shop at elma.hr (shop at elma.hr)
skladiste at elma.hr (warehouse at elma.hr)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thanks Sam!
But I already figured it out. I found the conversion functions elsewere.
But I’ll for sure try this one’s too.
Thanks!

Dario.----- Original Message -----
From: Sam Lantinga
To: A list for developers using the SDL library. (includes SDL-announce)
Sent: Thursday, May 28, 2009 4:38 AM
Subject: Re: [SDL] How to blit image bitmap on to SDL_Overlay?

There’s an example of this in testoverlay.c in the test subdirectory of the SDL source archive.

See ya!
–Sam

On Wed, May 27, 2009 at 2:05 AM, Dario <@Dario> wrote:

In general, for true hardware overlays you need to convert your surface to>YUV and merge it into the output before displaying.>See ya,>–SamHow can I convert SDL_Surface to YUV and how do I merge it?Does SDL supports this? By the way, I browsed this newsgroup for some time, and found thatexact thing I want to achive is called OSD as On Screen Display.
But I didn’t found anything else on the subject, just bits and pieces,and nothing cencrete.Do you know where can I learn about the subject? Theory is enough butsome lame example would be perfect.Regards.DarioPS:Sorry about the signature but our mail server does that automaticallyon every sent mail and it’s annoying as hell. I’ll try to have it removed.


ELMA Kurtalj d.o.o. (ELMA Kurtalj ltd.)
Vitezi?eva 1a, 10000 Zagreb, Hrvatska (Viteziceva 1a, 10000 Zagreb, Croatia)
Tel: 01/3035555, Faks: 01/3035599 (Tel: ++385-1-3035555, Fax: ++385-1-3035599 )

Www:
www.elma.hr; shop.elma.hr

E-mail:
elma at elma.hr (elma at elma.hr)
pitanje at elma.hr (questions at elma.hr)
primjedbe at elma.hr (complaints at elma.hr)
prodaja at elma.hr (sales at elma.hr)
servis at elma.hr (servicing at elma.hr)
shop at elma.hr (shop at elma.hr)
skladiste at elma.hr (warehouse at elma.hr)


_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

ELMA Kurtalj d.o.o. (ELMA Kurtalj ltd.)
Vitezi?eva 1a, 10000 Zagreb, Hrvatska (Viteziceva 1a, 10000 Zagreb, Croatia)
Tel: 01/3035555, Faks: 01/3035599 (Tel: ++385-1-3035555, Fax: ++385-1-3035599 )

Www:
www.elma.hr; shop.elma.hr

E-mail:
elma at elma.hr (elma at elma.hr)
pitanje at elma.hr (questions at elma.hr)
primjedbe at elma.hr (complaints at elma.hr)
prodaja at elma.hr (sales at elma.hr)
servis at elma.hr (servicing at elma.hr)
shop at elma.hr (shop at elma.hr)
skladiste at elma.hr (warehouse at elma.hr)

Dario,
I’m not sure whether your OSD is the same as I understand. I know that from e.g. my video recorder.
I’m doing similar thing with:
http://code.google.com/p/sdl-layer/

Cheers
Phuoc

/_/_/_/_/_/_
www.huaonline.com
My Homepage is my Castle

By the way, I browsed

this newsgroup for some time, and found that
exact thing I want to achive is called OSD as On Screen
Display.

But I didn’t found anything else on the subject, just
bits and pieces,
and nothing cencrete.Do you know where can I
learn about the subject? Theory is enough but
some lame example would be perfect.

Regards.
Dario

  Need a Holiday? Win a $10,000 Holiday of your choice. Enter now.http://us.lrd.yahoo.com/_ylc=X3oDMTJxN2x2ZmNpBF9zAzIwMjM2MTY2MTMEdG1fZG1lY2gDVGV4dCBMaW5rBHRtX2xuawNVMTEwMzk3NwR0bV9uZXQDWWFob28hBHRtX3BvcwN0YWdsaW5lBHRtX3BwdHkDYXVueg--/SIG=14600t3ni/**http%3A//au.rd.yahoo.com/mail/tagline/creativeholidays/*http%3A//au.docs.yahoo.com/homepageset/%3Fp1=other%26p2=au%26p3=mailtagline> On Wed, May 27, 2009 at 2:05 AM, Dario <dmaljur at elma.hr> wrote: