mirror of
https://github.com/bleackstorm/SteamFrame-FPV-Control-Center.git
synced 2026-12-03 07:31:57 +01:00
perf(pc-video): enable vah264dec flexible compliance, AU alignment, and uncap desktop preview from 30Hz
This commit is contained in:
1 parent
8363915105
commit
f75dd39bd5
3 files changed
+18
-9
No files matched your search
+10
-1
@@ -800,8 +800,17 @@ pub fn compose_osd_and_publish(
|
||||
}
|
||||
}
|
||||
|
||||
// En mode Bureau (sans OpenXR), pousser chaque nouvelle trame immédiatement (<= 4 ms)
|
||||
// pour éliminer le bridage artificiel à 30 Hz (33 ms). En VR OpenXR, garder 33 ms pour
|
||||
// ne pas voler de bande passante GPU au casque.
|
||||
let preview_min_interval = if render_cpu_osd {
|
||||
Duration::from_millis(4)
|
||||
} else {
|
||||
Duration::from_millis(33)
|
||||
};
|
||||
let push_preview = ctx.control.is_preview_active()
|
||||
&& last_preview_push.is_none_or(|t| t.elapsed() >= Duration::from_millis(33));
|
||||
&& (has_new_raw_frame || !has_video_stream)
|
||||
&& last_preview_push.is_none_or(|t| t.elapsed() >= preview_min_interval);
|
||||
|
||||
if push_preview || fps_timer.elapsed() >= Duration::from_secs(1) || frame_received_at.is_some() {
|
||||
if push_preview || fps_timer.elapsed() >= Duration::from_secs(1) {
|
||||
|
||||
+1
-1
@@ -1114,7 +1114,7 @@ pub fn run_gpui_app(cfg: AppConfig, log_buffer: Arc<Mutex<LogBuffer>>) -> Result
|
||||
window
|
||||
.spawn(cx, async move |cx| {
|
||||
loop {
|
||||
Timer::after(Duration::from_millis(16)).await;
|
||||
Timer::after(Duration::from_millis(8)).await;
|
||||
let should_continue = cx
|
||||
.update(|window, cx| {
|
||||
if let Some(view) = weak_view.upgrade() {
|
||||
|
||||
+7
-7
@@ -460,14 +460,14 @@ fn select_best_decoder(is_h264: bool, allow_hw: bool) -> (&'static str, &'static
|
||||
let candidates: &[(&str, &str)] = if is_h264 {
|
||||
&[
|
||||
("v4l2h264dec", "v4l2h264dec"),
|
||||
("vah264dec", "vah264dec"),
|
||||
("vaapih264dec", "vaapih264dec"),
|
||||
("vah264dec", "vah264dec compliance=flexible"),
|
||||
("vaapih264dec", "vaapih264dec low-latency=true"),
|
||||
]
|
||||
} else {
|
||||
&[
|
||||
("v4l2h265dec", "v4l2h265dec"),
|
||||
("vah265dec", "vah265dec"),
|
||||
("vaapih265dec", "vaapih265dec"),
|
||||
("vaapih265dec", "vaapih265dec low-latency=true"),
|
||||
]
|
||||
};
|
||||
for &(factory_name, elem_desc) in candidates {
|
||||
@@ -479,12 +479,12 @@ fn select_best_decoder(is_h264: bool, allow_hw: bool) -> (&'static str, &'static
|
||||
if is_h264 {
|
||||
(
|
||||
"avdec_h264",
|
||||
"avdec_h264 max-threads=2 discard-corrupted-frames=true",
|
||||
"avdec_h264 max-threads=2 thread-type=slice output-corrupt=true",
|
||||
)
|
||||
} else {
|
||||
(
|
||||
"avdec_h265",
|
||||
"avdec_h265 max-threads=2 discard-corrupted-frames=true",
|
||||
"avdec_h265 max-threads=2 thread-type=slice output-corrupt=true",
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -510,9 +510,9 @@ fn pipeline_description_with_decoder(p: &PipelineParams, decoder_desc: &str) ->
|
||||
"h265parse name=nal_parser"
|
||||
};
|
||||
let stream_caps = if is_h264 {
|
||||
"video/x-h264,stream-format=byte-stream"
|
||||
"video/x-h264,stream-format=byte-stream,alignment=au"
|
||||
} else {
|
||||
"video/x-h265,stream-format=byte-stream"
|
||||
"video/x-h265,stream-format=byte-stream,alignment=au"
|
||||
};
|
||||
let codec_name = if is_h264 { "H264" } else { "H265" };
|
||||
let depay = if is_h264 { "rtph264depay" } else { "rtph265depay" };
|
||||
|
||||
Reference in new issue
Block a user