DXVA2 Hardware Decoding (#3)

This commit is contained in:
Cameron Gutman
2018-07-13 02:28:10 -07:00
parent 86f843464c
commit 1cae5f83e5
8 changed files with 810 additions and 87 deletions
+21 -2
View File
@@ -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;