OpenTrespasser / JurassicParkTrespasser

A git-based fork of the Jurassic Park: Trespasser source code.
98 stars 24 forks source link

Preview: use libsmacker for FMV #147

Closed meekee7 closed 3 years ago

meekee7 commented 3 years ago

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:

meekee7 commented 3 years ago

Withdrawn after the source branch was ruined by a failed rebase attempt.