Sunshine master
Self-hosted game stream host for Moonlight.
nvenc_encoder.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <cstdint>
9
10// local includes
11#include "nvenc_config.h"
12#include "nvenc_encoded_frame.h"
13
14namespace platf {
15 enum class pix_fmt_e;
16}
17
18namespace video {
19 struct config_t;
20 struct sunshine_colorspace_t;
21} // namespace video
22
23namespace nvenc {
24
29 public:
33 virtual ~nvenc_encoder() = default;
34
44 virtual bool create_encoder(
45 const nvenc_config &config,
46 const video::config_t &client_config,
47 const video::sunshine_colorspace_t &colorspace,
48 platf::pix_fmt_e buffer_format
49 ) = 0;
50
54 virtual void destroy_encoder() = 0;
55
63 virtual nvenc_encoded_frame encode_frame(std::uint64_t frame_index, bool force_idr) = 0;
64
72 virtual bool invalidate_ref_frames(std::uint64_t first_frame, std::uint64_t last_frame) = 0;
73 };
74
75} // namespace nvenc
SDK-neutral standalone NVENC encoder interface.
Definition nvenc_encoder.h:28
virtual bool invalidate_ref_frames(std::uint64_t first_frame, std::uint64_t last_frame)=0
Invalidate reference frames in the requested range.
virtual nvenc_encoded_frame encode_frame(std::uint64_t frame_index, bool force_idr)=0
Encode the next frame using the platform-specific input surface.
virtual void destroy_encoder()=0
Destroy the encoder.
virtual ~nvenc_encoder()=default
Destroy the SDK-neutral encoder interface.
virtual bool create_encoder(const nvenc_config &config, const video::config_t &client_config, const video::sunshine_colorspace_t &colorspace, platf::pix_fmt_e buffer_format)=0
Create the encoder.
pix_fmt_e
Enumerates supported pix fmt options.
Definition common.h:316
video_t video
Default video configuration values used before file and CLI overrides.
Definition config.cpp:711
Standalone NVENC encoder.
Definition nvenc_base.cpp:185
Declarations for NVENC encoder configuration.
Declarations for NVENC encoded frame.
NVENC encoder configuration.
Definition nvenc_config.h:30
Encoded NVENC output frame and metadata needed by the packetizer.
Definition nvenc_encoded_frame.h:16
Encoding configuration requested by a remote client.
Definition video.h:29
Sunshine colorimetry values derived from stream configuration.
Definition video_colorspace.h:26