Marcus wants a Prototype for the play back of an
mpeg video file. The goal is to make a program like
the following work:
function play_movie
var pligame:Surface screen
var pligame:Event event
var pligame:Movie
pligame init #initialize SDL.
#Load mpeg file stream
movie := pligame:movie:Load "mympeg.mpg"
#Set screen size to movie size.
var Int w := movie:get_width
var Int h := movie:get_height
screen := pligame:display:set_mode w h
#default bit-depth, eg for 16-bit: set_mode w h 16
var Int movie_length := movie:get_length
console "Movie is " movie_length "seconds long." eol
movie:set_display screen #draw to screen
movie:play(0) # 0 infinte loop
Cbool done := false
while not done
while event:poll
eif event:get(QUIT) # User Closes window
done := true
movie:stop
pligame quit
#end play_movie
play_movie # execute play_movie
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
SMPEG is done in c++, however, it comes with a C interface also. I'm now writting the wrapper for it, should I use the C interface? or stick with C++. (the C interface seems to have less control, but I am not really sure) Let me hear your comments. Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If SMPEG has a C interface, then its fine. I have yet
to take a look at it myself. We only need to wrap
eneough of SDL and SMPEG to make the code
snipped (or something very close to it) to work.
Could you give me a code snippet of what a program
like I described above would look like in C? What are
the essential C functions for loading a clip, attaching
it to a surface and begin playback?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Marcus wants a Prototype for the play back of an
mpeg video file. The goal is to make a program like
the following work:
function play_movie
var pligame:Surface screen
var pligame:Event event
var pligame:Movie
pligame init #initialize SDL.
#Load mpeg file stream
movie := pligame:movie:Load "mympeg.mpg"
#Set screen size to movie size.
var Int w := movie:get_width
var Int h := movie:get_height
screen := pligame:display:set_mode w h
#default bit-depth, eg for 16-bit: set_mode w h 16
var Int movie_length := movie:get_length
console "Movie is " movie_length "seconds long." eol
movie:set_display screen #draw to screen
movie:play(0) # 0 infinte loop
Cbool done := false
while not done
while event:poll
eif event:get(QUIT) # User Closes window
done := true
movie:stop
pligame quit
#end play_movie
play_movie # execute play_movie
here's a link to the .pli file. Forums don't
perserve indents.
http://pligame.sf.net/files/mympeg.pli
SMPEG is done in c++, however, it comes with a C interface also. I'm now writting the wrapper for it, should I use the C interface? or stick with C++. (the C interface seems to have less control, but I am not really sure) Let me hear your comments. Thanks.
nevermind what i said early, pliant can own create interfaces to external C libraries, not C++.
ken
If SMPEG has a C interface, then its fine. I have yet
to take a look at it myself. We only need to wrap
eneough of SDL and SMPEG to make the code
snipped (or something very close to it) to work.
Could you give me a code snippet of what a program
like I described above would look like in C? What are
the essential C functions for loading a clip, attaching
it to a surface and begin playback?