aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Screens
diff options
context:
space:
mode:
authorb1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-07-28 13:29:32 +0000
committerb1indy <b1indy@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-07-28 13:29:32 +0000
commitb7f377e62a7e941d7898c187a63dd6ed99b0798f (patch)
tree3a495d943ff584d7d31fae08fc12e565ed9ae33b /Game/Code/Screens
parent2381fe1d1dcdde5e4a3adcdf55796c2d723b8cf7 (diff)
downloadusdx-b7f377e62a7e941d7898c187a63dd6ed99b0798f.tar.gz
usdx-b7f377e62a7e941d7898c187a63dd6ed99b0798f.tar.xz
usdx-b7f377e62a7e941d7898c187a63dd6ed99b0798f.zip
experimental ffmpeg videodecoding support, frameskipping doesn't work quite right yet
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@332 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Screens/UScreenSing.pas35
1 files changed, 24 insertions, 11 deletions
diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas
index 2ba7522f..4bf405f6 100644
--- a/Game/Code/Screens/UScreenSing.pas
+++ b/Game/Code/Screens/UScreenSing.pas
@@ -3,7 +3,7 @@ unit UScreenSing;
interface
uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, ULyrics,
- TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses;
+ TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses, Uffmpeg;
type
TScreenSing = class(TMenu)
@@ -145,7 +145,7 @@ begin
//stop Music
Music.Pause;
if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video
- PauseSmpeg; //Video
+ FFmpegTogglePause;//PauseSmpeg; //Video
end
else //Pause ausschalten
begin
@@ -153,7 +153,7 @@ begin
Music.MoveTo (PauseTime);//Position of Music
Music.Play; //Play Music
if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video
- PlaySmpeg;
+ FFmpegTogglePause;//PlaySmpeg;
//SkipSmpeg(PauseTime);
Paused := false;
end;
@@ -222,6 +222,7 @@ begin
LyricMain := TLyric.Create;
LyricSub := TLyric.Create;
+ Uffmpeg.Init;
end;
procedure TScreenSing.onShow;
@@ -349,8 +350,11 @@ begin
// set movie
if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin
- OpenSmpeg(AktSong.Path + AktSong.Video);
- SkipSmpeg(AktSong.VideoGAP + AktSong.Start);
+{ OpenSmpeg(AktSong.Path + AktSong.Video);
+ SkipSmpeg(AktSong.VideoGAP + AktSong.Start);}
+ // todo: VideoGap and Start time verwursten
+ FFmpegOpenFile(pAnsiChar(AktSong.Path + AktSong.Video));
+ FFmpegSkip(AktSong.VideoGAP + AktSong.Start);
AktSong.VideoLoaded := true;
end;
@@ -739,14 +743,17 @@ begin
if AktSong.VideoLoaded then
begin
try
- PlaySmpeg;
+ FFmpegGetFrame(Czas.Teraz);
+ FFmpegDrawGL;
+// PlaySmpeg;
except
//If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video
AktSong.VideoLoaded := False;
Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.');
Log.LogError('Corrupted File: ' + AktSong.Video);
try
- CloseSmpeg;
+// CloseSmpeg;
+ FFmpegClose;
except
end;
@@ -1061,14 +1068,19 @@ begin
// update and draw movie
if ShowFinish and AktSong.VideoLoaded then begin
try
- UpdateSmpeg; // this only draws
+// UpdateSmpeg; // this only draws
+ // todo: find a way to determine, when a new frame is needed
+ // toto: same for the need to skip frames
+ FFmpegGetFrame(Czas.Teraz);
+ FFmpegDrawGL;
except
//If an Error occurs drawing: prevent Video from being Drawn again and Close Video
AktSong.VideoLoaded := False;
log.LogError('Error drawing Video, Video has been disabled for this Song/Session.');
Log.LogError('Corrupted File: ' + AktSong.Video);
try
- CloseSmpeg;
+// CloseSmpeg;
+ FFmpegClose;
except
end;
@@ -1095,7 +1107,7 @@ begin
end;
end;
end;
-
+
// draw custom items
SingDraw; // always draw
@@ -1143,7 +1155,8 @@ begin
end;
if AktSong.VideoLoaded then begin
- CloseSmpeg;
+// CloseSmpeg;
+ FFmpegClose;
AktSong.VideoLoaded := false; // to prevent drawing closed video
end;