mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 16:18:19 -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.
29 lines
571 B
C++
29 lines
571 B
C++
#pragma once
|
|
|
|
#include "cutscene/ffmpeg/internal.h"
|
|
#include "cutscene/ffmpeg/FFMPEGDecoder.h"
|
|
|
|
namespace cutscene {
|
|
namespace ffmpeg {
|
|
class VideoDecoder: public FFMPEGStreamDecoder<VideoFrame> {
|
|
private:
|
|
int m_frameId;
|
|
SwsContext* m_swsCtx;
|
|
AVPixelFormat m_destinationFormat;
|
|
|
|
void convertAndPushPicture(const AVFrame* frame);
|
|
|
|
public:
|
|
explicit VideoDecoder(DecoderStatus* status, AVPixelFormat destination_fmt);
|
|
|
|
~VideoDecoder() override;
|
|
|
|
void decodePacket(AVPacket* packet) override;
|
|
|
|
void finishDecoding() override;
|
|
|
|
void flushBuffers() override;
|
|
};
|
|
}
|
|
}
|