mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-02 14:57:59 +03:00
Renamed all .h to .hpp for consistency
This commit is contained in:
parent
52e7570b4f
commit
6b0b7c95f8
53 changed files with 80 additions and 79 deletions
52
sound/sources/ffmpeg_source.hpp
Normal file
52
sound/sources/ffmpeg_source.hpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
#ifndef MANGLE_SOUND_FFMPEG_H
|
||||
#define MANGLE_SOUND_FFMPEG_H
|
||||
|
||||
#include "../source.hpp"
|
||||
#include <vector>
|
||||
#include <assert.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
}
|
||||
|
||||
namespace Mangle {
|
||||
namespace Sound {
|
||||
|
||||
class FFMpegSource : public SampleSource
|
||||
{
|
||||
AVFormatContext *FmtCtx;
|
||||
AVCodecContext *CodecCtx;
|
||||
int StreamNum;
|
||||
|
||||
std::vector<uint8_t> storage;
|
||||
|
||||
public:
|
||||
/// Decode the given sound file
|
||||
FFMpegSource(const std::string &file);
|
||||
|
||||
/// Decode the given sound stream (not supported by FFmpeg)
|
||||
FFMpegSource(Mangle::Stream::StreamPtr src) { assert(0); }
|
||||
|
||||
~FFMpegSource();
|
||||
|
||||
// Overrides
|
||||
void getInfo(int32_t *rate, int32_t *channels, int32_t *bits);
|
||||
size_t read(void *data, size_t length);
|
||||
};
|
||||
|
||||
#include "loadertemplate.hpp"
|
||||
|
||||
/// A factory that loads FFMpegSources from file
|
||||
class FFMpegLoader : public SSL_Template<FFMpegSource,false,true>
|
||||
{
|
||||
public:
|
||||
|
||||
/// Sets up the libavcodec library. If you want to do your own
|
||||
/// setup, send a setup=false parameter.
|
||||
FFMpegLoader(bool setup=true);
|
||||
};
|
||||
|
||||
}} // namespaces
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue