From 6c32b702f0cac5d5987b7ccf511a13ff50aaa9df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 5 Nov 2018 13:43:11 +0200 Subject: [PATCH] Fix build with gst-plugin-rs API changes --- gst-plugin-threadshare/src/appsrc.rs | 4 ++-- gst-plugin-threadshare/src/lib.rs | 17 +++++++++-------- gst-plugin-threadshare/src/proxy.rs | 6 +++--- gst-plugin-threadshare/src/queue.rs | 4 ++-- gst-plugin-threadshare/src/tcpclientsrc.rs | 4 ++-- gst-plugin-threadshare/src/udpsrc.rs | 4 ++-- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/gst-plugin-threadshare/src/appsrc.rs b/gst-plugin-threadshare/src/appsrc.rs index c479f65e..0977cf3d 100644 --- a/gst-plugin-threadshare/src/appsrc.rs +++ b/gst-plugin-threadshare/src/appsrc.rs @@ -666,7 +666,7 @@ impl ImplTypeStatic for AppSrcStatic { } } -pub fn register(plugin: &gst::Plugin) { +pub fn register(plugin: &gst::Plugin)-> Result<(), glib::BoolError> { let type_ = register_type(AppSrcStatic); - gst::Element::register(plugin, "ts-appsrc", 0, type_); + gst::Element::register(plugin, "ts-appsrc", 0, type_) } diff --git a/gst-plugin-threadshare/src/lib.rs b/gst-plugin-threadshare/src/lib.rs index 7dac0f93..459421df 100644 --- a/gst-plugin-threadshare/src/lib.rs +++ b/gst-plugin-threadshare/src/lib.rs @@ -54,13 +54,14 @@ mod dataqueue; mod proxy; mod queue; -fn plugin_init(plugin: &gst::Plugin) -> bool { - udpsrc::register(plugin); - tcpclientsrc::register(plugin); - queue::register(plugin); - proxy::register(plugin); - appsrc::register(plugin); - true +fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { + udpsrc::register(plugin)?; + tcpclientsrc::register(plugin)?; + queue::register(plugin)?; + proxy::register(plugin)?; + appsrc::register(plugin)?; + + Ok(()) } plugin_define!( @@ -71,7 +72,7 @@ plugin_define!( b"LGPL\0", b"threadshare\0", b"threadshare\0", - b"https://github.com/sdroege/gst-plugin-threadshare\0", + b"https://gitlab.freedesktop.org/gstreamer/gst-plugin-rs\0", b"2018-03-01\0" ); diff --git a/gst-plugin-threadshare/src/proxy.rs b/gst-plugin-threadshare/src/proxy.rs index 098def06..7d3f8277 100644 --- a/gst-plugin-threadshare/src/proxy.rs +++ b/gst-plugin-threadshare/src/proxy.rs @@ -1363,10 +1363,10 @@ impl ImplTypeStatic for ProxySrcStatic { } } -pub fn register(plugin: &gst::Plugin) { +pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { let type_ = register_type(ProxySinkStatic); - gst::Element::register(plugin, "ts-proxysink", 0, type_); + gst::Element::register(plugin, "ts-proxysink", 0, type_)?; let type_ = register_type(ProxySrcStatic); - gst::Element::register(plugin, "ts-proxysrc", 0, type_); + gst::Element::register(plugin, "ts-proxysrc", 0, type_) } diff --git a/gst-plugin-threadshare/src/queue.rs b/gst-plugin-threadshare/src/queue.rs index 707dadab..8bbd6571 100644 --- a/gst-plugin-threadshare/src/queue.rs +++ b/gst-plugin-threadshare/src/queue.rs @@ -950,8 +950,8 @@ impl ImplTypeStatic for QueueStatic { } } -pub fn register(plugin: &gst::Plugin) { +pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { let queue_static = QueueStatic; let type_ = register_type(queue_static); - gst::Element::register(plugin, "ts-queue", 0, type_); + gst::Element::register(plugin, "ts-queue", 0, type_) } diff --git a/gst-plugin-threadshare/src/tcpclientsrc.rs b/gst-plugin-threadshare/src/tcpclientsrc.rs index 68a41106..254e85cd 100644 --- a/gst-plugin-threadshare/src/tcpclientsrc.rs +++ b/gst-plugin-threadshare/src/tcpclientsrc.rs @@ -737,8 +737,8 @@ impl ImplTypeStatic for TcpClientSrcStatic { } } -pub fn register(plugin: &gst::Plugin) { +pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { let tcpclientsrc_static = TcpClientSrcStatic; let type_ = register_type(tcpclientsrc_static); - gst::Element::register(plugin, "ts-tcpclientsrc", 0, type_); + gst::Element::register(plugin, "ts-tcpclientsrc", 0, type_) } diff --git a/gst-plugin-threadshare/src/udpsrc.rs b/gst-plugin-threadshare/src/udpsrc.rs index a7170a32..5304e8a7 100644 --- a/gst-plugin-threadshare/src/udpsrc.rs +++ b/gst-plugin-threadshare/src/udpsrc.rs @@ -815,8 +815,8 @@ impl ImplTypeStatic for UdpSrcStatic { } } -pub fn register(plugin: &gst::Plugin) { +pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { let udpsrc_static = UdpSrcStatic; let type_ = register_type(udpsrc_static); - gst::Element::register(plugin, "ts-udpsrc", 0, type_); + gst::Element::register(plugin, "ts-udpsrc", 0, type_) }