Skip to content

Commit

Permalink
Init gst
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaDve committed Aug 25, 2022
1 parent fad4a89 commit c9de55d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/pipeline/element_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,18 @@ impl ElementFactoryPropertiesMap {
mod tests {
use super::*;

use std::sync::Once;

fn init_gst() {
static INIT: Once = Once::new();

INIT.call_once(|| gst::init().unwrap());
}

#[test]
fn element_properties_general_builder() {
init_gst();

let elem_props = ElementProperties::builder_general()
.field("string-prop", "hi")
.field("boolean-prop", true)
Expand All @@ -247,6 +257,8 @@ mod tests {

#[test]
fn element_properties_map_builder() {
init_gst();

let props_map = ElementFactoryPropertiesMap::new("vp8enc")
.field("cq-level", 13)
.field("resize-allowed", false);
Expand All @@ -271,6 +283,8 @@ mod tests {

#[test]
fn element_factory_properties_map_field_from_str() {
init_gst();

let prop_map_s = ElementFactoryPropertiesMap::new("vp8enc")
.field("threads", 16)
.field_from_str("keyframe-mode", "disabled")
Expand Down

0 comments on commit c9de55d

Please sign in to comment.