Hardware Overlays in OpenGL?

Started by
7 comments, last by SteveC 21 years, 11 months ago
I''ve looked around for information on this and couldn''t find anything obvious relating to this. Although I did see the article on playing an AVI file using OpenGL, I''m relatively certain that''s not what I''m looking for. DirectX 7 Had the ability to create special overlay surfaces if the video hardware supported it. This overlay surface is composited with the primary surface by the hardware. Some driver implementations also supported YCbCr ( YUYV ) pixel formats. Is there a way to do this with OpenGL?
Advertisement
Its one if nehe''s tutorials, round 27 i think
http://nehe.gamedev.net/
"I am a donut! Ask not how many tris/batch, but rather how many batches/frame!" -- Matthias Wloka & Richard Huddy, (GDC, DirectX 9 Performance)

http://www.silvermace.com/ -- My personal website
Thanks for the tip.

I looked on the nehe site and found the Playing an AVI file - which indicated how to do a similar thing, but is not exactly what I need.

I want to be able to access video memory and the hardware feature for an overlay.

Are there any other websites I can look at?
WGL_ARB_pixel_format

http://uk.geocities.com/sloppyturds/gotterdammerung.html
opengl does not have access to 2d hardware accelerated stuff like that. it is designed to be a cross platform api, and thus needs to abstract away more things then dx. the closest you can get is using a YUV texture format, and since you ussualy redraw the screen anyway, you redraw the texture and scene. if this does not suit you, then use opengl for 3d stuff while using directdraw for overlay support. this is possible because you dont need exclusive hardware control for overlays to work correctly.

opengl is not designed for direct video access, neither is d3d. if you want that use directdraw. in opengl.d3d you instead create and modify textures which you draw as quads on the screen.

now on to why you need the overlay, please explain further to what you are doing. if you are expecting to read from vram, then forget it. its too slow and not what overlays are for. it really sounds to me that you are a bit lost and confused at what overlays are meant for. they are designed with streaming video content that uses YUV format. the app would place the yuv data on the surface and the hardware converts it to rgb for display on the screen NOT for you to read. furthermore many newer cards contain partial DVD acceleration which means the card can decode more, thus the app is just sending more raw data insteda of decoded data. in no way are you supposed to read from the surface to get or change the pixels of the video.
Thanks for the info a person.

However, I am not lost or confused about what I am trying to do.

This is, in fact for playing back YCbCr ( aka YUYV ) decompressed or uncompressed video data. And I am only trying to WRITE the data to the buffer.

So this is the exact application.

Whether or not I write directly to the video memory may be more a bit of semantics. I need a separate pixel buffer that becomes an overlay - how exactly that is accomplished isn't really an issue.

The only reason I ask is I am trying to find out alternative ways of doing this on MacOSX. Currently I'm using Quicktime - which has a good deal of overhead.

On Windows, the code uses the DirectX overlays.

again, thanks for the info a person - it was helpful.

Is there a cross-platform approach for doing this?


[edited by - SteveC on April 30, 2002 10:58:10 AM]
excuse me, if i''m completely oblivious to what you mean by overlays, but Windows has the function wglCreateLayerContext.

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.
the only way i can think of is using a yuvu texture when supported by the video hardware. actually decoding of videos is unfortunatly not too cross platform. what movie format are you trying to play? since macosx is basically *nix you could look into some of the libraries that they use. smacker is a cross platform codec that may give you the yuvu data for use on the opengl texture surface. while i dont use it, it may help you http://www.radgametools.com

alos look intp things like mpeglib http://mpeglib.sourceforge.net/

just remebmer, mpeglib is gpl''d and thus opens your entire app. this may or may not be acceptable to you.
thanks again a person - I''ll look into those possibilities.

We actually decode several types of video formats - DV25, DV50, MPEG I-frame, but this all happens at an earlier stage of the pipeline.

Essentially we are given uncompressed data to be displayed on the screen.

Yeah, GPL is not an option...

This topic is closed to new replies.

Advertisement