mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-16 21:51:17 +00:00
DXVA2 Hardware Decoding (#3)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "backend/computermanager.h"
|
||||
#include "settings/streamingpreferences.h"
|
||||
#include "input.hpp"
|
||||
#include "renderers/renderer.h"
|
||||
|
||||
extern "C" {
|
||||
#include <libavcodec/avcodec.h>
|
||||
@@ -44,6 +45,23 @@ private:
|
||||
|
||||
int sdlDetermineAudioConfiguration();
|
||||
|
||||
static
|
||||
bool chooseDecoder(StreamingPreferences::VideoDecoderSelection vds,
|
||||
SDL_Window* window,
|
||||
int videoFormat,
|
||||
int width, int height,
|
||||
AVCodec*& chosenDecoder,
|
||||
const AVCodecHWConfig*& chosenHwConfig,
|
||||
IRenderer*& newRenderer);
|
||||
|
||||
static
|
||||
enum AVPixelFormat getHwFormat(AVCodecContext*,
|
||||
const enum AVPixelFormat* pixFmts);
|
||||
|
||||
static
|
||||
bool isHardwareDecodeAvailable(StreamingPreferences::VideoDecoderSelection vds,
|
||||
int videoFormat, int width, int height);
|
||||
|
||||
void renderFrame(SDL_UserEvent* event);
|
||||
|
||||
void dropFrame(SDL_UserEvent* event);
|
||||
@@ -92,12 +110,13 @@ private:
|
||||
NvComputer* m_Computer;
|
||||
NvApp m_App;
|
||||
SDL_Window* m_Window;
|
||||
SDL_Renderer* m_Renderer;
|
||||
SDL_Texture* m_Texture;
|
||||
|
||||
static AVPacket s_Pkt;
|
||||
static AVCodecContext* s_VideoDecoderCtx;
|
||||
static QByteArray s_DecodeBuffer;
|
||||
static AVBufferRef* s_HwDeviceCtx;
|
||||
static const AVCodecHWConfig* s_HwDecodeCfg;
|
||||
static IRenderer* s_Renderer;
|
||||
|
||||
static SDL_AudioDeviceID s_AudioDevice;
|
||||
static OpusMSDecoder* s_OpusDecoder;
|
||||
|
||||
Reference in New Issue
Block a user