JurassicParkTrespasser icon indicating copy to clipboard operation
JurassicParkTrespasser copied to clipboard

Preview: use libsmacker for FMV [rebuilt PR]

Open meekee7 opened this issue 4 years ago • 0 comments

This is a rebuild of PR #147 after its branch was ruined by a failed rebase attempt.

An attempt is made to replace the RAD Smacker video decoder with the open source alternative libsmacker. See also issue #14. The intent of this PR is to provide a preview of the new FMV player for code review purposes. Merging it, if accepted, should wait until the integration strategy for libsmacker is decided. At this moment, libsmacker is integrated as a static library, with the code directly in the main repo.

The key difference between RAD Smacker and libsmacker is their scope. RAD Smacker not only decodes the video, but brings a framework for video playback with functions for timing and frame blitting. It even does all the audio playback. By contrast, libsmacker can do decoding and nothing else.

Frame blitting is now based on existing Trespasser code. There is no longer a distinction between D3D and software mode. Direct support for both 16 and 32bit color depth is provided. Furthermore, the program no longer crashes when the window size is smaller than the video size.

The existing audio infrastructure does not seem to support streaming, so the DirectSound buffer is created manually. It operates as a ring buffer. While one half of it is being played, the other half is filled with data.

The decoding by libsmacker and the servicing of the audio buffer happen on separate threads.

Key concerns for testing:

  • Do audio and video remain in sync or is there any drift?
  • Are there any audio playback errors like plopping or cracking noises?
  • Is the video playback smooth, considering the videos have 15fps?
  • Does the video end at the correct moment or does it end a tick to early?

meekee7 avatar Nov 18 '20 23:11 meekee7