Skip to content

Commit

Permalink
Add option to force software decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
20kdc committed Dec 18, 2023
1 parent fc739bd commit ebdc6ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion alvr/client_core/src/connection.rs
Expand Up @@ -457,7 +457,7 @@ fn connection_pipeline(

match maybe_packet {
Ok(ServerControlPacket::InitializeDecoder(config)) => {
decoder::create_decoder(config);
decoder::create_decoder(config, settings.video.force_software_decoder);
}
Ok(ServerControlPacket::Restarting) => {
info!("{SERVER_RESTART_MESSAGE}");
Expand Down
3 changes: 2 additions & 1 deletion alvr/client_core/src/decoder.rs
Expand Up @@ -38,9 +38,10 @@ pub static DECODER_SOURCE: alvr_common::OptLazy<crate::platform::VideoDecoderSou

pub static EXTERNAL_DECODER: RelaxedAtomic = RelaxedAtomic::new(false);

pub fn create_decoder(lazy_config: DecoderInitializationConfig) {
pub fn create_decoder(lazy_config: DecoderInitializationConfig, force_software_decoder: bool) {
let mut config = DECODER_INIT_CONFIG.lock();
config.codec = lazy_config.codec;
config.force_software_decoder = force_software_decoder;

if EXTERNAL_DECODER.value() {
EVENT_QUEUE
Expand Down
6 changes: 6 additions & 0 deletions alvr/session/src/settings.rs
Expand Up @@ -479,6 +479,11 @@ pub struct VideoConfig {

pub clientside_foveation: Switch<ClientsideFoveationConfig>,

#[schema(strings(
help = "Attempts to use a software decoder on the device. Slow, but may work around broken codecs."
))]
pub force_software_decoder: bool,

#[schema(flag = "steamvr-restart")]
pub color_correction: Switch<ColorCorrectionConfig>,
}
Expand Down Expand Up @@ -1272,6 +1277,7 @@ pub fn session_settings_default() -> SettingsDefault {
vertical_offset_deg: 0.0,
},
},
force_software_decoder: false,
color_correction: SwitchDefault {
enabled: true,
content: ColorCorrectionConfigDefault {
Expand Down

0 comments on commit ebdc6ad

Please sign in to comment.