Add GLDisplayX11 in gstreamer-gl-sys

This commit is contained in:
Víctor Manuel Jáquez Leal 2019-04-02 13:04:48 +02:00
parent f7034258cd
commit 0687fdc2a8
9 changed files with 143 additions and 11 deletions

View file

@ -45,3 +45,16 @@ cfg_condition = "feature = \"egl\""
#[[object]]
#name = "GstGL.GL_COLOR_CONVERT_VIDEO_CAPS"
#status = "manual"
[[object]]
name = "GstGL.GLDisplayX11"
status = "generate"
cfg_condition = "feature = \"x11\""
[[object.function]]
pattern = ".*"
cfg_condition = "feature = \"x11\""
[[object]]
name = "GstGL.GLDisplayX11Class"
status = "generate"
cfg_condition = "feature = \"x11\""

View file

@ -2658,8 +2658,67 @@ through the provided API</doc>
</bitfield>
<class name="GLDisplayX11" c:symbol-prefix="gl_display_x11" c:type="GstGLDisplayX11" parent="GLDisplay" glib:type-name="GstGLDisplayX11" glib:get-type="gst_gl_display_x11_get_type" glib:type-struct="GLDisplayX11Class">
<doc xml:space="preserve">the contents of a #GstGLDisplayX11 are private and should only be accessed
through the provided API</doc>
<constructor name="new" c:identifier="gst_gl_display_x11_new">
<doc xml:space="preserve">Create a new #GstGLDisplayX11 from the x11 display name. See XOpenDisplay()
for details on what is a valid name.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new #GstGLDisplayX11 or %NULL</doc>
<type name="GLDisplayX11" c:type="GstGLDisplayX11*"/>
</return-value>
<parameters>
<parameter name="name" transfer-ownership="none" nullable="1" allow-none="1">
<doc xml:space="preserve">a display name</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</constructor>
<constructor name="new_with_display" c:identifier="gst_gl_display_x11_new_with_display" introspectable="0">
<doc xml:space="preserve">Creates a new display connection from a X11 Display.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">a new #GstGLDisplayX11</doc>
<type name="GLDisplayX11" c:type="GstGLDisplayX11*"/>
</return-value>
<parameters>
<parameter name="display" transfer-ownership="none">
<doc xml:space="preserve">an existing, x11 display</doc>
<type c:type="gpointer" name="gpointer"/>
</parameter>
</parameters>
</constructor>
<field name="parent">
<type name="GLDisplay" c:type="GstGLDisplay"/>
</field>
<field name="name" readable="0" private="1">
<type name="utf8" c:type="gchar*"/>
</field>
<field name="display" introspectable="0" readable="0" private="1">
<type c:type="gpointer" name="gpointer"/>
</field>
<field name="xcb_connection" introspectable="0" readable="0" private="1">
<type c:type="gpointer" name="gpointer"/>
</field>
<field name="foreign_display" readable="0" private="1">
<type name="gboolean" c:type="gboolean"/>
</field>
<field name="_padding" readable="0" private="1">
<array zero-terminated="0" c:type="gpointer" fixed-size="4">
<type name="gpointer" c:type="gpointer"/>
</array>
</field>
</class>
<record name="GLDisplayX11Class" c:type="GstGLDisplayX11Class" glib:is-gtype-struct-for="GLDisplayX11">
<field name="object_class">
<type name="GLDisplayClass" c:type="GstGLDisplayClass"/>
</field>
<field name="_padding">
<array zero-terminated="0" c:type="gpointer" fixed-size="4">
<type name="gpointer" c:type="gpointer"/>
</array>
</field>
</record>
<class name="GLFilter" c:symbol-prefix="gl_filter" c:type="GstGLFilter" parent="GLBaseFilter" glib:type-name="GstGLFilter" glib:get-type="gst_gl_filter_get_type" glib:type-struct="GLFilterClass">
<doc xml:space="preserve">#GstGLFilter helps to implement simple OpenGL filter elements taking a
single input and producing a single output with a #GstGLFramebuffer</doc>

View file

@ -33,11 +33,17 @@ xmlstarlet ed --pf --inplace \
--delete '//_:record[@name="GLDisplayWaylandClass"]' \
GstGL-1.0.gir
# Remove GstDisplayX11
# Change X11's Display* and xcb_connection_t* pointers to gpointer
xmlstarlet ed --pf --inplace \
--delete '//_:class[@name="GLDisplayX11"]' \
--delete '//_:record[@name="GLDisplayX11Class"]' \
GstGL-1.0.gir
--insert '//_:type[@c:type="Display*"]' \
--type attr --name 'name' --value 'gpointer' \
--insert '//_:type[@c:type="xcb_connection_t*"]' \
--type attr --name 'name' --value 'gpointer' \
--update '//*[@c:type="Display*"]/@c:type' \
--value gpointer \
--update '//*[@c:type="xcb_connection_t*"]/@c:type' \
--value gpointer \
GstGL-1.0.gir
# Remove GstMemoryEGL
xmlstarlet ed --pf --inplace \

