mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
This adds a playback property for making the movie loop to the start when the end is reached. The way this is done is by simply keeping the decoder running even if the end of the movie is reached. Then the movie is reset to the beginning and decoding continues. The player detects this reset by examining the frame times which keeps the playback constant. This also includes support for this in the movie scripting API.
46 lines
794 B
C++
46 lines
794 B
C++
#pragma once
|
|
|
|
#include "cutscene/Decoder.h"
|
|
|
|
namespace cutscene {
|
|
namespace ffmpeg {
|
|
struct InputStream;
|
|
|
|
struct DecoderStatus;
|
|
|
|
class SubtitleDecoder;
|
|
|
|
class FFMPEGDecoder: public Decoder {
|
|
private:
|
|
std::unique_ptr<InputStream> m_input;
|
|
|
|
std::unique_ptr<InputStream> m_subtitleInput;
|
|
|
|
std::unique_ptr<DecoderStatus> m_status;
|
|
|
|
PlaybackProperties m_properties;
|
|
|
|
bool hasExternalSubtitle() const;
|
|
|
|
void runSubtitleDecoder(SubtitleDecoder* decoder);
|
|
|
|
public:
|
|
FFMPEGDecoder();
|
|
|
|
~FFMPEGDecoder() override;
|
|
|
|
bool initialize(const SCP_string& fileName, const PlaybackProperties& properties) override;
|
|
|
|
MovieProperties getProperties() const override;
|
|
|
|
void startDecoding() override;
|
|
|
|
bool hasAudio() const override;
|
|
|
|
bool hasSubtitles() const override;
|
|
|
|
void close() override;
|
|
};
|
|
}
|
|
}
|