hedgewars/uVideoRec.pas
changeset 7671 43f38923bc6e
parent 7540 cc6c656f70b5
child 7804 9122461ae32b
equal deleted inserted replaced
7670:9485b88f6a44 7671:43f38923bc6e
    34 interface
    34 interface
    35 
    35 
    36 var flagPrerecording: boolean = false;
    36 var flagPrerecording: boolean = false;
    37 
    37 
    38 function BeginVideoRecording: Boolean;
    38 function BeginVideoRecording: Boolean;
    39 function LoadNextCameraPosition(var newRealTicks, newGameTicks: LongInt): Boolean;
    39 function LoadNextCameraPosition(out newRealTicks, newGameTicks: LongInt): Boolean;
    40 procedure EncodeFrame;
    40 procedure EncodeFrame;
    41 procedure StopVideoRecording;
    41 procedure StopVideoRecording;
    42 
    42 
    43 procedure BeginPreRecording;
    43 procedure BeginPreRecording;
    44 procedure StopPreRecording;
    44 procedure StopPreRecording;
   189     SDLNet_Write16(progress*10000 div maxProgress, @s[2]);
   189     SDLNet_Write16(progress*10000 div maxProgress, @s[2]);
   190     SendIPC(s);
   190     SendIPC(s);
   191     inc(numFrames);
   191     inc(numFrames);
   192 end;
   192 end;
   193 
   193 
   194 function LoadNextCameraPosition(var newRealTicks, newGameTicks: LongInt): Boolean;
   194 function LoadNextCameraPosition(out newRealTicks, newGameTicks: LongInt): Boolean;
   195 var frame: TFrame;
   195 var frame: TFrame;
   196 begin
   196 begin
   197     // we need to skip or duplicate frames to match target framerate
   197     // we need to skip or duplicate frames to match target framerate
   198     while Int64(curTime)*cVideoFramerateNum <= Int64(numFrames)*cVideoFramerateDen*1000 do
   198     while Int64(curTime)*cVideoFramerateNum <= Int64(numFrames)*cVideoFramerateDen*1000 do
   199     begin
   199     begin