Log in

View Full Version : xvid_image_t


Tom_FarOneEye
5th December 2006, 20:26
Hi,

I'm new to all this xvid stuff, but I'm trying to write a very simple application that can play an xvid file.
I'm using Qt and a combination of C and C++ (C since the whole xvi d thing is C) and working in Windows XP (yeah I know Linux is easier when it comes to xvid)
Now I've got a problem...

When decoding the avi file I get an xvid_dec_frame_t that contains a decoded image, right? Now how do I get the image out of the xvid_image_t to show it in the gui? I need something like an image file or something that I can put in a QImage or a QPixmap.

grt,
Tom

Kopernikus
6th December 2006, 11:41
xvid_image_t consists of four unsigned char* plane and four ints stride.

plane holds the image data (plane[0] Y plane[1] U plane[2] V plane[3] probably alpha, but unused afaik), and the pixel at x-th column and y-th row is at position (plane[z])[y*stride[z] + x]

Tom_FarOneEye
11th December 2006, 15:31
Ok thx, in the mean time I've got it working, I can just give plane[0] as a parameter to a QImage constructor, and it creates the picture I need to have.