mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 11:30:59 +00:00
gtk4: Document paintable properties correctly
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1655>
This commit is contained in:
parent
195c089f18
commit
6e974cf4b9
5 changed files with 87 additions and 5 deletions
|
@ -2565,7 +2565,7 @@
|
||||||
"controllable": false,
|
"controllable": false,
|
||||||
"mutable": "null",
|
"mutable": "null",
|
||||||
"readable": true,
|
"readable": true,
|
||||||
"type": "GdkPaintable",
|
"type": "GstGtk4Paintable",
|
||||||
"writable": false
|
"writable": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -2574,7 +2574,81 @@
|
||||||
},
|
},
|
||||||
"filename": "gstgtk4",
|
"filename": "gstgtk4",
|
||||||
"license": "MPL",
|
"license": "MPL",
|
||||||
"other-types": {},
|
"other-types": {
|
||||||
|
"GstGtk4Paintable": {
|
||||||
|
"hierarchy": [
|
||||||
|
"GstGtk4Paintable",
|
||||||
|
"GObject"
|
||||||
|
],
|
||||||
|
"interfaces": [
|
||||||
|
"GdkPaintable"
|
||||||
|
],
|
||||||
|
"kind": "object",
|
||||||
|
"properties": {
|
||||||
|
"background-color": {
|
||||||
|
"blurb": "Background color to render behind the video frame and in the borders",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "255",
|
||||||
|
"max": "-1",
|
||||||
|
"min": "0",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "guint",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
|
"force-aspect-ratio": {
|
||||||
|
"blurb": "When enabled, scaling will respect original aspect ratio",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "false",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gboolean",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
|
"gl-context": {
|
||||||
|
"blurb": "GL context to use for rendering",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": true,
|
||||||
|
"controllable": false,
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "GdkGLContext",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
|
"scaling-filter": {
|
||||||
|
"blurb": "Scaling filter to use for rendering",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "linear (0)",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "GskScalingFilter",
|
||||||
|
"writable": true
|
||||||
|
},
|
||||||
|
"use-scaling-filter": {
|
||||||
|
"blurb": "Use selected scaling filter or GTK default for rendering",
|
||||||
|
"conditionally-available": false,
|
||||||
|
"construct": false,
|
||||||
|
"construct-only": false,
|
||||||
|
"controllable": false,
|
||||||
|
"default": "false",
|
||||||
|
"mutable": "null",
|
||||||
|
"readable": true,
|
||||||
|
"type": "gboolean",
|
||||||
|
"writable": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"package": "gst-plugin-gtk4",
|
"package": "gst-plugin-gtk4",
|
||||||
"source": "gst-plugin-gtk4",
|
"source": "gst-plugin-gtk4",
|
||||||
"tracers": {},
|
"tracers": {},
|
||||||
|
|
|
@ -19,9 +19,17 @@ use gst::glib;
|
||||||
|
|
||||||
mod sink;
|
mod sink;
|
||||||
mod utils;
|
mod utils;
|
||||||
|
pub use sink::paintable::Paintable;
|
||||||
pub use sink::PaintableSink;
|
pub use sink::PaintableSink;
|
||||||
|
|
||||||
fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
|
fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> {
|
||||||
|
#[cfg(feature = "doc")]
|
||||||
|
{
|
||||||
|
use gst::prelude::*;
|
||||||
|
|
||||||
|
sink::paintable::Paintable::static_type().mark_as_plugin_api(gst::PluginAPIFlags::empty());
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "gtk_v4_10"))]
|
#[cfg(not(feature = "gtk_v4_10"))]
|
||||||
{
|
{
|
||||||
if gtk::micro_version() >= 13 {
|
if gtk::micro_version() >= 13 {
|
||||||
|
|
|
@ -89,7 +89,7 @@ impl ObjectImpl for PaintableSink {
|
||||||
fn properties() -> &'static [glib::ParamSpec] {
|
fn properties() -> &'static [glib::ParamSpec] {
|
||||||
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
|
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
|
||||||
vec![
|
vec![
|
||||||
glib::ParamSpecObject::builder::<gdk::Paintable>("paintable")
|
glib::ParamSpecObject::builder::<super::paintable::Paintable>("paintable")
|
||||||
.nick("Paintable")
|
.nick("Paintable")
|
||||||
.blurb("The Paintable the sink renders to")
|
.blurb("The Paintable the sink renders to")
|
||||||
.read_only()
|
.read_only()
|
||||||
|
|
|
@ -40,7 +40,7 @@ use gtk::glib::prelude::*;
|
||||||
|
|
||||||
mod frame;
|
mod frame;
|
||||||
pub(super) mod imp;
|
pub(super) mod imp;
|
||||||
mod paintable;
|
pub(super) mod paintable;
|
||||||
|
|
||||||
enum SinkEvent {
|
enum SinkEvent {
|
||||||
FrameChanged,
|
FrameChanged,
|
||||||
|
|
|
@ -22,7 +22,7 @@ glib::wrapper! {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Paintable {
|
impl Paintable {
|
||||||
pub fn new(context: Option<gdk::GLContext>) -> Self {
|
pub(crate) fn new(context: Option<gdk::GLContext>) -> Self {
|
||||||
glib::Object::builder()
|
glib::Object::builder()
|
||||||
.property("gl-context", context)
|
.property("gl-context", context)
|
||||||
.build()
|
.build()
|
||||||
|
|
Loading…
Reference in a new issue