Git Product home page Git Product logo

gstreamer-sys's Introduction

NOTE: The canonical repository for gstreamer-sys has moved to freedesktop.org GitLab!

gstreamer-sys crates.io pipeline status

GStreamer FFI bindings for Rust.

These bindings are providing unsafe FFI API that can be used to interface with GStreamer. Generally they are meant to be used as the building block for higher-level abstractions like:

The bindings are autogenerated with gir based on the GObject-Introspection API metadata provided by the GStreamer project.

LICENSE

gstreamer-sys and all crates contained here are licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT).

GStreamer itself is licensed under the Lesser General Public License version 2.1 or (at your option) any later version: https://www.gnu.org/licenses/lgpl-2.1.html

Contribution

Any kinds of contributions are welcome as a pull request.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in gstreamer-rs by you shall be licensed under the MIT license as above, without any additional terms or conditions.

gstreamer-sys's People

Contributors

agalakhov avatar alatiera avatar ceyusa avatar fengalin avatar guillaumegomez avatar mathieuduponchelle avatar rubenrua avatar russel avatar sdroege avatar thiblahute avatar vivia avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gstreamer-sys's Issues

generate gstreamer-gl-sys

This is a subtask for sdroege/gstreamer-rs#126

Some notes:

Regarding the question which gl bindings use, the answer is gl-rs, and more specifically, gl_generator, which creates customs GL bindings at build time. That's what gleam uses.

When I want to generated the sys from GstGL-1.0.gir, no matter what work-mode I choose in Gir_GstGL.toml, the gir tool will always throw an exception:

GirXml: gir-files/GstGL-1.0.gir:3201:13: Missing type name

There are a lot of parameters types without name: all the GL related and xlib Display and xcb_connection_t. The later I solved them with pointer as name (perhaps we should handle that in the GstGL annotations), but the ones related with GL types are the problem.

As far as I have tinkered with gir I haven't found a way to workaround this. I even added fake names, but it breaks (obviously) later with

thread 'main' panicked at 'Incomplete library, unresolved: ["GL.bitfield", "GL.boolean", "GL.char", "GL.clampf", "GL.eglImageOES", "GL.enum", "GL.float", "GL.int", "GL.int64", "GL.intptr", "GL.sizei", "GL.sizeiptr", "GL.sync", "GL.ubyte", "GL.uint", "GL.uint64"]', gir/src/library_postprocessing.rs:55:13

Those types should be resolved by gl_generater, but I haven't figured out how, and I'm suspecting that gir won't be usable and the bindings must be written by hand 😭

Tests are broken

Due to various reasons tests are failing. Some of them are bugs on gir some have to do with gtk (I think?).

Sadly, haven't found an easy way to run tests of all modules, no matter if they fail or not. So here are two current error I could extract.

  1. This seems to be a bug in gir which adds an extra whitespace in the a string constant.
running 2 tests
test cross_validate_layout_with_c ... ok
test cross_validate_constants_with_c ... FAILED

failures:

---- cross_validate_constants_with_c stdout ----
constants ... 25 passed; 0 failed (compilation errors: 0)
constants ... 50 passed; 0 failed (compilation errors: 0)
constants ... 75 passed; 0 failed (compilation errors: 0)
Constant value mismatch for GST_AUDIO_FORMATS_ALL
Rust: " { S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }"
C:    "{ S8, U8, S16LE, S16BE, U16LE, U16BE, S24_32LE, S24_32BE, U24_32LE, U24_32BE, S32LE, S32BE, U32LE, U32BE, S24LE, S24BE, U24LE, U24BE, S20LE, S20BE, U20LE, U20BE, S18LE, S18BE, U18LE, U18BE, F32LE, F32BE, F64LE, F64BE }"
constants ... 99 passed; 1 failed (compilation errors: 0)
constants ... 124 passed; 1 failed (compilation errors: 0)
constants ... 149 passed; 1 failed (compilation errors: 0)
constants ... 174 passed; 1 failed (compilation errors: 0)
thread 'cross_validate_constants_with_c' panicked at 'FAILED: 192 passed; 1 failed (compilation errors: 0)', gstreamer-audio-sys/tests/abi.rs:126:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.


