mxl_player_components/
misc.rs

1use crate::{gst_helpers, icon_names};
2use anyhow::Result;
3use std::path::Path;
4
5pub const ENV_NAME_GST_DEBUG_DUMP_DOT_DIR: &str = "GST_DEBUG_DUMP_DOT_DIR";
6
7pub fn init(gst_debug_dump_dot_dir: &Path, cache_dir: &Path) -> Result<()> {
8    crate::localization::init();
9    mxl_relm4_components::init()?;
10    relm4_icons::initialize_icons(icon_names::GRESOURCE_BYTES, icon_names::RESOURCE_PREFIX);
11
12    unsafe { std::env::set_var(ENV_NAME_GST_DEBUG_DUMP_DOT_DIR, gst_debug_dump_dot_dir) };
13    gst_helpers::init(cache_dir);
14    gst::init()?;
15
16    gstgtk4::plugin_register_static().expect("Failed to register the gstgtk4 plugin");
17
18    Ok(())
19}