obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

libobs: Add `obs_encoder_parent_video()` method

Open tt2468 opened this issue 1 year ago • 4 comments

Description

Allows parent (original) video object of an encoder with an FPS divisor to be fetched.

Motivation and Context

When implementing a non-shared-texture encoder, I needed to be able to determine the original video_t object to use as a reference for a cross-encoder frame caching system. Since FPS division creates a new video_t object, multiple encoders cannot be associated with each other if one of them has a divisor set, as the video_t object will be different.

How Has This Been Tested?

Ubuntu 22.04, runs

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

tt2468 avatar Jan 27 '24 04:01 tt2468

Please squash your commits as the documentation change requires the code changes.

WizardCM avatar Jan 27 '24 23:01 WizardCM

Commits squashed

tt2468 avatar Jan 30 '24 01:01 tt2468

Seems fine, I recently had a use for this as well (GPU rescaling allows multiple video outputs with different formats, but get_mix_for_video fails if your encoder has an fps divisor, so if you need to get info from the mix that doesn't work right now).

derrod avatar Feb 07 '24 18:02 derrod

I might remove the backticks from the commit message though.

RytoEX avatar Apr 10 '24 22:04 RytoEX