[MPlayer-dev-eng] Patch: vo_shm - simple embedding vo

Flemming Frandsen ff at partyticket.net
Mon Sep 8 16:02:08 CEST 2003


I have a project where I want to play a movie as a texture in OpenGL in 
realtime, so naturally I turned to MPlayer, I copy+pasted from vo_tga 
and created a video out plugin that outputs frames to shared memory.

It doesn't use any locking, so it should be low-overhead for both 
mplayer and the consumer, but that also means that the consumer must 
have it's own framerate (which my opengl application does have).

It works by having the consumer set up a shared memory segment that 
holds the shmids of two frame buffers, vo_shm writes to the framebuffer 
with the lowest frame number and the consumer reads from the framebuffer 
with the higest frame number, that way they don't step on eachothers toes.

I've tested it and it works quite nicely, so here is the patch if you'd 
like to include it: http://dion.swamp.dk/dl/mplayer-1.0pre1-shm1.diff.gz

Any comments?

-- 
  Regards Flemming Frandsen - http://dion.swamp.dk
  PartyTicket.Net co founder & Yet Another Perl Hacker



More information about the MPlayer-dev-eng mailing list