Skip to content

Support pausing inputs#1798

Merged
wkozyra95 merged 5 commits intomasterfrom
@wkozyra95/mp4-pause
Mar 16, 2026
Merged

Support pausing inputs#1798
wkozyra95 merged 5 commits intomasterfrom
@wkozyra95/mp4-pause

Conversation

@wkozyra95
Copy link
Copy Markdown
Member

@wkozyra95 wkozyra95 commented Mar 12, 2026

Intended primarily for mp4 input. It might lead to weird behaviors with other inputs, especially if they have any type of adaptive buffer

@wkozyra95 wkozyra95 changed the title queue pause Pause API Mar 12, 2026
@wkozyra95 wkozyra95 force-pushed the @wkozyra95/mp4-pause branch from ac8efc4 to df60a10 Compare March 12, 2026 12:06
@wkozyra95 wkozyra95 changed the title Pause API Support pausing inputs Mar 12, 2026
}
let selected = Select::new("Select input:", input_names).prompt()?;

let actions = vec!["Pause", "Unpause"];
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I know that this should be an enum, but this will need rework regardless if we add some more options

@wkozyra95 wkozyra95 force-pushed the @wkozyra95/mp4-pause branch 2 times, most recently from 4895f95 to 382f088 Compare March 13, 2026 10:56
@wkozyra95 wkozyra95 marked this pull request as ready for review March 13, 2026 13:10
Copy link
Copy Markdown
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

Adds an API endpoint to pause/unpause an input (primarily intended for MP4) and wires it through the pipeline into the core audio/video queues by applying a pause-driven PTS offset.

Changes:

  • Add /api/input/{input_id}/update with UpdateInputRequest { pause?: boolean } and register it in OpenAPI generation.
  • Implement pause/unpause in smelter-core queues via a shared PauseState that offsets PTS after unpausing.
  • Extend the integration-test demo CLI to call the new update-input endpoint.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/src/bin/generate_from_types.rs Registers the new route handler for OpenAPI generation.
tools/schemas/openapi_specification.json Adds the new endpoint and UpdateInputRequest schema.
src/routes/update_input.rs New Axum handler + request type for updating (pausing) an input.
src/routes.rs Wires the new /:id/update route under /api/input.
smelter-core/src/queue/video_queue.rs Adds pause handling for video (freeze last frame + PTS offset on enqueue).
smelter-core/src/queue/audio_queue.rs Adds pause handling for audio (skip output while paused + PTS offset on enqueue).
smelter-core/src/queue/utils.rs Introduces PauseState utility for pause tracking and accumulated PTS offset.
smelter-core/src/queue.rs Adds Queue::{pause_input, unpause_input} entry points.
smelter-core/src/pipeline/instance.rs Adds Pipeline::update_input that delegates pause/unpause to the queue.
integration-tests/examples/demo/smelter_state.rs Adds demo CLI workflow to pause/unpause inputs via the API.
integration-tests/examples/demo/main.rs Adds “Update input” action to the demo menu.
.claude/skills/api-change/SKILL.md Updates the API-change checklist to include route registration in OpenAPI paths.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread smelter-core/src/queue/audio_queue.rs
Comment thread smelter-core/src/pipeline/instance.rs
Comment thread src/routes/update_input.rs
Comment thread src/routes/update_input.rs
Comment thread smelter-core/src/queue/utils.rs
@wkozyra95 wkozyra95 force-pushed the @wkozyra95/mp4-pause branch from 382f088 to a225f55 Compare March 13, 2026 13:16
wkozyra95 and others added 2 commits March 13, 2026 14:18
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread smelter-core/src/queue/utils.rs Outdated
@wkozyra95 wkozyra95 force-pushed the @wkozyra95/mp4-pause branch from 8556b01 to 7bef108 Compare March 16, 2026 11:09
@wkozyra95 wkozyra95 merged commit aed3091 into master Mar 16, 2026
8 checks passed
@wkozyra95 wkozyra95 deleted the @wkozyra95/mp4-pause branch March 16, 2026 11:31
@wkozyra95 wkozyra95 self-assigned this Mar 16, 2026
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.

4 participants