Each cuda::sws_t has it's own color matrix

This commit is contained in:
loki-47-6F-64
2021-09-19 21:27:31 +02:00
parent fed329568c
commit 4d1689d6e9
2 changed files with 51 additions and 26 deletions

View File

@@ -1,6 +1,8 @@
#ifndef SUNSHINE_PLATFORM_CUDA_H
#define SUNSHINE_PLATFORM_CUDA_H
#include <memory>
#ifndef __NVCC__
#include "sunshine/platform/common.h"
@@ -26,10 +28,18 @@ typedef __location__(device_builtin) unsigned long long cudaTextureObject_t;
#endif /* !defined(__CUDACC__) */
namespace cuda {
class freeCudaPtr_t {
public:
void operator()(void *ptr);
};
using ptr_t = std::unique_ptr<void, freeCudaPtr_t>;
class sws_t {
public:
~sws_t();
sws_t(int in_width, int in_height, int out_width, int out_height, int threadsPerBlock);
sws_t(int in_width, int in_height, int out_width, int out_height, int threadsPerBlock, ptr_t &&color_matrix);
/**
* in_width, out_width -- The width and height of the captured image in bytes
@@ -46,6 +56,7 @@ public:
int load_ram(platf::img_t &img);
ptr_t color_matrix;
cudaArray_t array;
cudaTextureObject_t texture;