PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Play a movie on Symbian

Hi all!

It is possible to play a movie on Symbian with Edge?
If not, do you know any way to do it?

Thanks.
Hi Nacho,

To play a movie in Edge you need to find a decoder library to load the movie file. There should be an mpeg-decoder library freely available on the internet.

To quickly play the video on an Edge surface you can lock the surface memory and access its data directly.
ok, thanks a lot.
Hi I'm currently porting libmpeg2 and building voddriver can you be more detailed regarding lock surface etc? I'm planning tou use EdgeLib for a demo and this information would be very usefull.
Hi Anxer,

You can lock the backbuffer (or any other surface) in OnNextFrame to draw the pixels of a decoded frame. Pass an E2DSURFACEINFO structure to get detailed information about the surface as described here:
http://www.edgelib.com/index.php?node=285&keyword=lock

The structure members itself are documented here:
http://www.edgelib.com/index.php?node=6 ... urfaceinfo

The pixelformat member of the structure for the backbuffer can be: EDSP_INDEXED8 (palette), EDSP_TRUE12 (0:4:4:4 RGB), EDSP_TRUE16 (5:6:5 RGB) and EDSP_TRUE32 (0:8:8:8 RGB). The bufferoffset, xpitch and ypitch members are used for rotated displays and a few old Pocket PC models with unusual display configurations.

Here is a (unoptimized) sample for filling the backbuffer with black pixels:
Code:

E2DSURFACEINFO lockinfo;
unsigned char *bufptr;
bufptr = display->buffer.Lock(&lockinfo);
if (bufptr)
{
int x, y;
bufptr += lockinfo.bufferoffset;
for (y = 0; y < display->buffer.GetHeight(); y++)
{
for (x = 0; x < display->buffer.GetWidth(); x++)
{
if (lockinfo.pixelformat == EDSP_INDEXED8)
*bufptr = 0;
else if (lockinfo.pixelformat == EDSP_TRUE12 || lockinfo.pixelformat == EDSP_TRUE16)
*((unsigned short *)(bufptr)) = 0;
else if (lockinfo.pixelformat == EDSP_TRUE32)
*((unsigned long *)(bufptr)) = 0;
bufptr += lockinfo.xpitch;
}
bufptr += lockinfo.ypitch - display->buffer.GetWidth() * lockinfo.xpitch;
}
display->buffer.Unlock();
}