refactor ffmpeg super class into more maintainable package, cmake is catigorized now ; removed old engine, replaced with new one

This commit is contained in:
2026-06-09 11:29:01 +02:00
parent 3c274b5cf8
commit 86df304adb
12 changed files with 541 additions and 270 deletions
+38
View File
@@ -0,0 +1,38 @@
#pragma once
#include <memory>
struct AVCodecContext;
struct AVCodecParameters;
struct AVPacket;
struct AVFrame;
namespace engine {
class CodecContext {
public:
CodecContext() = default;
~CodecContext() = default;
CodecContext(const CodecContext &) = delete;
CodecContext &operator=(const CodecContext &) = delete;
bool open(const AVCodecParameters *par);
void close();
bool sendPacket(const AVPacket *pkt) const;
bool receiveFrame(AVFrame *frame) const;
void flush();
bool isOpen() const { return m_ctx != nullptr; }
int sampleRate()const;
int channels() const;
const AVCodecContext *get() const { return m_ctx.get(); }
private:
struct Deleter { void operator()(AVCodecContext *p) const; };
std::unique_ptr<AVCodecContext, Deleter> m_ctx;
};
} // namespace engine