mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-10 17:46:53 -10:00
Uses FFmpeg for video decoding and multiple threads for reading and decoding files. Can handle 1080p with no stuttering.
36 lines
629 B
C++
36 lines
629 B
C++
#pragma once
|
|
|
|
#include "cutscene/ffmpeg/internal.h"
|
|
#include "cutscene/ffmpeg/FFMPEGDecoder.h"
|
|
|
|
namespace cutscene {
|
|
namespace ffmpeg {
|
|
|
|
class AudioDecoder: public FFMPEGStreamDecoder<AudioFrame> {
|
|
private:
|
|
SwrContext* m_resampleCtx;
|
|
|
|
uint8_t** m_outData;
|
|
int m_outLinesize;
|
|
|
|
int m_maxOutNumSamples;
|
|
int m_outNumSamples;
|
|
|
|
SCP_vector<short> m_audioBuffer;
|
|
|
|
void handleDecodedFrame(AVFrame* frame);
|
|
|
|
void flushAudioBuffer();
|
|
|
|
public:
|
|
explicit AudioDecoder(DecoderStatus* status);
|
|
|
|
virtual ~AudioDecoder();
|
|
|
|
virtual void decodePacket(AVPacket* packet) SCP_OVERRIDE;
|
|
|
|
virtual void finishDecoding() SCP_OVERRIDE;
|
|
};
|
|
}
|
|
}
|