View Issue Details

IDProjectCategoryView StatusLast Update
0004535The Dark ModGUIpublic02.07.2017 06:58
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilityN/A
Status resolvedResolutionfixed 
Product VersionSVN 
Target VersionTDM 2.06Fixed in VersionTDM 2.06 
Summary0004535: Showing video for its full duration
DescriptionRight now length of the video must be set manually in GUI scripts.
If the video is longer: it is interrupted.
If the video is shorter: it is looped / blackscreen.

Ideally, there must be an option to play video for its natural duration.
TagsNo tags attached.

Relationships

related to 0004519 resolvedstgatilov Investigate using videos of common formats (avi, mp4) 
related to 0004541 new Glimpse of old frames when cinematic is restarted 
related to 0004547 resolvedstgatilov Credits GUI: video sequences start looping 

Activities

stgatilov

stgatilov

12.06.2017 06:14

administrator   ~0008895

Last edited: 12.06.2017 06:16

View 3 revisions

Implemented SVN revision 6931.

Added idCinematic::GetStatus virtual function, which returns whether the video is playing (FMV_PLAY), has not started playing yet (FMV_IDLE), or has finished playing already (FMV_EOF). Note that this function simply returns FMV_PLAY for legacy ROQ cinematics implementation.
Previously this status could only be obtained from the result of ImageForTime call, but that call needs proper renderer backend time argument, and in any case it might have side effects.

Each GUI window regularly checks status of its background cinematics in its "time" function (idWindow::Time). If status is FMV_EOF, then named event "CinematicEnd" of the window is triggered immediately. This allows to change GUI exactly when the video ends without the need to hard-code video duration.

Note that the video is also closed (idCinematic::Close) when CinematicEnd is issued. This is necessary for idCinematicFFmpeg for two reasons:
1. Avoid triggering the event again during next frames (because status changes to FMV_IDLE after idCinematic::Close).
2. Avoid triggering the event when the video is restarted. The problem here is that when video is restarted, idWindow::Time happens before idCinematic::ResetTime method is called. At that moment cinematics is still in FMV_EOF state if we do not call idCinematic::Close explicitly.
It is worth noting that calling idCinematic::Close for legacy ROQ cinematic prevents the video from being played ever in future, because it cleans even the filename. Luckily, we call idCinematic::Close only when idCinematic::GetStatus returns FMV_EOF, and legavy ROQ cinematic always returns FMV_PLAY status.

stgatilov

stgatilov

12.06.2017 06:17

administrator   ~0008896

This forum post describes well how to use the feature from GUI scripts:
  http://forums.thedarkmod.com/topic/18820-why-roq/?p=407624
stgatilov

stgatilov

02.07.2017 06:58

administrator   ~0008944

Due to related issue 4547, now Close method is called only when CinematicEnd event handler is actually present. If no one listens to this event, then cinematics is not closed.

Issue History

Date Modified Username Field Change
17.05.2017 04:25 stgatilov New Issue
17.05.2017 04:25 stgatilov Relationship added related to 0004519
10.06.2017 17:46 stgatilov Assigned To => stgatilov
10.06.2017 17:46 stgatilov Status new => assigned
12.06.2017 06:14 stgatilov Note Added: 0008895
12.06.2017 06:16 stgatilov Note Edited: 0008895 View Revisions
12.06.2017 06:16 stgatilov Note Edited: 0008895 View Revisions
12.06.2017 06:17 stgatilov Note Added: 0008896
12.06.2017 06:26 stgatilov Fixed in Version => TDM 2.06
12.06.2017 06:26 stgatilov Target Version => TDM 2.06
12.06.2017 06:26 stgatilov Status assigned => resolved
12.06.2017 06:26 stgatilov Resolution open => fixed
12.06.2017 07:59 stgatilov Relationship added related to 0004541
26.06.2017 17:17 stgatilov Relationship added related to 0004547
02.07.2017 06:58 stgatilov Note Added: 0008944