Merge the development branch: share menu, codec order, segmentation
Brings in the Share button's menu (Share screen / Stream Studio) and the removal of the separate Stream Studio button from the headers, the codecs every TeamSpeak client decodes ahead of H.264, the portal fix and person segmentation. The phone header keeps this branch's voice-channel button and hides the bell on the voice screen, and loses the Stream Studio button as the development branch wants. The studio's test table takes the segmentation rows and the Android camera row. MediaCodec follows the new codec order with no code change (Codecs orders every hardware factory's codecs); its description and docs/media.md now say so, including what that means on a phone without a hardware VP8, VP9 or AV1 encoder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
698e5f911e
35 files changed
+24436
-224
No files matched your search
@@ -9,7 +9,9 @@
|
||||
//! disable it (see docs/media.md).
|
||||
//!
|
||||
//! TeamSpeak clients only decode H.264 Constrained High; OpenH264 encodes
|
||||
//! without B-frames, so its High profile output qualifies.
|
||||
//! without B-frames, so its High profile output qualifies. The official
|
||||
//! client decodes H.264 only once it downloaded OpenH264 itself, so streams
|
||||
//! prefer codecs it always decodes (`voelin_core::media::decoded_everywhere`).
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
|
||||
@@ -178,8 +178,9 @@ pub fn check_decoder(codec: Codec) -> Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Encoders of this device: hardware ones first (H.264, VP9, VP8), then
|
||||
/// Google's software VP8 and H.264. Software VP9 and AV1 are too slow.
|
||||
/// Encoders of this device: the hardware ones (H.264, VP9, VP8, AV1) and
|
||||
/// Google's software VP8 and H.264; software VP9 and AV1 are too slow.
|
||||
/// `Codecs` orders them by codec, as every hardware factory.
|
||||
pub fn probe() -> Option<MediaCodecFactory> {
|
||||
let encoders = &available().encoders;
|
||||
let name = |codec| encoders.iter().find(|(c, _)| *c == codec).map(|(_, n)| n.as_str());
|
||||
|
||||
@@ -406,10 +406,12 @@ fn unavailable(codec: Codec, reason: impl Into<String>) -> Error {
|
||||
Error::CodecUnavailable { codec, reason: reason.into() }
|
||||
}
|
||||
|
||||
/// Order of codecs among hardware encoders: H.264 (every viewer decodes
|
||||
/// it), AV1, VP9, VP8, and HEVC last (only for peers that take nothing
|
||||
/// else).
|
||||
const HARDWARE_ORDER: [Codec; 5] = [Codec::H264, Codec::Av1, Codec::Vp9, Codec::Vp8, Codec::H265];
|
||||
/// Order of codecs among hardware encoders: the ones every TeamSpeak
|
||||
/// client decodes first (AV1, VP9, VP8: the official client's WebRTC stack
|
||||
/// has their decoders built in), then H.264 (the official client decodes it
|
||||
/// only with an OpenH264 library it downloads at start-up and may not get),
|
||||
/// and HEVC last (only for peers that take nothing else).
|
||||
const HARDWARE_ORDER: [Codec; 5] = [Codec::Av1, Codec::Vp9, Codec::Vp8, Codec::H264, Codec::H265];
|
||||
|
||||
/// An encoder backend in the base order (before the preference applies).
|
||||
struct Candidate {
|
||||
@@ -868,8 +870,8 @@ mod tests {
|
||||
codecs.encoders_for(&preference).iter().map(|(_, b)| b.name()).collect()
|
||||
};
|
||||
let auto = names(EncoderPreference::default());
|
||||
// Hardware in codec order (HEVC last), then software.
|
||||
assert_eq!(auto[..3], ["h264_gpu", "vp8_gpu", "hevc_gpu"]);
|
||||
// Hardware in codec order (H.264 after VP8, HEVC last), then software.
|
||||
assert_eq!(auto[..3], ["vp8_gpu", "h264_gpu", "hevc_gpu"]);
|
||||
let position = |list: &[&str], name| list.iter().position(|n| *n == name).unwrap();
|
||||
assert!(position(&auto, "x264") < position(&auto, "av1_sw"));
|
||||
#[cfg(feature = "vpx")]
|
||||
@@ -886,7 +888,7 @@ mod tests {
|
||||
assert!(!named[1..].iter().any(|n| n.ends_with("_gpu")));
|
||||
// The codecs follow the preference.
|
||||
codecs.set_preference(EncoderPreference::default());
|
||||
assert_eq!(codecs.encoder_codecs()[..3], [Codec::H264, Codec::Vp8, Codec::H265]);
|
||||
assert_eq!(codecs.encoder_codecs()[..3], [Codec::Vp8, Codec::H264, Codec::H265]);
|
||||
// The report ranks what the preference uses.
|
||||
let report = codecs.report();
|
||||
let openh264 = report.encoders.iter().find(|e| e.name == "openh264").unwrap();
|
||||
|
||||
Reference in new issue
Block a user