failures:
    cross_validate_constants_with_c

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '-p gstreamer-audio-sys --test abi'
  1. Not really sure what seems to be causing this one
running 2 tests
test cross_validate_layout_with_c ... ok
tests/constant.c: In function ‘main’:
<command-line>: error: ‘GST_GL_DISPLAY_EGL_NAME’ undeclared (first use in this function); did you mean ‘GST_GL_DISPLAY_TYPE_NONE’?
tests/constant.c:9:22: note: in expansion of macro ‘ABI_CONSTANT_NAME’
     printf(_Generic((ABI_CONSTANT_NAME),
                      ^~~~~~~~~~~~~~~~~
<command-line>: note: each undeclared identifier is reported only once for each function it appears in
tests/constant.c:9:22: note: in expansion of macro ‘ABI_CONSTANT_NAME’
     printf(_Generic((ABI_CONSTANT_NAME),
                      ^~~~~~~~~~~~~~~~~
test cross_validate_constants_with_c ... FAILED

failures:

---- cross_validate_constants_with_c stdout ----
constants ... 25 passed; 0 failed (compilation errors: 0)
constants ... 50 passed; 0 failed (compilation errors: 0)
Constant value mismatch for GST_GL_COLOR_CONVERT_VIDEO_CAPS
Rust: "video/x-raw("
C:    "video/x-raw(memory:GLMemory), format = (string) { RGBA, RGB, RGBx, BGR, BGRx, BGRA, xRGB, xBGR, ARGB, ABGR, Y444, I420, YV12, Y42B, Y41B, NV12, NV21, YUY2, UYVY, AYUV, GRAY8, GRAY16_LE, GRAY16_BE, RGB16, BGR16 }, width = (int) [ 1, max ], height = (int) [ 1, max ], framerate = (fraction) [ 0, max ], texture-target = (string) { 2D, rectangle, external-oes }  ; video/x-raw(memory:GLMemory,meta:GstVideoOverlayComposition), format = (string) { RGBA, RGB, RGBx, BGR, BGRx, BGRA, xRGB, xBGR, ARGB, ABGR, Y444, I420, YV12, Y42B, Y41B, NV12, NV21, YUY2, UYVY, AYUV, GRAY8, GRAY16_LE, GRAY16_BE, RGB16, BGR16 }, width = (int) [ 1, max ], height = (int) [ 1, max ], framerate = (fraction) [ 0, max ], texture-target = (string) { 2D, rectangle, external-oes }"
compilation command "cc" "-Wno-deprecated-declarations" "-D__USE_MINGW_ANSI_STDIO" "-I/usr/include/gstreamer-1.0" "-I/usr/lib64/gstreamer-1.0/include" "-I/usr/include/libdrm" "-I/usr/include/glib-2.0" "-I/usr/lib64/glib-2.0/include" "-I/usr/include/orc-0.4" "-pthread" "-DABI_CONSTANT_NAME=GST_GL_DISPLAY_EGL_NAME" "tests/constant.c" "-o" "/tmp/abi.PVz7tBNYjkSX/constant" failed, exit code: 1
constants ... 73 passed; 2 failed (compilation errors: 1)
constants ... 98 passed; 2 failed (compilation errors: 1)
constants ... 123 passed; 2 failed (compilation errors: 1)
thread 'cross_validate_constants_with_c' panicked at 'FAILED: 123 passed; 2 failed (compilation errors: 1)', gstreamer-gl-sys/tests/abi.rs:126:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.


failures:
    cross_validate_constants_with_c

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '-p gstreamer-gl-sys --test abi'

No way to call gst_base_parse_set_pts_interpolation on an Element?

I have an rtsp IP camera that h264parse doesn't grok completely and results in broken PTS on I-frames. This makes it so that mp4mux doesn't work at all and matroskamux just generates a broken file with no I-frames. It is probably this bug:

https://bugzilla.gnome.org/show_bug.cgi?id=788777

In this case it happens 100% of the time. I've found a workaround by using a feature of GstBaseParse:

https://gist.github.com/zougloub/0747f84d45bc35413c0c19584c398b3d/#file-dvr-py-L93-L94

But now I'm stuck on how to call gst_base_parse_set_pts_interpolation on the h264parse object. I don't see any path from the Element to a *mut GstBaseParse. Is this simply not packaged in any API?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.