mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-29 21:40:31 +00:00
webrtc: Port to new ElementBuilder API
This commit is contained in:
parent
ad78936365
commit
37c0239aff
1 changed files with 12 additions and 4 deletions
|
@ -234,7 +234,13 @@ fn create_navigation_event(sink: &super::WebRTCSink, msg: &str) {
|
||||||
/// Wrapper around `gst::ElementFactory::make` with a better error
|
/// Wrapper around `gst::ElementFactory::make` with a better error
|
||||||
/// message
|
/// message
|
||||||
pub fn make_element(element: &str, name: Option<&str>) -> Result<gst::Element, Error> {
|
pub fn make_element(element: &str, name: Option<&str>) -> Result<gst::Element, Error> {
|
||||||
gst::ElementFactory::make(element, name)
|
let mut builder = gst::ElementFactory::make(element);
|
||||||
|
if let Some(name) = name {
|
||||||
|
builder = builder.name(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
builder
|
||||||
|
.build()
|
||||||
.with_context(|| format!("Failed to make element {}", element))
|
.with_context(|| format!("Failed to make element {}", element))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,11 +468,13 @@ fn setup_encoding(
|
||||||
|
|
||||||
let enc = codec
|
let enc = codec
|
||||||
.encoder
|
.encoder
|
||||||
.create(None)
|
.create()
|
||||||
|
.build()
|
||||||
.with_context(|| format!("Creating encoder {}", codec.encoder.name()))?;
|
.with_context(|| format!("Creating encoder {}", codec.encoder.name()))?;
|
||||||
let pay = codec
|
let pay = codec
|
||||||
.payloader
|
.payloader
|
||||||
.create(None)
|
.create()
|
||||||
|
.build()
|
||||||
.with_context(|| format!("Creating payloader {}", codec.payloader.name()))?;
|
.with_context(|| format!("Creating payloader {}", codec.payloader.name()))?;
|
||||||
let parse_filter = make_element("capsfilter", None)?;
|
let parse_filter = make_element("capsfilter", None)?;
|
||||||
|
|
||||||
|
@ -1416,7 +1424,7 @@ impl WebRTCSink {
|
||||||
|
|
||||||
let rtpgccbwe = match settings.cc_info.heuristic {
|
let rtpgccbwe = match settings.cc_info.heuristic {
|
||||||
WebRTCSinkCongestionControl::GoogleCongestionControl => {
|
WebRTCSinkCongestionControl::GoogleCongestionControl => {
|
||||||
let rtpgccbwe = match gst::ElementFactory::make("rtpgccbwe", None) {
|
let rtpgccbwe = match gst::ElementFactory::make("rtpgccbwe").build() {
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
glib::g_warning!(
|
glib::g_warning!(
|
||||||
"webrtcsink",
|
"webrtcsink",
|
||||||
|
|
Loading…
Reference in a new issue