AVI player

HI all,
I would like to make avi player with SDL library.
I read some document about SDL and AVI format, but what’s next?
Could you teach me how to make it?
I just want to know how to play AVI format file.
Please help me.

Thanks.
John.

HI all,
I would like to make avi player with SDL library.
I read some document about SDL and AVI format, but what’s next?
Could you teach me how to make it?
I just want to know how to play AVI format file.
Please help me.

Thanks.
John.

well my suggestion is to browse the mplayer code
( search for sdl video driver )
www.mplayerhq.hu/homepage/
bye
@pamashoid_at_poczta

This line of code
components = int (texmap->format.BitsPerPixel/32);

gives me this error message in Dev-C++?

860 C:\Documents and
Settings\Jakob\Programering\test\stencil_shadow\wavefront.h request for
member
BitsPerPixel' in texmap->SDL_Surface::format’, which is of
non-aggregate type `

What is an “non-aggregate type”?

This is the entire function:
(the printf() calls are for debugging only.)
GLuint ObjLoadTexture(const char * filename)
{
SDL_Surface * texmap;
GLuint tname;
GLenum format;
GLuint width, height, components;

 printf("\nObjLoadTexture() start\n");

 texmap = IMG_Load(filename);

 if(texmap == NULL)
 {
     printf("ERROR: File %s nor found!", filename);
     return 0;
 }

 printf("1 ");


 glGenTextures(1, &tname);
 glBindTexture(GL_TEXTURE_2D, tname);

 ObjCheckError("generated texture name");

 printf("2 ");


 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

 ObjCheckError("Texture parameters");

 printf("3 ");
 components = int (texmap->format.BitsPerPixel/32);


 //Decide what colorformat to use
 if(components==4)
     format = GL_RGBA;
 else if(components==3)
     format = GL_RGB;
 else if(components==2)
     format = GL_LUMINANCE_ALPHA;
 else if(components==1)
     format = GL_LUMINANCE;
 else
 {
     printf("Odd number of componentsin image, %i\n", components);
 }

 width = texmap->w;
 height = texmap->h;

 printf("Width: %i Height: %i Coomponents: %i\n",width, height,  

components);
printf("3.5 ");

 glTexImage2D(GL_TEXTURE_2D, 0, components, width, height,
         0, format, GL_UNSIGNED_BYTE, texmap->pixels);

 printf("4 ");

 ObjCheckError("uppload texture");

 SDL_FreeSurface(texmap);

 printf("5 ");

 printf("ObjLoadTexture() end");
 return tname;

}

void ObjCheckError(const char * point)
{
GLenum msg;

 msg = glGetError();

 if(msg != GL_NO_ERROR)
 {
     printf("CObjectModel Error GL: %s at %s.\n",
             gluErrorString(msg),point);
 }

}

Jakob Eklund wrote:

This line of code
components = int (texmap->format.BitsPerPixel/32);

gives me this error message in Dev-C++?

860 C:\Documents and
Settings\Jakob\Programering\test\stencil_shadow\wavefront.h request
for member
BitsPerPixel' in texmap->SDL_Surface::format’, which is of
non-aggregate type `

That’s way off topic, but here we go :
It means that texmap->format is a pointer, and you try to access its
BitsPerPixel member as if it was a structure.
So the compiler disagrees, which I can understand.

What is an “non-aggregate type”?

A non-aggregate type is a basic C type like pointers, ints, floats, chars,…
An aggregate type is a complex type, where you “aggregate” other types
to create a structure (in C that’s a “struct”).

Stephane