Update for various deprecated APIs

This commit is contained in:
Sebastian Dröge 2023-01-22 20:07:26 +02:00
parent 037294b077
commit 2c386fb792
7 changed files with 11 additions and 9 deletions

View file

@ -693,7 +693,7 @@ fn setup(
let pipeline = gst::Pipeline::default();
// Src
let src_element = glib::Object::new::<ElementSrcTest>(&[]);
let src_element = glib::Object::new_default::<ElementSrcTest>();
src_element.set_property("context", &context_name);
pipeline.add(&src_element).unwrap();
@ -713,7 +713,9 @@ fn setup(
// Sink
let (sender, receiver) = mpsc::channel::<Item>(10);
let sink_element = glib::Object::new::<ElementSinkTest>(&[("sender", &ItemSender { sender })]);
let sink_element = glib::Object::builder::<ElementSinkTest>()
.property("sender", ItemSender { sender })
.build();
pipeline.add(&sink_element).unwrap();
last_element.link(&sink_element).unwrap();

View file

@ -20,7 +20,7 @@ glib::wrapper! {
impl RTPAv1Depay {
pub fn new() -> Self {
glib::Object::new(&[])
glib::Object::new_default()
}
}

View file

@ -20,7 +20,7 @@ glib::wrapper! {
impl RTPAv1Pay {
pub fn new() -> Self {
glib::Object::new(&[])
glib::Object::new_default()
}
}

View file

@ -59,6 +59,6 @@ impl Signallable for Signaller {
impl Default for Signaller {
fn default() -> Self {
glib::Object::new::<Self>(&[])
glib::Object::new_default()
}
}

View file

@ -1402,7 +1402,7 @@ impl WebRTCSink {
);
let pipeline = gst::Pipeline::builder()
.name(&format!("session-pipeline-{}", session_id))
.name(format!("session-pipeline-{}", session_id))
.build();
let webrtcbin = make_element("webrtcbin", Some(&format!("webrtcbin-{}", session_id)))

View file

@ -83,13 +83,13 @@ impl<T: AsRef<glib::Object> + Signallable> SignallableObject for T {}
impl Default for WebRTCSink {
fn default() -> Self {
glib::Object::new::<Self>(&[])
glib::Object::new_default()
}
}
impl WebRTCSink {
pub fn with_signaller(signaller: Box<dyn SignallableObject>) -> Self {
let ret: WebRTCSink = glib::Object::new(&[]);
let ret = glib::Object::new_default::<WebRTCSink>();
let ws = ret.imp();
ws.set_signaller(signaller).unwrap();

View file

@ -16,6 +16,6 @@ glib::wrapper! {
impl CustomSource {
pub fn new(source: &gst::Element) -> CustomSource {
glib::Object::new(&[("source", source)])
glib::Object::builder().property("source", source).build()
}
}