File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
recording/src/sources/screen_capture
scap-screencapturekit/src Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -129,10 +129,7 @@ impl ScreenCaptureConfig<CMSampleBufferCapture> {
129129
130130 debug ! ( "size: {:?}" , size) ;
131131
132- // Calculate queue depth based on FPS to provide adequate buffering
133- // Formula: (fps / 30.0 * 10.0).ceil() gives ~10 frames at 30fps, scaling with higher fps
134- // Minimum of 8, maximum of 16 to balance memory usage and tolerance for processing delays
135- let queue_depth = ( ( self . config . fps as f32 / 30.0 * 10.0 ) . ceil ( ) as isize ) . clamp ( 8 , 16 ) ;
132+ let queue_depth = ( ( self . config . fps as f32 / 30.0 * 5.0 ) . ceil ( ) as isize ) . clamp ( 3 , 8 ) ;
136133 debug ! ( "Using queue depth: {}" , queue_depth) ;
137134
138135 let mut settings = scap_screencapturekit:: StreamCfgBuilder :: default ( )
Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ impl StreamCfgBuilder {
3737
3838 /// Sets the queue depth (number of frames to buffer).
3939 /// Higher values provide more tolerance for processing delays but use more memory.
40- /// Apple's default is 3. Recommended: 8-12 for 30fps, 12-16 for 60fps .
40+ /// Apple's default is 3. Maximum is 8 .
4141 pub fn set_queue_depth ( & mut self , depth : isize ) {
42- self . 0 . set_queue_depth ( depth) ;
42+ self . 0 . set_queue_depth ( depth. min ( 8 ) ) ;
4343 }
4444
4545 /// Logical width of the capture area
You can’t perform that action at this time.
0 commit comments