From 56400002816820a8baede8c34f69156d574c3b96 Mon Sep 17 00:00:00 2001 From: b1indy Date: Wed, 21 Nov 2007 20:10:27 +0000 Subject: backported ffmpeg video stuff (used an older version, so this needs to be testet with wine) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1@623 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Screens/UScreenSing.pas | 27 ++++++++++++++------------- Game/Code/Screens/UScreenSingModi.pas | 7 ++++--- 2 files changed, 18 insertions(+), 16 deletions(-) (limited to 'Game/Code/Screens') diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas index 5409d9a9..283c51d0 100644 --- a/Game/Code/Screens/UScreenSing.pas +++ b/Game/Code/Screens/UScreenSing.pas @@ -2,8 +2,8 @@ unit UScreenSing; interface -uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, ULyrics, - TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses; +uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, ULyrics, + TextGL, OpenGL12, BASS, UThemes, ULCD, UGraphicClasses, UVideo; type TScreenSing = class(TMenu) @@ -146,7 +146,7 @@ begin //stop Music Music.Pause; if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video - PauseSmpeg; //Video + FFmpegTogglePause; //Video end else //Pause ausschalten begin @@ -154,8 +154,7 @@ begin Music.MoveTo (PauseTime);//Position of Music Music.Play; //Play Music if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then //Video - PlaySmpeg; - //SkipSmpeg(PauseTime); + FFmpegTogglePause; Paused := false; end; end; @@ -223,6 +222,7 @@ begin LyricMain := TLyric.Create; LyricSub := TLyric.Create; + UVideo.Init; end; procedure TScreenSing.onShow; @@ -350,9 +350,9 @@ begin // set movie if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then begin - OpenSmpeg(AktSong.Path + AktSong.Video); - SkipSmpeg(AktSong.VideoGAP + AktSong.Start); - AktSong.VideoLoaded := true; + FFmpegOpenFile(PAnsiChar(AktSong.Path + AktSong.Video)); + FFmpegSkip(AktSong.VideoGAP + AktSong.Start); + if (UVideo.VideoOpened) then AktSong.VideoLoaded := true; end; // set background @@ -740,14 +740,14 @@ begin if AktSong.VideoLoaded then begin try - PlaySmpeg; + FFmpegGetFrame(Czas.Teraz); 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; + FFmpegClose; except end; @@ -1062,14 +1062,15 @@ begin // update and draw movie if ShowFinish and AktSong.VideoLoaded then begin try - UpdateSmpeg; // this only draws + FFmpegGetFrame(Czas.Teraz); + FFmpegDrawGL(ScreenAct); // this only draws 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; + FFmpegClose; except end; @@ -1144,7 +1145,7 @@ begin end; if AktSong.VideoLoaded then begin - CloseSmpeg; + FFmpegClose; AktSong.VideoLoaded := false; // to prevent drawing closed video end; diff --git a/Game/Code/Screens/UScreenSingModi.pas b/Game/Code/Screens/UScreenSingModi.pas index 32526a07..8a52a4b8 100644 --- a/Game/Code/Screens/UScreenSingModi.pas +++ b/Game/Code/Screens/UScreenSingModi.pas @@ -2,8 +2,8 @@ unit UScreenSingModi; interface -uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, USmpeg, UTexture, ULyrics, - TextGL, OpenGL12, BASS, UThemes, ULCD, UScreenSing, ModiSDK; +uses UMenu, UMusic, SDL, SysUtils, UFiles, UTime, USongs, UIni, ULog, UTexture, ULyrics, + TextGL, OpenGL12, BASS, UThemes, ULCD, UScreenSing, ModiSDK, UVideo; type TScreenSingModi = class(TScreenSing) @@ -944,7 +944,8 @@ end; // update and draw movie if ShowFinish and AktSong.VideoLoaded AND DllMan.Selected.LoadVideo then begin - UpdateSmpeg; // this only draws + FFmpegGetFrame(Czas.Teraz); + FFmpegDrawGL(ScreenAct); // this only draws end; // draw static menu (FG) -- cgit v1.2.3