Skip to content

Mark pad function setters as unsafe and provide a PadBuilder, and don't allow changing the pad template of a pad and the name of an object after creation

Sebastian Dröge requested to merge slomo/gstreamer-rs:pad-builders into master

All these things are not really safe, so let's do better

commit 7862a10fb548f0357b0e1f504738d31a70856ad2 (HEAD -> pad-builders, gitlab-slomo/pad-builders)
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Sun Jun 21 19:43:21 2020 +0300

    gstreamer/pad: Don't provide constructors anymore but instead a builder
    
    This handles safely setting the pad functions during construction and
    also has special support for ghost pads.
    
    Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/247

commit 5c1853f7b3f1c55dff5b1116e32b6f2eb4de58b2
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Sun Jun 21 19:41:56 2020 +0300

    gstreamer/pad: Don't allow changing a pad's template after construction
    
    That's generally not a good idea and not safe to do.

commit 7f26cea5774a4d905b81527b61cc891384c264da
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Sun Jun 21 19:40:08 2020 +0300

    gstreamer/object: Don't provide bindings for functions to modify an object name
    
    It's generally not safe to change the object name after construction and
    not really a good idea.

commit 7e3186577867d418e809d0af24c759663ce4419b
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Sun Jun 21 18:28:04 2020 +0300

    gstreamer/pad: Mark pad function setters as unsafe
    
    This is not thread-safe and changing the function at a bad time will
    cause crashes or worse. It's only really safe to set the functions right
    after construction of the pad before any other code can know about it.
    
    Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/247

commit c10a96d9766472d712c8354923c4eff98c1e1695
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Sun Jun 21 18:27:39 2020 +0300

    gstreamer/caps: Fix clippy warning
    
    No need to provide the field name if it's initialized with a variable of
    the same name.

Merge request reports