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

View file

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

View file

@ -20,7 +20,7 @@ glib::wrapper! {
impl RTPAv1Pay { impl RTPAv1Pay {
pub fn new() -> Self { 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 { impl Default for Signaller {
fn default() -> Self { fn default() -> Self {
glib::Object::new::<Self>(&[]) glib::Object::new_default()
} }
} }

View file

@ -1402,7 +1402,7 @@ impl WebRTCSink {
); );
let pipeline = gst::Pipeline::builder() let pipeline = gst::Pipeline::builder()
.name(&format!("session-pipeline-{}", session_id)) .name(format!("session-pipeline-{}", session_id))
.build(); .build();
let webrtcbin = make_element("webrtcbin", Some(&format!("webrtcbin-{}", session_id))) 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 { impl Default for WebRTCSink {
fn default() -> Self { fn default() -> Self {
glib::Object::new::<Self>(&[]) glib::Object::new_default()
} }
} }
impl WebRTCSink { impl WebRTCSink {
pub fn with_signaller(signaller: Box<dyn SignallableObject>) -> Self { 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(); let ws = ret.imp();
ws.set_signaller(signaller).unwrap(); ws.set_signaller(signaller).unwrap();

View file

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