Compare commits

..

1 Commits

Author SHA1 Message Date
cat
58d9b7ee5e More namespacing ffmpeg stuff are now _ffmpeg 2025-09-05 14:31:27 +03:00
2 changed files with 16 additions and 14 deletions

View File

@@ -14,7 +14,7 @@
#include <vector>
namespace ChargeVideo {
namespace _dependencies {
namespace _ffmpeg {
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavcodec/codec.h>
@@ -29,12 +29,11 @@ extern "C" {
#include <libswresample/swresample.h>
#include <libswscale/swscale.h>
}
} // namespace _dependencies
} // namespace _ffmpeg
using namespace Corrade;
using namespace Magnum;
using namespace Math::Literals;
using namespace _dependencies;
// ======================== CLASSES ========================
class Time {
public:
@@ -86,13 +85,13 @@ public:
private:
// Contextes
AVFormatContext *ctx;
const AVCodec *vCodec;
const AVCodec *aCodec;
AVCodecContext *vCodecCtx, *aCodecCtx;
AVStream *videoStream, *audioStream;
struct SwsContext *swsCtx = NULL; // Visual
struct SwrContext *swrCtx = NULL; // Audio
_ffmpeg::AVFormatContext *ctx;
const _ffmpeg::AVCodec *vCodec;
const _ffmpeg::AVCodec *aCodec;
_ffmpeg::AVCodecContext *vCodecCtx, *aCodecCtx;
_ffmpeg::AVStream *videoStream, *audioStream;
struct _ffmpeg::SwsContext *swsCtx = NULL; // Visual
struct _ffmpeg::SwrContext *swrCtx = NULL; // Audio
uint16_t ID = 0;
// Time specific
@@ -111,10 +110,11 @@ private:
bool frameSet = false;
void continueVideo();
Containers::Array<char> loadNextFrame();
inline void frameDebug(AVFrame *frame);
inline void frameSetScaleSAR(AVFrame *frame);
inline void frameConvert(AVFrame *sourceFrame, AVFrame *convertedFrame);
inline void frameFlip(AVFrame *frame);
inline void frameDebug(_ffmpeg::AVFrame *frame);
inline void frameSetScaleSAR(_ffmpeg::AVFrame *frame);
inline void frameConvert(_ffmpeg::AVFrame *sourceFrame,
_ffmpeg::AVFrame *convertedFrame);
inline void frameFlip(_ffmpeg::AVFrame *frame);
inline void restartVideo();
void dumpAndRefillBuffer();

View File

@@ -1,4 +1,5 @@
#include "ChargeVideo.hpp"
#include <Corrade/Utility/Utility.h>
#include <Magnum/GL/TextureFormat.h>
@@ -6,6 +7,7 @@
#include <Magnum/PixelFormat.h>
using namespace ChargeVideo;
using namespace _ffmpeg;
#include <cstring>
#include <string>