Hello,

im totally confused. I try to write a piece of code, which reads
images from a video stream and provide them in a buffer as ordinary,
uncompressed one-byte-per color RGB images, which then can be used as
OpenGL textures.

The code, which does the frame-reading is (_width=_height=256>0)

-------------------- cut ---------------------
 cimage_orig = _avistream->GetFrame();
 // create RGB-CImage if not yet created
 if(cimage == 0){
   BitmapInfo *bi = new BitmapInfo();
   bi->biSize=sizeof(BITMAPINFOHEADER);
   bi->biWidth=_width;
   bi->biHeight=_height;
   bi->biPlanes=1;
   bi->biBitCount=24;
   bi->biCompression=BI_RGB;
   bi->biSizeImage=_width * _height * 3;
   bi->biXPelsPerMeter=0;
   bi->biYPelsPerMeter=0;
   bi->biClrUsed=0;
   bi->biClrImportant=0;
   // hold the new created CImage zu Release it in the destructor
   cimage = new CImage(bi);
 }
 cimage->Convert(cimage_orig);
 cimage->ByteSwap();
 memcpy(_buffer, cimage->Data(), _width * _height * 3);
-------------------- cut ---------------------

So the frame will be read from the stream and the CImage to an RGB
24-Bit image and ByteSwaped, to bring the colors really in the order
R->G->B. 

This works fine with the newest version of avifile and the
Windows-dlls installed, but in SuSE 8.1 (which includes
avifile-0.7.7_20020523) some decoders produces images that are upside
down, but in the right direction if i play the movie with aviplay.

Taking "Indeo(r) Video 5.04"as an example, in both cases avifile uses
ir50_32.dll to decode and cimage_orig is in the format 256x-256,
Direction=0, IsRGB=1 Bpp=24. So, what is the magic image-attribute
with which aviplay in avifile-0.7.7_20020523 can detect, that it has
to flip the image?

        thanks for reading,    Torsten Blank

-- 
Awaron AG, Steinh�userstrasse 12, D-76135 Karlsruhe
Tel: 0721/15 109-0    Fax: 0721/15 109-99

_______________________________________________
Avifile mailing list
[EMAIL PROTECTED]
http://prak.org/mailman/listinfo/avifile

Reply via email to