View file

@ -26,6 +26,7 @@ tempdir = "0.3"
[features]
dox = []
egl = []
x11 = []
[lib]
name = "gstreamer_gl_sys"

View file

@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 1ae7210)
// This file was generated by gir (https://github.com/gtk-rs/gir @ 16d8c2d)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT

View file

@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 1ae7210)
// This file was generated by gir (https://github.com/gtk-rs/gir @ 16d8c2d)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT
@ -549,6 +549,24 @@ impl ::std::fmt::Debug for GstGLDisplayPrivate {
}
}
#[cfg(any(feature = "x11", feature = "dox"))]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GstGLDisplayX11Class {
pub object_class: GstGLDisplayClass,
pub _padding: [gpointer; 4],
}
#[cfg(any(feature = "x11", feature = "dox"))]
impl ::std::fmt::Debug for GstGLDisplayX11Class {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
f.debug_struct(&format!("GstGLDisplayX11Class @ {:?}", self as *const _))
.field("object_class", &self.object_class)
.field("_padding", &self._padding)
.finish()
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GstGLFilterClass {
@ -1154,6 +1172,27 @@ impl ::std::fmt::Debug for GstGLDisplayEGL {
}
}
#[cfg(any(feature = "x11", feature = "dox"))]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GstGLDisplayX11 {
pub parent: GstGLDisplay,
pub name: *mut c_char,
pub display: gpointer,
pub xcb_connection: gpointer,
pub foreign_display: gboolean,
pub _padding: [gpointer; 4],
}
#[cfg(any(feature = "x11", feature = "dox"))]
impl ::std::fmt::Debug for GstGLDisplayX11 {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
f.debug_struct(&format!("GstGLDisplayX11 @ {:?}", self as *const _))
.field("parent", &self.parent)
.finish()
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GstGLFilter {
@ -1628,6 +1667,16 @@ extern "C" {
#[cfg(any(feature = "egl", feature = "dox"))]
pub fn gst_gl_display_egl_get_from_native(type_: GstGLDisplayType, display: uintptr_t) -> gpointer;
//=========================================================================
// GstGLDisplayX11
//=========================================================================
#[cfg(any(feature = "x11", feature = "dox"))]
pub fn gst_gl_display_x11_get_type() -> GType;
#[cfg(any(feature = "x11", feature = "dox"))]
pub fn gst_gl_display_x11_new(name: *const c_char) -> *mut GstGLDisplayX11;
#[cfg(any(feature = "x11", feature = "dox"))]
pub fn gst_gl_display_x11_new_with_display(display: gpointer) -> *mut GstGLDisplayX11;
//=========================================================================
// GstGLFilter
//=========================================================================

View file

@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 1ae7210)
// This file was generated by gir (https://github.com/gtk-rs/gir @ 16d8c2d)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT
@ -266,6 +266,10 @@ const RUST_LAYOUTS: &[(&str, Layout)] = &[
#[cfg(any(feature = "egl", feature = "dox"))]
("GstGLDisplayEGLClass", Layout {size: size_of::<GstGLDisplayEGLClass>(), alignment: align_of::<GstGLDisplayEGLClass>()}),
("GstGLDisplayType", Layout {size: size_of::<GstGLDisplayType>(), alignment: align_of::<GstGLDisplayType>()}),
#[cfg(any(feature = "x11", feature = "dox"))]
("GstGLDisplayX11", Layout {size: size_of::<GstGLDisplayX11>(), alignment: align_of::<GstGLDisplayX11>()}),
#[cfg(any(feature = "x11", feature = "dox"))]
("GstGLDisplayX11Class", Layout {size: size_of::<GstGLDisplayX11Class>(), alignment: align_of::<GstGLDisplayX11Class>()}),
("GstGLFilter", Layout {size: size_of::<GstGLFilter>(), alignment: align_of::<GstGLFilter>()}),
("GstGLFilterClass", Layout {size: size_of::<GstGLFilterClass>(), alignment: align_of::<GstGLFilterClass>()}),
("GstGLFormat", Layout {size: size_of::<GstGLFormat>(), alignment: align_of::<GstGLFormat>()}),

View file

@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 1ae7210)
// This file was generated by gir (https://github.com/gtk-rs/gir @ 16d8c2d)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT

View file

@ -1,4 +1,4 @@
// This file was generated by gir (https://github.com/gtk-rs/gir @ 1ae7210)
// This file was generated by gir (https://github.com/gtk-rs/gir @ 16d8c2d)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// DO NOT EDIT