libobs: Add OBS_ENCODER_CAP_SCALING

Adds a new encoder cap which tells libobs that rather than scaling
video frames in software, the encoder is capable of scaling them via
its own (presumably more efficient) means.

An encoder may implement this cap by comparing the VOI of its assigned
`video_t` and the results of `obs_encoder_get_width/height()`. If the
width/height values differ, then the encoder is being asked by libobs
to self-scale, and the resolution in VOI will be the raw frame size,
with the `...get_width/height()` being the intended output resolution
of the encoder.

It is important to note that GPU rescaling mode will take priority
over self-scaling. If GPU rescaling is enabled, the encoder will never
be asked to self-scale.

This is useful for discrete hardware encoders, where they might have
fixed-function video scaling logic that is highly efficient and fast.
Additionally, this feature allows a hardware device which is encoding
a full ABR ladder of tracks to be smart and only copy a video frame
from GPU -> Host -> Device once for the entire ladder, rather than
once for every track.
This commit is contained in:
tt2468
2024-08-23 14:20:53 -04:00
committed by Ryan Foster
parent 92b5643081
commit 16f0bb68ae
4 changed files with 21 additions and 1 deletions
+2 -1
View File
@@ -164,8 +164,9 @@ Encoder Definition Structure (obs_encoder_info)
- **OBS_ENCODER_CAP_DEPRECATED** - Encoder is deprecated
- **OBS_ENCODER_CAP_ROI** - Encoder supports region of interest feature
- **OBS_ENCODER_CAP_SCALING** - Encoder implements its own scaling logic,
desiring to receive unscaled frames
.. versionadded:: 30.1
Encoder Packet Structure (encoder_packet)
-----------------------------------------