- C# 100%
|
All checks were successful
Publish NuGet to nuget.org / publish-nuget-org (release) Successful in 1m9s
Reviewed-on: #12 Co-authored-by: Emmanuel Robles <emmanuelrobles94@gmail.com> Co-committed-by: Emmanuel Robles <emmanuelrobles94@gmail.com> |
||
|---|---|---|
| .forgejo/workflows | ||
| codecrush.gstreamer.net | ||
| codecrush.gstreamer.source-generator | ||
| codecrush.gstreamer.source-generator.tests | ||
| gstreamer@e23dbb6e0c | ||
| .gitignore | ||
| .gitmodules | ||
| codecrush.gstreamer.slnx | ||
| LICENSE.md | ||
| README.md | ||
CodeCrush.GStreamer
CodeCrush.GStreamer is a .NET package that builds on top of the gstreamer-sharp sources shipped inside the upstream GStreamer repository.
This repository packages those bindings for .NET, adds a Roslyn source generator that reads gstreamer-sharp.dll.config, and installs a runtime DLL import resolver so native GStreamer libraries can be loaded using the correct platform-specific names.
Repository Layout
codecrush.gstreamer.net/: the packablenet10.0library published asCodeCrush.gstreamercodecrush.gstreamer.source-generator/: incremental source generator that turnsdllmapentries into strongly typed lookup codecodecrush.gstreamer.source-generator.tests/: tests for the generator outputgstreamer/: upstream GStreamer repository checked out as a git submodule
How It Works
The package project includes generated and custom C# sources directly from gstreamer/subprojects/gstreamer-sharp/sources/.
At build time, the source generator:
- reads
gstreamer-sharp.dll.config - extracts each
<dllmap>entry - generates an
OsEnum - generates a
DllMaphelper used to map Windows-style library names to Linux and macOS targets
At runtime, Gst.Application installs a DllImportResolver that uses the generated map before calling NativeLibrary.Load(...).
Prerequisites
- .NET SDK 10.0 or newer
- Git submodules initialized
- GStreamer installed on the target machine
This repository does not bundle native GStreamer binaries. It provides the managed bindings plus the native-library mapping needed to load an existing GStreamer installation.
Getting The Source
Clone the repository and initialize the submodule:
git clone https://forgejo.codecrush.dev/CodeCrush/codecrush.gstreamer.net.git
cd codecrush.gstreamer
git submodule update --init --recursive
If the gstreamer/ submodule is missing, the main package project will not compile because it imports source files from that tree.
Build
dotnet build codecrush.gstreamer.slnx
Test
dotnet test codecrush.gstreamer.slnx
Packaging
The NuGet package metadata is defined in codecrush.gstreamer.net/codecrush.gstreamer.net.csproj.
To create a package locally:
dotnet pack codecrush.gstreamer.net/codecrush.gstreamer.net.csproj -c Release
Package Notes
- Package ID:
CodeCrush.gstreamer - Target framework:
net10.0 - The package includes a package-level README from
codecrush.gstreamer.net/README.md - The source generator is referenced as an analyzer by the main package project
License
This repository includes upstream GStreamer sources and gstreamer-sharp sources via the gstreamer submodule. Review LICENSE.md and the licenses inside the upstream submodule before redistributing derived packages.