mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-27 10:06:21 +00:00
Compare element factory names to distinguish video source from audio source
We could also go via the glib::Type but that requires more steps unless we also add a getter from the registered type to the audio/video source modules.
This commit is contained in:
parent
1a4f146318
commit
a8c9d78bff
1 changed files with 2 additions and 2 deletions
|
@ -7,6 +7,7 @@ extern crate gobject_subclass;
|
|||
extern crate gst_plugin;
|
||||
#[macro_use]
|
||||
extern crate gstreamer as gst;
|
||||
use gst::prelude::*;
|
||||
extern crate gstreamer_audio as gst_audio;
|
||||
extern crate gstreamer_base as gst_base;
|
||||
extern crate gstreamer_video as gst_video;
|
||||
|
@ -69,8 +70,7 @@ fn connect_ndi(cat: gst::DebugCategory, element: &BaseSrc, ip: &str, stream_name
|
|||
let mut audio = false;
|
||||
let mut video = false;
|
||||
|
||||
//FIXME Search for another way to know if the source is an audio or a video source
|
||||
if element.get_name().contains("audiosrc") {
|
||||
if element.get_factory().map(|f| f.get_name() == "ndiaudiosrc").unwrap_or(false) {
|
||||
audio = true;
|
||||
} else {
|
||||
video = true;
|
||||
|
|
Loading…
Reference in a new issue