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,20 +9,23 @@ jobs:
matrix:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, 'macos-latest']
os: [ubuntu-latest, windows-latest, "macos-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Setup GStreamer
id: setup_gstreamer
id: setup_gstreamer
uses: blinemedical/setup-gstreamer@45324555100927b587d390d8cf3940f91fd3bdc9
with:
version: 1.22.0
- uses: actions/setup-go@v4
with:
go-version: '^1.21.0'
go-version: "^1.21.0"
- name: checkout
uses: actions/checkout@v3
- name: build the appsink
run: cd examples/appsink && go build -x .
- name: build
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]
discoverer, err := pbutils.NewDiscoverer(time.Second * 15)
discoverer, err := pbutils.NewDiscoverer(gst.ClockTime(time.Second * 15))
if err != nil {
fmt.Println("ERROR:", err)
os.Exit(2)

View File

@@ -13,11 +13,11 @@ import (
)
// 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.
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 {
@@ -34,6 +34,6 @@ func BufferAddAudioMeta(buffer *gst.Buffer, info *Info, samples int, offsets []i
(*C.GstBuffer)(unsafe.Pointer(buffer.Instance())),
info.ptr,
C.gsize(samples),
offsets,
nil,
)))
}

View File

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

View File

@@ -9,7 +9,6 @@ import "C"
import (
"errors"
"time"
"unsafe"
"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 (
"time"
"unsafe"
"github.com/go-gst/go-gst/gst"