mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-09 17:52:08 -10:00
This does some refactoring to make it possible to cimpile and run FSO without needing to link to FFmpeg. Since that eliminates support for cutscenes or sound this is mostly useful for running a standalone server which has no need for this anyway. This reduces the image size of the standalone Docker image to only 20MB and also resolves any licensing issues that might have existed.
28 lines
593 B
C++
28 lines
593 B
C++
#pragma once
|
|
|
|
#include "globalincs/pstypes.h"
|
|
|
|
#include "libs/ffmpeg/FFmpegHeaders.h"
|
|
|
|
namespace sound {
|
|
namespace ffmpeg {
|
|
|
|
class FFmpegAudioReader {
|
|
int _stream_idx = -1;
|
|
AVFormatContext* _format_ctx = nullptr;
|
|
AVCodecContext* _codec_ctx = nullptr;
|
|
|
|
#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(57, 24, 255)
|
|
AVPacket* _currentPacket = nullptr;
|
|
#endif
|
|
|
|
public:
|
|
FFmpegAudioReader(AVFormatContext* av_format_context, AVCodecContext* codec_ctx, int stream_idx);
|
|
~FFmpegAudioReader();
|
|
|
|
bool readFrame(AVFrame* decode_frame);
|
|
};
|
|
|
|
} // namespace ffmpeg
|
|
} // namespace sound
|