mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-05-29 05:38:22 +00:00
This plugin takes I420/YUV and appends an alpha plane to give YUVA/A420 to round the corners analogous to the border-radius in CSS. Other video formats like NV12 not supported yet. Support for other planar formats will follow. Not all ways of specifying border-radius as in CSS are implemented at the moment. Currently, we only support specifying it in pixels and it gets applied uniformly to all corners.
30 lines
861 B
Rust
30 lines
861 B
Rust
// Copyright (C) 2021 Asymptotic Inc.
|
|
// Author: Sanchayan Maity <sanchayan@asymptotic.io>
|
|
//
|
|
// This Source Code Form is subject to the terms of the Mozilla Public License, v2.0.
|
|
// If a copy of the MPL was not distributed with this file, You can obtain one at
|
|
// <https://mozilla.org/MPL/2.0/>.
|
|
//
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
use gst::glib;
|
|
use gst::prelude::*;
|
|
|
|
pub mod roundedcorners;
|
|
|
|
glib::wrapper! {
|
|
pub struct RoundedCorners(ObjectSubclass<roundedcorners::RoundedCorners>) @extends gst_base::BaseTransform, gst::Element, gst::Object;
|
|
}
|
|
|
|
unsafe impl Send for RoundedCorners {}
|
|
unsafe impl Sync for RoundedCorners {}
|
|
|
|
pub fn register(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
|
|
gst::Element::register(
|
|
Some(plugin),
|
|
"roundedcorners",
|
|
gst::Rank::None,
|
|
RoundedCorners::static_type(),
|
|
)
|
|
}
|