Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: GstIterator #157

Closed
wants to merge 36 commits into from
Closed

WIP: GstIterator #157

wants to merge 36 commits into from

Conversation

mjakeman
Copy link
Member

A tentative design for GstIterator, implementing IEnumerable and IEnumerator. Work in progress as it doesn't support Resync/Reset yet. Split off from #127.

firox263 and others added 30 commits November 1, 2020 17:32
Adds a small subset of functionality for the
aforementioned classes/structs. This includes a
naive implementation of GSourceFunc for Timeout.
Most of the changes here will be properly
implemented by #102. This commit ensures the
forthcoming GStreamer additions are designed
with .NET 5 in mind.
Patch to register aliases recursively. We
will get this for free with the new generator
architecture, so this is more of a temporary
workaround.
 * Handle in/out/ref conditions (naive attempt,
   needs work). Related fixes.
 * Start generating field structs and provide a
   mechanism for access.
 * Fix loop iteration limit for Constants
 * Groundwork for GStreamer
This commit adds more classes to GStreamer, as well
as starts generating the following plugins:
 * Gst.Audio
 * Gst.Base
 * Gst.Pbutils
 * Gst.Video

There is a lot of temporary glue present in GObject
to facilitate this. Before merging, we will need to
decide on a more permanent API for both GObject and
GStreamer.

Additionally, due to issues with the generator,
there is a lot of boilerplate here that should either
be auto generated, or avoided entirely (e.g. using
ref structs).
This causes memory corruption errors. We will need
to rethink marshalling altogether with the new
generator.
This fixes some longstanding issues with the
generator and cleans up some recent additions
from previous commits. It also includes several
marshalling related fixes.

 * It particularly focuses on making the type
   resolution code more organised after some
   GStreamer-related additions.

 * It has several changes with regards to
   in/out/inout gir annotations and the
   corresponding use of C# in/out/ref in
   generated code.

 * It fixes several issues with memory (e.g.
   AccessViolation exceptions), where
   marshalling wasn't being done correctly
   (or in the wrong way, hence the generator
   changes).

With this commit, GStreamer coverage is
sufficient for writing basic to moderate
complexity media playback code.
Some gir files appear to use any/none/utf8 as
types as opposed to the C Type directly. This commit
adds them to the generator purely for corner cases.
Maybe we can remove this at a later date?
Comments are licensed under LGPL, but gir.core is
MIT. We must distribute documentation separately.

See: https://gtk-rs.org/docs-src/faq (at bottom)
If something goes wrong during marshalling, we can end up with
a value array (for populating TSignalArgs) with less values than
expected. This blows up as soon as we try to use it, so it's better
to fail visibly if this happens then let it cause further issues.
During the change from IsRef -> Direction, attribute output got
lost at some point. This adds it back in, which fixes issues
with marshalling arrays (and thereby fixing use of TSignalArgs).
Fixes generating GstVideo. It may be a good idea to try and
fix the Gir files upstream rather than keeping this in the
generator.
Remove the Duplicate Enum workaround, which is no longer
needed using gtk-rs's gstreamer gir files. Keeps the change
which renames GEnumaration->GEnumeration.
Proof of concept to see if we can integrate
GstIterator with System.Collections. Needs
further testing and support for Resync/Reset.
@mjakeman mjakeman mentioned this pull request Dec 27, 2020
8 tasks
@mjakeman mjakeman mentioned this pull request Mar 18, 2022
6 tasks
@badcel badcel deleted the branch gircore:develop September 12, 2022 12:48
@badcel badcel closed this Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants