SDL to display video!

hi all

does SDL display YUV video directly, or it convert it
to RGB and then display it.

how can i integrate it with the QT GUI?

thanks for help in advance________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

Hi,

have a look at :
http://www.libsdl.org/pipermail/sdl/2003-January/051805.html

for simple sample code that use SDL_Surface

and you can have a look at the file qastrolib/QCamDisplay.cpp
of archive

http://3demi.net/astro/qastrocam/doc/qastrocam-2003-11-17-sources.tar.gz

for using SDL_Overlay that do direct conversion from yuv to RGB on the
screen.

FranckOn Tue, Nov 18, 2003 at 10:02:09AM +0000, elhadj benkhelifa wrote:

hi all

does SDL display YUV video directly, or it convert it
to RGB and then display it.

how can i integrate it with the QT GUI?

thanks for help in advance


Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Franck SICARD <Franck.Sicard at 3demi.net> http://3demi.net/
PGP key=DFDFA865 fingerprint=8E2E 167E 9503 461B AD76 D962 2EEE 9869 DFDF A865
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20031118/8b34d8eb/attachment.pgp

hi again,

i tried to compile the qtSDL code but i got some
errors
such as undefined reference to SDL_Quit, SDL_GetError

and so on

i know that i need to reference the the SDL library.
but i dont know how to do it.

can you help with that please________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

perhaps you should need to had “-lSDL” somewhere in the makefile.
for exmaple where the var “LIBS” is defined.

FranckOn Tue, Nov 18, 2003 at 11:28:58AM +0000, elhadj benkhelifa wrote:

hi again,

i tried to compile the qtSDL code but i got some
errors
such as undefined reference to SDL_Quit, SDL_GetError

and so on

i know that i need to reference the the SDL library.
but i dont know how to do it.

can you help with that please


Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Franck SICARD <Franck.Sicard at 3demi.net> http://3demi.net/
PGP key=DFDFA865 fingerprint=8E2E 167E 9503 461B AD76 D962 2EEE 9869 DFDF A865
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20031118/0feb86e9/attachment.pgp

thanks,

that is sorted now,

this code is to display bmp file. in my case i want to
display a YUV video file.

i just commented out the code which load and display
the BMP file in the paintEvent function and replace
it with my code to display the yuv video file.
but what i get is just a green rectangle.

do have any ideas on why it is not displaying the
right data.
please find the attachment, test it yourself.

thanks again in advance.________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDLWidget.cpp
Type: application/octet-stream
Size: 3782 bytes
Desc: SDLWidget.cpp
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20031118/26ca9d73/attachment.obj

Don’t have the time to look and test you code, but have a look at the
attached class.
It do what you want, and it work (for me). You will be abale to compare
it with your code.

FranckOn Tue, Nov 18, 2003 at 02:04:34PM +0000, elhadj benkhelifa wrote:

thanks,

that is sorted now,

this code is to display bmp file. in my case i want to
display a YUV video file.

i just commented out the code which load and display
the BMP file in the paintEvent function and replace
it with my code to display the yuv video file.
but what i get is just a green rectangle.

do have any ideas on why it is not displaying the
right data.
please find the attachment, test it yourself.

thanks again in advance.


Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk


Franck SICARD <Franck.Sicard at 3demi.net> http://3demi.net/
PGP key=DFDFA865 fingerprint=8E2E 167E 9503 461B AD76 D962 2EEE 9869 DFDF A865
-------------- next part --------------
A non-text attachment was scrubbed…
Name: QCamDisplayImplSDL.cpp
Type: text/x-c++src
Size: 3073 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20031118/e239c030/attachment.cpp

First: planes, and pitches are readonly. You shouldn’t give them values.
It seems to me that you just want to paint the first YUV frame, isn’t it?

I think, the other code is correct. I would lock the surface when changing
the pixel data and unlock it before blitting takes place.

Ronnie> ----- Original Message -----

From: ebenkhelifa@yahoo.co.uk (elhadj benkhelifa)
To:
Sent: Tuesday, November 18, 2003 3:04 PM
Subject: Re: [SDL] SDL to display video!!!

thanks,

that is sorted now,

this code is to display bmp file. in my case i want to
display a YUV video file.

i just commented out the code which load and display
the BMP file in the paintEvent function and replace
it with my code to display the yuv video file.
but what i get is just a green rectangle.

do have any ideas on why it is not displaying the
right data.
please find the attachment, test it yourself.

thanks again in advance.


Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

This question is not about SDL per se, but I was hopeing you folks could
help me out. My SDL game, coded in pure ANSI C, is cross-platform
between MacOS X, Windows, and Linux, as such I try and keep my code as
ANSI compliant as possible.

I have run into a slight problem howver. How do I make a directory using
ANSI C code? I know how to use fwrite, fread etc. But these don’t create
directories. Is there a cross platfom method to do this, despite
perhapse system(“mkdir …”)?

Thanks in advance!

you can download libraries to do cross platform file system stuff but the
way you suggested is how i would do it if i were you (:

probly you could make a function wrapped in #define’s to make it change the
command for diff file operations depending on the system it was being
compiled on.> ----- Original Message -----

From: starmars@enunu.com (Michael Cabral)
To:
Sent: Tuesday, November 18, 2003 5:01 AM
Subject: [SDL] Creating a directory.

This question is not about SDL per se, but I was hopeing you folks could
help me out. My SDL game, coded in pure ANSI C, is cross-platform
between MacOS X, Windows, and Linux, as such I try and keep my code as
ANSI compliant as possible.

I have run into a slight problem howver. How do I make a directory using
ANSI C code? I know how to use fwrite, fread etc. But these don’t create
directories. Is there a cross platfom method to do this, despite
perhapse system(“mkdir …”)?

Thanks in advance!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Or you could use http://www.icculus.org/physfs/On Tuesday 18 November 2003 12:54 pm, Alan Wolfe wrote:

you can download libraries to do cross platform file system stuff but the
way you suggested is how i would do it if i were you (:

probly you could make a function wrapped in #define’s to make it change the
command for diff file operations depending on the system it was being
compiled on.

Or you could use http://www.icculus.org/physfs/

Excelent library! A great sugestion, I will deffinetly be using this.
Thank you very much!

-Mike

I would tell you to go with #define’s.
It’s pretty straight forward…
Although there do exist cross-platform libs that do this you don’t have to
be dependant on any lib if you define you methods…

Best Regards
Daniel Liljeberg> ----- Original Message -----

From: starmars@enunu.com (Michael Cabral)
To:
Sent: Tuesday, November 18, 2003 2:01 PM
Subject: [SDL] Creating a directory.

This question is not about SDL per se, but I was hopeing you folks could
help me out. My SDL game, coded in pure ANSI C, is cross-platform
between MacOS X, Windows, and Linux, as such I try and keep my code as
ANSI compliant as possible.

I have run into a slight problem howver. How do I make a directory using
ANSI C code? I know how to use fwrite, fread etc. But these don’t create
directories. Is there a cross platfom method to do this, despite
perhapse system(“mkdir …”)?

Thanks in advance!


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I have run into a slight problem howver. How do I make a directory using
ANSI C code?

Here’s some code from the games I write that sets up save directories. It
creates the directories in the user’s home directory. Should do more or less
what you’re looking for…

#include <sys/stat.h>
#include <pwd.h>
#include <unistd.h>
#include <errno.h>

#define PATH_MAX 4096

void setupUserHomeDirectory()
{
char *userHome;

char *name = getlogin();

passwd *pass;

if (name != NULL)
	pass = getpwnam(name);
else
	pass = getpwuid(geteuid());

if (pass == NULL)
{
	printf("Couldn't determine the user home directory. Exitting.\n");
	exit(1);
}

userHome = pass->pw_dir;

char dir[PATH_MAX];
strcpy(dir, "");

sprintf(dir, "%s/.parallelrealities", userHome);
if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST))
{
	printf("Couldn't create required directory '%s'", dir);
	exit(1);
}

sprintf(dir, "%s/.parallelrealities/blobwars", userHome);
if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST))
{
	printf("Couldn't create required directory '%s'", dir);
	exit(1);
}

char gameSavePath[PATH_MAX];
sprintf(gameSavePath, "%s/.parallelrealities/blobwars/", userHome);
engine.setUserHome(gameSavePath);

}

hello all,

I managed to Display YUV video from a file. i am
displaying 4 videos on the same window. i created an
overlay for each video and set the pixels for each
overlay. i open and read 4 defferent YUV video
files.The n i display the videos using SDL_Display.

the problem i am having now is that the more videos i
have the slower performance i get. so with displaying
only one video is fast, with 2 a bit slower and so on

can any one help me with this please

thank you in advance.________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk