From 53e530f7db3d6945dbaec90ed7381e2180062c4a Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 4 Jun 2019 14:34:06 +0530 Subject: [PATCH] port all plugins to new register API Rank is now an enum rather than a u32 --- gst-plugin-audiofx/src/audioecho.rs | 7 ++++++- gst-plugin-closedcaption/src/mcc_enc.rs | 2 +- gst-plugin-closedcaption/src/mcc_parse.rs | 7 ++++++- gst-plugin-closedcaption/src/scc_enc.rs | 2 +- gst-plugin-closedcaption/src/scc_parse.rs | 7 ++++++- gst-plugin-file/src/filesink.rs | 7 ++++++- gst-plugin-file/src/filesrc.rs | 7 ++++++- gst-plugin-flv/src/flvdemux.rs | 7 ++++++- gst-plugin-http/src/httpsrc.rs | 7 ++++++- gst-plugin-rav1e/src/rav1enc.rs | 7 ++++++- gst-plugin-s3/src/s3src.rs | 2 +- gst-plugin-sodium/src/decrypter.rs | 7 ++++++- gst-plugin-sodium/src/encrypter.rs | 7 ++++++- gst-plugin-sodium/src/lib.rs | 3 +-- gst-plugin-threadshare/src/appsrc.rs | 7 ++++++- gst-plugin-threadshare/src/proxy.rs | 14 ++++++++++++-- gst-plugin-threadshare/src/queue.rs | 2 +- gst-plugin-threadshare/src/tcpclientsrc.rs | 7 ++++++- gst-plugin-threadshare/src/udpsrc.rs | 7 ++++++- gst-plugin-togglerecord/src/togglerecord.rs | 7 ++++++- gst-plugin-tutorial/src/identity.rs | 7 ++++++- gst-plugin-tutorial/src/progressbin.rs | 7 ++++++- gst-plugin-tutorial/src/rgb2gray.rs | 7 ++++++- gst-plugin-tutorial/src/sinesrc.rs | 7 ++++++- 24 files changed, 125 insertions(+), 26 deletions(-) diff --git a/gst-plugin-audiofx/src/audioecho.rs b/gst-plugin-audiofx/src/audioecho.rs index 18de19b8..7f930981 100644 --- a/gst-plugin-audiofx/src/audioecho.rs +++ b/gst-plugin-audiofx/src/audioecho.rs @@ -316,7 +316,12 @@ impl BaseTransformImpl for AudioEcho { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "rsaudioecho", 0, AudioEcho::get_type()) + gst::Element::register( + Some(plugin), + "rsaudioecho", + gst::Rank::None, + AudioEcho::get_type(), + ) } struct RingBuffer { diff --git a/gst-plugin-closedcaption/src/mcc_enc.rs b/gst-plugin-closedcaption/src/mcc_enc.rs index 99ca0049..4c8a8b0e 100644 --- a/gst-plugin-closedcaption/src/mcc_enc.rs +++ b/gst-plugin-closedcaption/src/mcc_enc.rs @@ -630,5 +630,5 @@ impl ElementImpl for MccEnc { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "mccenc", 0, MccEnc::get_type()) + gst::Element::register(Some(plugin), "mccenc", gst::Rank::None, MccEnc::get_type()) } diff --git a/gst-plugin-closedcaption/src/mcc_parse.rs b/gst-plugin-closedcaption/src/mcc_parse.rs index 8b3403fb..c851ef10 100644 --- a/gst-plugin-closedcaption/src/mcc_parse.rs +++ b/gst-plugin-closedcaption/src/mcc_parse.rs @@ -1291,5 +1291,10 @@ impl ElementImpl for MccParse { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "mccparse", 0, MccParse::get_type()) + gst::Element::register( + Some(plugin), + "mccparse", + gst::Rank::None, + MccParse::get_type(), + ) } diff --git a/gst-plugin-closedcaption/src/scc_enc.rs b/gst-plugin-closedcaption/src/scc_enc.rs index b56749bf..c4c67f4b 100644 --- a/gst-plugin-closedcaption/src/scc_enc.rs +++ b/gst-plugin-closedcaption/src/scc_enc.rs @@ -450,5 +450,5 @@ impl ElementImpl for SccEnc { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "sccenc", 0, SccEnc::get_type()) + gst::Element::register(Some(plugin), "sccenc", gst::Rank::None, SccEnc::get_type()) } diff --git a/gst-plugin-closedcaption/src/scc_parse.rs b/gst-plugin-closedcaption/src/scc_parse.rs index 379556e9..d2c45cdc 100644 --- a/gst-plugin-closedcaption/src/scc_parse.rs +++ b/gst-plugin-closedcaption/src/scc_parse.rs @@ -561,5 +561,10 @@ impl ElementImpl for SccParse { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "sccparse", 0, SccParse::get_type()) + gst::Element::register( + Some(plugin), + "sccparse", + gst::Rank::None, + SccParse::get_type(), + ) } diff --git a/gst-plugin-file/src/filesink.rs b/gst-plugin-file/src/filesink.rs index f84629a8..1138b641 100644 --- a/gst-plugin-file/src/filesink.rs +++ b/gst-plugin-file/src/filesink.rs @@ -327,5 +327,10 @@ impl URIHandlerImpl for FileSink { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "rsfilesink", 256 + 100, FileSink::get_type()) + gst::Element::register( + Some(plugin), + "rsfilesink", + gst::Rank::Primary + 100, + FileSink::get_type(), + ) } diff --git a/gst-plugin-file/src/filesrc.rs b/gst-plugin-file/src/filesrc.rs index a817f9bc..8de00349 100644 --- a/gst-plugin-file/src/filesrc.rs +++ b/gst-plugin-file/src/filesrc.rs @@ -381,5 +381,10 @@ impl URIHandlerImpl for FileSrc { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "rsfilesrc", 256 + 100, FileSrc::get_type()) + gst::Element::register( + Some(plugin), + "rsfilesrc", + gst::Rank::Primary + 100, + FileSrc::get_type(), + ) } diff --git a/gst-plugin-flv/src/flvdemux.rs b/gst-plugin-flv/src/flvdemux.rs index 0f12cf98..b197f76e 100644 --- a/gst-plugin-flv/src/flvdemux.rs +++ b/gst-plugin-flv/src/flvdemux.rs @@ -1580,5 +1580,10 @@ impl Metadata { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "rsflvdemux", 256 + 100, FlvDemux::get_type()) + gst::Element::register( + Some(plugin), + "rsflvdemux", + gst::Rank::Primary + 100, + FlvDemux::get_type(), + ) } diff --git a/gst-plugin-http/src/httpsrc.rs b/gst-plugin-http/src/httpsrc.rs index 78599693..f571ec6c 100644 --- a/gst-plugin-http/src/httpsrc.rs +++ b/gst-plugin-http/src/httpsrc.rs @@ -459,5 +459,10 @@ impl ObjectSubclass for HttpSrc { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "rshttpsrc", 256 + 100, HttpSrc::get_type()) + gst::Element::register( + Some(plugin), + "rshttpsrc", + gst::Rank::Primary + 100, + HttpSrc::get_type(), + ) } diff --git a/gst-plugin-rav1e/src/rav1enc.rs b/gst-plugin-rav1e/src/rav1enc.rs index de148fb0..d4158fb3 100644 --- a/gst-plugin-rav1e/src/rav1enc.rs +++ b/gst-plugin-rav1e/src/rav1enc.rs @@ -725,5 +725,10 @@ impl Rav1Enc { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "rav1enc", 0, Rav1Enc::get_type()) + gst::Element::register( + Some(plugin), + "rav1enc", + gst::Rank::None, + Rav1Enc::get_type(), + ) } diff --git a/gst-plugin-s3/src/s3src.rs b/gst-plugin-s3/src/s3src.rs index 26f49d36..3318932e 100644 --- a/gst-plugin-s3/src/s3src.rs +++ b/gst-plugin-s3/src/s3src.rs @@ -458,5 +458,5 @@ impl BaseSrcImpl for S3Src { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "s3src", 0, S3Src::get_type()) + gst::Element::register(Some(plugin), "s3src", gst::Rank::None, S3Src::get_type()) } diff --git a/gst-plugin-sodium/src/decrypter.rs b/gst-plugin-sodium/src/decrypter.rs index 7bcd18c7..42a13624 100644 --- a/gst-plugin-sodium/src/decrypter.rs +++ b/gst-plugin-sodium/src/decrypter.rs @@ -693,5 +693,10 @@ impl ElementImpl for Decrypter { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "sodiumdecrypter", 0, Decrypter::get_type()) + gst::Element::register( + Some(plugin), + "sodiumdecrypter", + gst::Rank::None, + Decrypter::get_type(), + ) } diff --git a/gst-plugin-sodium/src/encrypter.rs b/gst-plugin-sodium/src/encrypter.rs index 21d08ac7..03dbb16b 100644 --- a/gst-plugin-sodium/src/encrypter.rs +++ b/gst-plugin-sodium/src/encrypter.rs @@ -565,5 +565,10 @@ impl ElementImpl for Encrypter { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "sodiumencrypter", 0, Encrypter::get_type()) + gst::Element::register( + Some(plugin), + "sodiumencrypter", + gst::Rank::None, + Encrypter::get_type(), + ) } diff --git a/gst-plugin-sodium/src/lib.rs b/gst-plugin-sodium/src/lib.rs index 01094556..2555c8ef 100644 --- a/gst-plugin-sodium/src/lib.rs +++ b/gst-plugin-sodium/src/lib.rs @@ -42,13 +42,12 @@ mod decrypter; mod encrypter; fn typefind_register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - use glib::translate::ToGlib; use gst::{Caps, TypeFind, TypeFindProbability}; TypeFind::register( Some(plugin), "sodium_encrypted_typefind", - gst::Rank::Primary.to_glib() as u32, + gst::Rank::Primary, None, Some(&Caps::new_simple("application/x-sodium-encrypted", &[])), |typefind| { diff --git a/gst-plugin-threadshare/src/appsrc.rs b/gst-plugin-threadshare/src/appsrc.rs index 769d37a7..220f4887 100644 --- a/gst-plugin-threadshare/src/appsrc.rs +++ b/gst-plugin-threadshare/src/appsrc.rs @@ -686,5 +686,10 @@ impl ElementImpl for AppSrc { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "ts-appsrc", 0, AppSrc::get_type()) + gst::Element::register( + Some(plugin), + "ts-appsrc", + gst::Rank::None, + AppSrc::get_type(), + ) } diff --git a/gst-plugin-threadshare/src/proxy.rs b/gst-plugin-threadshare/src/proxy.rs index 55a194c0..89fcc626 100644 --- a/gst-plugin-threadshare/src/proxy.rs +++ b/gst-plugin-threadshare/src/proxy.rs @@ -1348,6 +1348,16 @@ impl ElementImpl for ProxySrc { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "ts-proxysink", 0, ProxySink::get_type())?; - gst::Element::register(Some(plugin), "ts-proxysrc", 0, ProxySrc::get_type()) + gst::Element::register( + Some(plugin), + "ts-proxysink", + gst::Rank::None, + ProxySink::get_type(), + )?; + gst::Element::register( + Some(plugin), + "ts-proxysrc", + gst::Rank::None, + ProxySrc::get_type(), + ) } diff --git a/gst-plugin-threadshare/src/queue.rs b/gst-plugin-threadshare/src/queue.rs index 7d2b32dd..d318d945 100644 --- a/gst-plugin-threadshare/src/queue.rs +++ b/gst-plugin-threadshare/src/queue.rs @@ -957,5 +957,5 @@ impl ElementImpl for Queue { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "ts-queue", 0, Queue::get_type()) + gst::Element::register(Some(plugin), "ts-queue", gst::Rank::None, Queue::get_type()) } diff --git a/gst-plugin-threadshare/src/tcpclientsrc.rs b/gst-plugin-threadshare/src/tcpclientsrc.rs index 8c9ce721..2ab385e5 100644 --- a/gst-plugin-threadshare/src/tcpclientsrc.rs +++ b/gst-plugin-threadshare/src/tcpclientsrc.rs @@ -755,5 +755,10 @@ impl ElementImpl for TcpClientSrc { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "ts-tcpclientsrc", 0, TcpClientSrc::get_type()) + gst::Element::register( + Some(plugin), + "ts-tcpclientsrc", + gst::Rank::None, + TcpClientSrc::get_type(), + ) } diff --git a/gst-plugin-threadshare/src/udpsrc.rs b/gst-plugin-threadshare/src/udpsrc.rs index 46cf3ade..b724a580 100644 --- a/gst-plugin-threadshare/src/udpsrc.rs +++ b/gst-plugin-threadshare/src/udpsrc.rs @@ -1135,5 +1135,10 @@ impl ElementImpl for UdpSrc { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "ts-udpsrc", 0, UdpSrc::get_type()) + gst::Element::register( + Some(plugin), + "ts-udpsrc", + gst::Rank::None, + UdpSrc::get_type(), + ) } diff --git a/gst-plugin-togglerecord/src/togglerecord.rs b/gst-plugin-togglerecord/src/togglerecord.rs index b05321ad..9d5f8642 100644 --- a/gst-plugin-togglerecord/src/togglerecord.rs +++ b/gst-plugin-togglerecord/src/togglerecord.rs @@ -1399,5 +1399,10 @@ impl ElementImpl for ToggleRecord { } pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "togglerecord", 0, ToggleRecord::get_type()) + gst::Element::register( + Some(plugin), + "togglerecord", + gst::Rank::None, + ToggleRecord::get_type(), + ) } diff --git a/gst-plugin-tutorial/src/identity.rs b/gst-plugin-tutorial/src/identity.rs index e2991b1f..8569b065 100644 --- a/gst-plugin-tutorial/src/identity.rs +++ b/gst-plugin-tutorial/src/identity.rs @@ -274,5 +274,10 @@ impl ElementImpl for Identity { // the name "rsidentity" for being able to instantiate it via e.g. // gst::ElementFactory::make(). pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "rsidentity", 0, Identity::get_type()) + gst::Element::register( + Some(plugin), + "rsidentity", + gst::Rank::None, + Identity::get_type(), + ) } diff --git a/gst-plugin-tutorial/src/progressbin.rs b/gst-plugin-tutorial/src/progressbin.rs index f5241794..4d4da97f 100644 --- a/gst-plugin-tutorial/src/progressbin.rs +++ b/gst-plugin-tutorial/src/progressbin.rs @@ -177,5 +177,10 @@ impl BinImpl for ProgressBin { // the name "rsprogressbin" for being able to instantiate it via e.g. // gst::ElementFactory::make(). pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "rsprogressbin", 0, ProgressBin::get_type()) + gst::Element::register( + Some(plugin), + "rsprogressbin", + gst::Rank::None, + ProgressBin::get_type(), + ) } diff --git a/gst-plugin-tutorial/src/rgb2gray.rs b/gst-plugin-tutorial/src/rgb2gray.rs index d270cc35..ef2edc8c 100644 --- a/gst-plugin-tutorial/src/rgb2gray.rs +++ b/gst-plugin-tutorial/src/rgb2gray.rs @@ -567,5 +567,10 @@ impl BaseTransformImpl for Rgb2Gray { // the name "rsrgb2gray" for being able to instantiate it via e.g. // gst::ElementFactory::make(). pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "rsrgb2gray", 0, Rgb2Gray::get_type()) + gst::Element::register( + Some(plugin), + "rsrgb2gray", + gst::Rank::None, + Rgb2Gray::get_type(), + ) } diff --git a/gst-plugin-tutorial/src/sinesrc.rs b/gst-plugin-tutorial/src/sinesrc.rs index 4f6821ca..a8856709 100644 --- a/gst-plugin-tutorial/src/sinesrc.rs +++ b/gst-plugin-tutorial/src/sinesrc.rs @@ -858,5 +858,10 @@ impl BaseSrcImpl for SineSrc { // the name "sinesrc" for being able to instantiate it via e.g. // gst::ElementFactory::make(). pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { - gst::Element::register(Some(plugin), "rssinesrc", 0, SineSrc::get_type()) + gst::Element::register( + Some(plugin), + "rssinesrc", + gst::Rank::None, + SineSrc::get_type(), + ) }