Skip to content

Commit 199b6b5

Browse files
committed
[*] update normally
1 parent 661497a commit 199b6b5

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

lib/recorder/src/h264_writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use std::{
2222
///
2323
/// let writer = H264Writer::new("output.h264".into(), MAX_H264_WRITER_QUEUE_SIZE);
2424
/// ```
25-
pub const MAX_H264_WRITER_QUEUE_SIZE: usize = 512;
25+
pub const MAX_H264_WRITER_QUEUE_SIZE: usize = 64;
2626

2727
/// H.264 file writer that handles frame queuing and file output.
2828
///

lib/recorder/src/recorder.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use crate::{
22
AudioError, AudioRecorder, CombineTracksConfig, EncodedFrame, Frame, FrameUser, H264Writer,
3-
MAX_H264_WRITER_QUEUE_SIZE, ProgressState, RecorderConfig, RecorderError, Resolution,
4-
SimpleFpsCounter, SpeakerRecorder, StatsUser, StreamingAudioRecorder, VideoEncoder,
5-
combine_tracks,
3+
ProgressState, RecorderConfig, RecorderError, Resolution, SimpleFpsCounter, SpeakerRecorder,
4+
StatsUser, StreamingAudioRecorder, VideoEncoder, combine_tracks,
65
};
76
use capture::{Capture, CaptureIterConfig, capture_output_iter};
87
use crossbeam::channel::{Receiver, Sender, bounded};
@@ -32,7 +31,7 @@ const TMP_OUTPUT_VIDEO_EXTENSION: &str = "tmp.mp4";
3231

3332
const USER_CHANNEL_SIZE: usize = 3;
3433
const RESIZE_WORKER_CHANNEL_SIZE: usize = 16;
35-
const ENCODER_WORKER_CHANNEL_SIZE: usize = 32;
34+
pub const ENCODER_WORKER_CHANNEL_SIZE: usize = 32;
3635

3736
static CAPTURE_MEAN_TIME: Lazy<Mutex<Option<Duration>>> = Lazy::new(|| Mutex::new(None));
3837

@@ -347,7 +346,7 @@ impl RecordingSession {
347346
} else {
348347
Some(H264Writer::new(
349348
self.config.output_path.with_extension(RAW_VIDEO_EXTENSION),
350-
MAX_H264_WRITER_QUEUE_SIZE,
349+
ENCODER_WORKER_CHANNEL_SIZE,
351350
))
352351
};
353352

@@ -705,7 +704,7 @@ impl RecordingSession {
705704
frame: frame.clone(),
706705
};
707706
if let Err(e) = sender.try_send(frame_user) {
708-
log::warn!("try send frame failed: {e}");
707+
log::warn!("try send frame to user frame channel failed: {e}");
709708
}
710709
}
711710

wayshot/src/logic/recorder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ fn init_desktop_speaker(ui: &AppWindow) -> Result<()> {
174174
let ui_weak = ui.as_weak();
175175

176176
thread::spawn(move || {
177-
let (sender, receiver) = bounded(1024);
177+
let (sender, receiver) = bounded(3);
178178

179179
let ui_weak_clone = ui_weak.clone();
180180
thread::spawn(move || {

0 commit comments

Comments
 (0)