move stuff in common, clang-format, update copyright

This commit is contained in:
Guillaume Meunier
2022-11-13 11:00:04 +01:00
parent 294c4f81ba
commit 4baf2b17eb
62 changed files with 2291 additions and 2846 deletions
+32 -19
View File
@@ -1,18 +1,34 @@
// Copyright 2022, Guillaume Meunier
// Copyright 2022, Patrick Nicolas
// SPDX-License-Identifier: BSL-1.0
/*
* WiVRn VR streaming
* Copyright (C) 2022 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2022 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "video_encoder.h"
#include "external/nvEncodeAPI.h"
#include "video_encoder.h"
#include <cuda.h>
namespace xrt::drivers::wivrn {
namespace xrt::drivers::wivrn
{
class VideoEncoderNvenc : public VideoEncoder
{
vk_bundle *vk;
vk_bundle * vk;
// relevant part of the input image to encode
int offset_x;
int offset_y;
@@ -21,7 +37,7 @@ class VideoEncoderNvenc : public VideoEncoder
NV_ENCODE_API_FUNCTION_LIST fn;
CUcontext cuda;
void *session_handle;
void * session_handle;
NV_ENC_OUTPUT_PTR bitstreamBuffer;
struct image_data
@@ -40,20 +56,17 @@ class VideoEncoderNvenc : public VideoEncoder
bool supports_frame_invalidation;
public:
VideoEncoderNvenc(vk_bundle *vk, const encoder_settings &settings, float fps);
VideoEncoderNvenc(vk_bundle * vk, const encoder_settings & settings, float fps);
void
SetImages(int width,
int height,
VkFormat format,
int num_images,
VkImage *images,
VkImageView *views,
VkDeviceMemory *memory) override;
void SetImages(int width,
int height,
VkFormat format,
int num_images,
VkImage * images,
VkImageView * views,
VkDeviceMemory * memory) override;
void
Encode(int index, bool idr, std::chrono::steady_clock::time_point pts) override;
void Encode(int index, bool idr, std::chrono::steady_clock::time_point pts) override;
};
} // namespace xrt::drivers::wivrn