linux-wallpaperengine/src/WallpaperEngine/Render/CVideo.h
Alexis Maiquez 291b7e364a - removed/commented out most irrlicht-specific code
~ written close to equivalent versions in OpenGL code using GLM and GLFW
~ written replacements for texture and package loading to not use irrlicht anymore
~ updated shader compiler as we now don't need to replace attributes anymore
+ added support for texture flags in the texture header (as they're needed for opengl to get proper information)

TODO: REWRITE VIDEO PLAYER SUPPORT AS THIS UPDATE EFFECTIVELY BREAKS IT

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-08-31 01:14:08 +02:00

53 lines
1.2 KiB
C++

#pragma once
#include <irrlicht/irrlicht.h>
#include "WallpaperEngine/Core/CVideo.h"
#include "WallpaperEngine/Render/CWallpaper.h"
#include "WallpaperEngine/Irrlicht/CContext.h"
extern "C"
{
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/imgutils.h>
#include <libswscale/swscale.h>
}
namespace WallpaperEngine::Render
{
class CVideo : public CWallpaper
{
public:
CVideo (Core::CVideo* video, CContainer* container);
void render () override;
Core::CVideo* getVideo ();
protected:
friend class CWallpaper;
static const std::string Type;
private:
void setSize (int width, int height);
void restartStream ();
void getNextFrame ();
void writeFrameToImage ();
AVFormatContext* m_formatCtx = nullptr;
AVCodecContext* m_codecCtx = nullptr;
AVFrame* m_videoFrame = nullptr;
AVFrame* m_videoFrameRGB = nullptr;
SwsContext* m_swsCtx = nullptr;
uint8_t* m_buffer = nullptr;
int m_videoStream = -1, m_audioStream = -1;
irr::video::IImage* m_frameImage;
irr::video::ITexture* m_frameTexture;
};
};