mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-09 18:27:00 +00:00
NEW: reimpl wxMediaCtrl from ffmpeg
Jira: none Change-Id: I46a47118a7649b2a50fcce8911e2888342ef25de (cherry picked from commit d6c7f08769c8cfdbbf0e80ad280c9b3408a3c27d) (cherry picked from commit 94d91be60bfe9bbbcdd21f85b46abc3faf126f17)
This commit is contained in:
39
src/slic3r/GUI/AVVideoDecoder.hpp
Normal file
39
src/slic3r/GUI/AVVideoDecoder.hpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef AVVIDEODECODER_HPP
|
||||
#define AVVIDEODECODER_HPP
|
||||
|
||||
#include "BambuTunnel.h"
|
||||
|
||||
extern "C" {
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libswscale/swscale.h>
|
||||
}
|
||||
class wxBitmap;
|
||||
|
||||
class AVVideoDecoder
|
||||
{
|
||||
public:
|
||||
AVVideoDecoder();
|
||||
|
||||
~AVVideoDecoder();
|
||||
|
||||
public:
|
||||
int open(Bambu_StreamInfo const &info);
|
||||
|
||||
int decode(Bambu_Sample const &sample);
|
||||
|
||||
int flush();
|
||||
|
||||
void close();
|
||||
|
||||
bool toWxImage(wxImage &image, wxSize const &size);
|
||||
|
||||
bool toWxBitmap(wxBitmap &bitmap, wxSize const & size);
|
||||
|
||||
private:
|
||||
AVCodecContext *codec_ctx_ = nullptr;
|
||||
AVFrame * frame_ = nullptr;
|
||||
SwsContext * sws_ctx_ = nullptr;
|
||||
bool got_frame_ = false;
|
||||
};
|
||||
|
||||
#endif // AVVIDEODECODER_HPP
|
||||
Reference in New Issue
Block a user