Sunshine master
Self-hosted game stream host for Moonlight.
video::nvenc_encode_session_t Class Reference

NVENC encode session and device state for hardware encoding. More...

Inheritance diagram for video::nvenc_encode_session_t:
[legend]
Collaboration diagram for video::nvenc_encode_session_t:
[legend]

Public Member Functions

int convert (platf::img_t &img) override
 Encode one frame with NVENC and return the packet payload.
 
nvenc::nvenc_encoded_frame encode_frame (uint64_t frame_index)
 Submit the next frame to NVENC and return the encoded payload.
 
void invalidate_ref_frames (int64_t first_frame, int64_t last_frame) override
 Mark the frame range whose references must be invalidated.
 
 nvenc_encode_session_t (std::unique_ptr< platf::nvenc_encode_device_t > encode_device)
 Initialize an NVENC encode session and take ownership of its device.
 
void request_idr_frame () override
 Mark the frame as a request for an IDR frame.
 
void request_normal_frame () override
 Mark the frame as a request for a normal inter frame.
 
- Public Member Functions inherited from video::encode_session_t

Detailed Description

NVENC encode session and device state for hardware encoding.

Constructor & Destructor Documentation

◆ nvenc_encode_session_t()

video::nvenc_encode_session_t::nvenc_encode_session_t ( std::unique_ptr< platf::nvenc_encode_device_t > encode_device)
inline

Initialize an NVENC encode session and take ownership of its device.

Parameters
encode_deviceEncode device.

Member Function Documentation

◆ convert()

int video::nvenc_encode_session_t::convert ( platf::img_t & img)
inlineoverridevirtual

Encode one frame with NVENC and return the packet payload.

Parameters
imgImage or frame object to read from or populate.
Returns
Conversion status.

Implements video::encode_session_t.

◆ encode_frame()

nvenc::nvenc_encoded_frame video::nvenc_encode_session_t::encode_frame ( uint64_t frame_index)
inline

Submit the next frame to NVENC and return the encoded payload.

Parameters
frame_indexMonotonic frame index assigned by the video pipeline.
Returns
Encoded NVENC frame payload and frame metadata.

◆ invalidate_ref_frames()

void video::nvenc_encode_session_t::invalidate_ref_frames ( int64_t first_frame,
int64_t last_frame )
inlineoverridevirtual

Mark the frame range whose references must be invalidated.

Parameters
first_frameFirst frame.
last_frameLast frame.

Implements video::encode_session_t.

◆ request_idr_frame()

void video::nvenc_encode_session_t::request_idr_frame ( )
inlineoverridevirtual

Mark the frame as a request for an IDR frame.

Implements video::encode_session_t.

◆ request_normal_frame()

void video::nvenc_encode_session_t::request_normal_frame ( )
inlineoverridevirtual

Mark the frame as a request for a normal inter frame.

Implements video::encode_session_t.


The documentation for this class was generated from the following file: