Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libobs: Add experimental API to retrieve next audio timestamp on source #11176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

norihiro
Copy link
Contributor

@norihiro norihiro commented Aug 23, 2024

Description

This PR adds a new API obs_source_get_next_audio_timestamp, which returns the timestamp struct obs_source::next_audio_ts_min.

This PR will make the PR below obsolete.

Motivation and Context

The timetamp indicates the timestamp that the the next call of obs_source_output_audio should provide, assuming if there is no delay in the audio filters.

This should be helpful for my plugin async-audio-filter. The usage will be like this PR. Without this API, the plugin need to estimate next_audio_ts_min by a complicated code and still it is not always accurate.

I originally hoped the PR #6351 but the PR looks stale. Instead, I suggest to just add an API and let the plugin to do the similar job of #6351.

How Has This Been Tested?

OS: Fedora 39

Tested with the modified plugin.

Types of changes

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

Checklist:

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

@WizardCM WizardCM added the New Feature New feature or plugin label Aug 24, 2024
@RytoEX
Copy link
Member

RytoEX commented Aug 26, 2024

I believe the proposal during triage was that this should be marked as deprecated/experimental to indicate that it is a stopgap solution until a more complete solution can be produced. cc @tt2468

The timestamp is useful for determining how much the output audio
deviates from the ideal timing when outputting the next audio data.
@norihiro norihiro force-pushed the libobs-obs_source_get_next_audio_timestamp branch from 5540301 to feec60e Compare August 29, 2024 01:35
@norihiro norihiro changed the title libobs: Add API to retrieve next audio timestamp on source libobs: Add experimental API to retrieve next audio timestamp on source Aug 29, 2024
@norihiro
Copy link
Contributor Author

Added OBS_DEPRECATED to the function declaration and mentioned it is experimental and deprecated in the document as below.

.. deprecated:: experimental
   This is a stopgap solution until a complete solution is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature New feature or plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants