Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54905d5f10 | ||
|
|
629f647728 | ||
|
|
cb37d872ed |
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -4810,7 +4810,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sf-app"
|
name = "sf-app"
|
||||||
version = "0.1.1"
|
version = "0.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"log",
|
"log",
|
||||||
@@ -4820,7 +4820,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sf-pack"
|
name = "sf-pack"
|
||||||
version = "0.1.1"
|
version = "0.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"ruzstd",
|
"ruzstd",
|
||||||
@@ -4832,7 +4832,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sf-ui"
|
name = "sf-ui"
|
||||||
version = "0.1.1"
|
version = "0.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"glow 0.16.0",
|
"glow 0.16.0",
|
||||||
@@ -4848,7 +4848,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sf-ui-gallery"
|
name = "sf-ui-gallery"
|
||||||
version = "0.1.1"
|
version = "0.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ members = ["sf-app", "sf-ui", "sf-ui/gallery", "sf-pack"]
|
|||||||
exclude = ["templates/rust-app"]
|
exclude = ["templates/rust-app"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.1"
|
version = "0.1.4"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://gitea.bluefox.support/fennec/sdk"
|
repository = "https://gitea.bluefox.support/fennec/sdk"
|
||||||
|
|||||||
@@ -434,11 +434,14 @@ impl State {
|
|||||||
keep
|
keep
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Eases to the target and stays there. (It used to step down whenever
|
||||||
|
// it was already at the target: a fully shown video dipped every
|
||||||
|
// other frame, a visible flicker at a slow GPU's frame rate.)
|
||||||
let target = if self.video_on { 1.0 } else { 0.0 };
|
let target = if self.video_on { 1.0 } else { 0.0 };
|
||||||
self.video_alpha = if target > self.video_alpha {
|
self.video_alpha = if target > self.video_alpha {
|
||||||
(self.video_alpha + dt / 0.3).min(1.0)
|
(self.video_alpha + dt / 0.3).min(target)
|
||||||
} else {
|
} else {
|
||||||
(self.video_alpha - dt / 0.3).max(0.0)
|
(self.video_alpha - dt / 0.3).max(target)
|
||||||
};
|
};
|
||||||
if !self.video_on && self.video_alpha <= 0.0 {
|
if !self.video_on && self.video_alpha <= 0.0 {
|
||||||
self.video = None;
|
self.video = None;
|
||||||
|
|||||||
@@ -229,11 +229,16 @@ impl Player {
|
|||||||
Err(e) => log::warn!("video: vapostproc: {e}"),
|
Err(e) => log::warn!("video: vapostproc: {e}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(audio) = ["pulsesink", "pipewiresink"]
|
// Always decoded sound (PCM). When the HDMI sink also offers AC3/E-AC3
|
||||||
.iter()
|
// passthrough, pulsesink would take the encoded track as it is: a
|
||||||
.find_map(|n| gst::ElementFactory::make(n).build().ok())
|
// 44.1 kHz AC3 track then fails ("Failed to connect stream: No such
|
||||||
{
|
// entity") and a 48 kHz one goes out as a bitstream that stutters on
|
||||||
playbin.set_property("audio-sink", &audio);
|
// the Raspberry Pi.
|
||||||
|
if let Some(sink) = ["pulsesink", "pipewiresink"].into_iter().find(|n| gst::ElementFactory::find(n).is_some()) {
|
||||||
|
match gst::parse::bin_from_description(&format!("audioconvert ! audioresample ! audio/x-raw ! {sink}"), true) {
|
||||||
|
Ok(bin) => playbin.set_property("audio-sink", &bin),
|
||||||
|
Err(e) => log::warn!("video: audio sink: {e}"),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
playbin.set_property("subtitle-font-desc", opts.subtitle_font.as_str());
|
playbin.set_property("subtitle-font-desc", opts.subtitle_font.as_str());
|
||||||
playbin.set_property("av-offset", opts.audio_offset_ms * 1_000_000);
|
playbin.set_property("av-offset", opts.audio_offset_ms * 1_000_000);
|
||||||
@@ -242,6 +247,18 @@ impl Player {
|
|||||||
if !opts.subtitles {
|
if !opts.subtitles {
|
||||||
set_flag(&playbin, "text", false);
|
set_flag(&playbin, "text", false);
|
||||||
}
|
}
|
||||||
|
// FFmpeg decoders: no direct rendering. With it, gst-libav aborts the
|
||||||
|
// whole app (g_error "video meta uses 864x480 instead of 854x480")
|
||||||
|
// when a padded frame meets a renegotiation, e.g. after a seek.
|
||||||
|
playbin.connect("element-setup", false, |args| {
|
||||||
|
if let Some(el) = args.get(1).and_then(|v| v.get::<gst::Element>().ok()) {
|
||||||
|
let is_avdec = el.factory().is_some_and(|f| f.name().starts_with("avdec_"));
|
||||||
|
if is_avdec && el.find_property("direct-rendering").is_some() {
|
||||||
|
el.set_property("direct-rendering", false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
None
|
||||||
|
});
|
||||||
if let Some(ua) = opts.user_agent.clone() {
|
if let Some(ua) = opts.user_agent.clone() {
|
||||||
playbin.connect("source-setup", false, move |args| {
|
playbin.connect("source-setup", false, move |args| {
|
||||||
if let Some(src) = args.get(1).and_then(|v| v.get::<gst::Element>().ok()) {
|
if let Some(src) = args.get(1).and_then(|v| v.get::<gst::Element>().ok()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user