From 7c7e9d3ce5bb706ae0edd0e6802fed873aab1bb0 Mon Sep 17 00:00:00 2001 From: b1indy Date: Wed, 22 Aug 2007 08:27:02 +0000 Subject: black background for videos debug display off credit to the ffmpeg&SDL tutorial git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@350 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/SMpeg/Uffmpeg.pas | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'Game') diff --git a/Game/Code/SMpeg/Uffmpeg.pas b/Game/Code/SMpeg/Uffmpeg.pas index d6e8cc81..2b8f1f44 100644 --- a/Game/Code/SMpeg/Uffmpeg.pas +++ b/Game/Code/SMpeg/Uffmpeg.pas @@ -1,3 +1,10 @@ +{############################################################################ +# FFmpeg support for UltraStar deluxe # +# # +# Created by b1indy # +# based on 'An ffmpeg and SDL Tutorial' (http://www.dranger.com/ffmpeg/) # +#############################################################################} + unit Uffmpeg; interface @@ -31,7 +38,7 @@ var implementation -const DebugDisplay=True; +const DebugDisplay=False; procedure Init; begin @@ -86,8 +93,9 @@ begin end else showmessage('no matching codec found'); if(errnum >=0) then begin - showmessage('Found a matching Codec:'+#13#10#13#10+ - 'Width='+inttostr(VideoCodecContext^.width)+ + if DebugDisplay then + showmessage('Found a matching Codec:'+#13#10#13#10+ + 'Width='+inttostr(VideoCodecContext^.width)+ ', Height='+inttostr(VideoCodecContext^.height)+#13#10+ 'Aspect: '+inttostr(VideoCodecContext^.sample_aspect_ratio.num)+'/'+inttostr(VideoCodecContext^.sample_aspect_ratio.den)+#13#10+ 'Framerate: '+inttostr(VideoCodecContext^.time_base.num)+'/'+inttostr(VideoCodecContext^.time_base.den)); @@ -129,7 +137,7 @@ begin ScaledVideoWidth:=600.0*VideoAspect; end; VideoTimeBase:=VideoCodecContext^.time_base.num/VideoCodecContext^.time_base.den; - if (VideoAspect*VideoCodecContext^.width*VideoCodecContext^.height)>200000 then + if (DebugDisplay) and ((VideoAspect*VideoCodecContext^.width*VideoCodecContext^.height)>200000) then showmessage('you are trying to play a rather large video'+#13#10+ 'be prepared to experience some timing problems'); end; @@ -238,6 +246,8 @@ end; procedure FFmpegDrawGL; begin if not VideoOpened then Exit; + glClearColor(0,0,0,0); + glClear(GL_COLOR_BUFFER_BIT and GL_DEPTH_BUFFER_BIT); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glColor4f(1, 1, 1, 1); -- cgit v1.2.3