Skip to content

Conversation

@yuto-trd
Copy link
Member

@yuto-trd yuto-trd commented Dec 6, 2025

Description

This pull request introduces chunked sample and frame generation with improved buffering, threading, and disposal handling. The changes aim to enhance performance and resource management.

Breaking changes

None.

Fixed issues

None.

Copilot AI review requested due to automatic review settings December 6, 2025 17:52
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the sample and frame generation system to use chunked processing with background threads and channels for improved performance and resource management. The implementation converts SampleProviderImpl and FrameProviderImpl to sealed, disposable classes that produce data chunks asynchronously through bounded channels, while the main methods consume from these channels on-demand.

  • Introduces producer-consumer pattern using System.Threading.Channels for asynchronous data generation
  • Adds proper disposal handling with IDisposable implementation and resource cleanup
  • Implements chunk-based buffering for audio samples with ConcurrentDictionary cache

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 18 comments.

File Description
src/Beutl/ViewModels/Tools/OutputViewModel.cs Adds using statements for frameProvider and sampleProvider to ensure proper disposal
src/Beutl/Models/SampleProviderImpl.cs Complete rewrite to sealed class with chunked audio sample generation, channel-based producer-consumer pattern, and concurrent buffering
src/Beutl/Models/FrameProviderImpl.cs Complete rewrite to sealed class with background frame rendering using channels and improved disposal handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2025

No TODO comments were found.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2025

Code Coverage

Package Line Rate Branch Rate Complexity Health
Beutl.Operators 3% 0% 140
Beutl.Core 34% 31% 3144
Beutl.Engine 27% 24% 9892
Beutl.Threading 100% 94% 118
Beutl.Utilities 73% 67% 358
Beutl.Configuration 38% 19% 282
Beutl.Extensibility 2% 0% 105
Beutl.ProjectSystem 17% 10% 1867
Beutl.Language 0% 0% 659
Summary 27% (10575 / 39487) 25% (2815 / 11277) 16565

Minimum allowed line rate is 0%

@yuto-trd yuto-trd merged commit d2dcf01 into main Dec 7, 2025
4 checks passed
@yuto-trd yuto-trd deleted the feat/buffered-output branch December 7, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants