change github action to build all packages

* fix issues
* add build script to build all packages locally
This commit is contained in:
RSWilli
2023-09-01 13:07:37 +02:00
parent e87a6725b3
commit d5862de22e
7 changed files with 22 additions and 14 deletions

View File

@@ -9,7 +9,7 @@ jobs:
matrix: matrix:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, windows-latest, 'macos-latest'] os: [ubuntu-latest, windows-latest, "macos-latest"]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Setup GStreamer - name: Setup GStreamer
@@ -19,10 +19,13 @@ jobs:
version: 1.22.0 version: 1.22.0
- uses: actions/setup-go@v4 - uses: actions/setup-go@v4
with: with:
go-version: '^1.21.0' go-version: "^1.21.0"
- name: checkout - name: checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: build the appsink - name: build
run: cd examples/appsink && go build -x . shell: bash
run: |
packages=$(go list ./...)
for package in $packages; do
go build $package || exit 1
done

8
buildAll.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
# this script builds all go packages in the current directory
packages=$(go list ./...)
for package in $packages; do
go build -o /dev/null "$package" || exit 1
done

View File

@@ -30,7 +30,7 @@ func main() {
uri := os.Args[1] uri := os.Args[1]
discoverer, err := pbutils.NewDiscoverer(time.Second * 15) discoverer, err := pbutils.NewDiscoverer(gst.ClockTime(time.Second * 15))
if err != nil { if err != nil {
fmt.Println("ERROR:", err) fmt.Println("ERROR:", err)
os.Exit(2) os.Exit(2)

View File

@@ -13,11 +13,11 @@ import (
) )
// AudioMeta is a Go representation of a GstAudioMeta. // AudioMeta is a Go representation of a GstAudioMeta.
type AudioMeta struct{ *Object } type AudioMeta struct{ *glib.Object }
// FromGstAudioMetaUnsafeNone wraps the given audioMeta with a ref and finalizer. // FromGstAudioMetaUnsafeNone wraps the given audioMeta with a ref and finalizer.
func FromGstAudioMetaUnsafeNone(audioMeta unsafe.Pointer) *AudioMeta { func FromGstAudioMetaUnsafeNone(audioMeta unsafe.Pointer) *AudioMeta {
return &AudioMeta{wrapObject(glib.TransferNone(audioMeta))} return &AudioMeta{glib.TransferNone(audioMeta)}
} }
func BufferAddAudioMeta(buffer *gst.Buffer, info *Info, samples int, offsets []int) *AudioMeta { func BufferAddAudioMeta(buffer *gst.Buffer, info *Info, samples int, offsets []int) *AudioMeta {
@@ -34,6 +34,6 @@ func BufferAddAudioMeta(buffer *gst.Buffer, info *Info, samples int, offsets []i
(*C.GstBuffer)(unsafe.Pointer(buffer.Instance())), (*C.GstBuffer)(unsafe.Pointer(buffer.Instance())),
info.ptr, info.ptr,
C.gsize(samples), C.gsize(samples),
offsets, nil,
))) )))
} }

View File

@@ -6,7 +6,6 @@ package pbutils
import "C" import "C"
import ( import (
"time"
"unsafe" "unsafe"
"github.com/go-gst/go-glib/glib" "github.com/go-gst/go-glib/glib"

View File

@@ -9,7 +9,6 @@ import "C"
import ( import (
"errors" "errors"
"time"
"unsafe" "unsafe"
"github.com/go-gst/go-gst/gst" "github.com/go-gst/go-gst/gst"

View File

@@ -19,7 +19,6 @@ void cgoVideoConvertSampleCb (GstSample * sample, GError * gerr, gpointer user_d
import "C" import "C"
import ( import (
"time"
"unsafe" "unsafe"
"github.com/go-gst/go-gst/gst" "github.com/go-gst/go-gst/gst"