Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(verify): pass the write-behind muxer configs in the verify pipelines and chaos harness

Richie McIlroy4f636c1143ef
diff --git a/crates/verify/src/pipeline.rs b/crates/verify/src/pipeline.rs
index 3e4e091c0..cf127cc65 100644
--- a/crates/verify/src/pipeline.rs
+++ b/crates/verify/src/pipeline.rs
@@ -17,7 +17,7 @@ use cap_project::{AudioMeta, MultipleSegment, VideoMeta};
use cap_recording::{
AudioFrame, ChannelAudioSource, ChannelAudioSourceConfig, ChannelVideoSource,
ChannelVideoSourceConfig, OutputPipeline,
- ffmpeg::{FFmpegVideoFrame, Mp4Muxer, OggMuxer},
+ ffmpeg::{FFmpegVideoFrame, Mp4Muxer, OggMuxer, OggMuxerConfig},
};
use cap_timestamp::{Timestamp, Timestamps};
use relative_path::RelativePathBuf;
@@ -376,7 +376,7 @@ async fn record_segment(
let pipeline = OutputPipeline::builder(dir.join(rel("audio-input.ogg").as_str()))
.with_audio_source::<ChannelAudioSource>(ChannelAudioSourceConfig::new(mono_info, rx))
.with_timestamps(timestamps)
- .build::<OggMuxer>(())
+ .build::<OggMuxer>(OggMuxerConfig::default())
.await
.map_err(|e| anyhow!("mic pipeline: {e}"))?;
mic = Some((pipeline, emit, rel("audio-input.ogg")));
@@ -415,7 +415,7 @@ async fn record_segment(
.with_audio_source::<ChannelAudioSource>(ChannelAudioSourceConfig::new(stereo_info, rx))
.with_timestamps(timestamps)
.with_audio_anchor(cap_recording::AudioAnchor::PipelineEpoch)
- .build::<OggMuxer>(())
+ .build::<OggMuxer>(OggMuxerConfig::default())
.await
.map_err(|e| anyhow!("system audio pipeline: {e}"))?;
system = Some((pipeline, emit, rel("system_audio.ogg")));
@@ -862,7 +862,7 @@ pub async fn record_epoch_audio(
.with_audio_source::<ChannelAudioSource>(ChannelAudioSourceConfig::new(stereo_info, rx))
.with_timestamps(timestamps)
.with_audio_anchor(cap_recording::AudioAnchor::PipelineEpoch)
- .build::<OggMuxer>(())
+ .build::<OggMuxer>(OggMuxerConfig::default())
.await
.map_err(|e| anyhow!("epoch audio pipeline: {e}"))?;
{
diff --git a/crates/verify/tests/chaos_support/fragments.rs b/crates/verify/tests/chaos_support/fragments.rs
index 6ef3366c5..f3976f917 100644
--- a/crates/verify/tests/chaos_support/fragments.rs
+++ b/crates/verify/tests/chaos_support/fragments.rs
@@ -69,6 +69,7 @@ async fn record(dir: &Path) -> anyhow::Result<()> {
.with_timestamps(timestamps)
.build::<FragmentedAudioMuxer>(FragmentedAudioMuxerConfig {
shared_pause_state: None,
+ write_behind: false,
})
.await
.map_err(|e| anyhow!("mic pipeline: {e:#}"))?;
diff --git a/crates/verify/tests/chaos_support/record.rs b/crates/verify/tests/chaos_support/record.rs
index b9562cb0d..8dc1ece6b 100644
--- a/crates/verify/tests/chaos_support/record.rs
+++ b/crates/verify/tests/chaos_support/record.rs
@@ -16,8 +16,8 @@ use cap_recording::{
ChannelVideoSourceConfig, OutputPipeline,
ffmpeg::{
DashSegmentedAudioMuxer, DashSegmentedAudioMuxerConfig, FFmpegVideoFrame,
- FragmentedAudioMuxer, FragmentedAudioMuxerConfig, Mp4Muxer, OggMuxer, SegmentedVideoMuxer,
- SegmentedVideoMuxerConfig,
+ FragmentedAudioMuxer, FragmentedAudioMuxerConfig, Mp4Muxer, OggMuxer, OggMuxerConfig,
+ SegmentedVideoMuxer, SegmentedVideoMuxerConfig,
},
};
use cap_timestamp::{Timestamp, Timestamps};
@@ -882,11 +882,12 @@ async fn run_audio(
second = Some(tx2);
}
let built = match muxer {
- AudioMuxerKind::Ogg => builder.build::<OggMuxer>(()).await,
+ AudioMuxerKind::Ogg => builder.build::<OggMuxer>(OggMuxerConfig::default()).await,
AudioMuxerKind::FragmentedM4a => {
builder
.build::<FragmentedAudioMuxer>(FragmentedAudioMuxerConfig {
shared_pause_state: None,
+ write_behind: false,
})
.await
}
@@ -1112,10 +1113,11 @@ async fn run_mic(ctx: &Ctx, script: &MicScript, fragmented: bool) -> anyhow::Res
builder
.build::<FragmentedAudioMuxer>(FragmentedAudioMuxerConfig {
shared_pause_state: None,
+ write_behind: false,
})
.await
} else {
- builder.build::<OggMuxer>(()).await
+ builder.build::<OggMuxer>(OggMuxerConfig::default()).await
};
let pipeline = match built {
Ok(p) => p,