mirror of
https://github.com/go-gst/go-gst.git
synced 2025-10-01 22:32:12 +08:00
change github action to build all packages
* fix issues * add build script to build all packages locally
This commit is contained in:
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
@@ -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
8
buildAll.sh
Executable 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
|
@@ -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)
|
||||||
|
@@ -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,
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
|
@@ -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"
|
||||||
|
@@ -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"
|
||||||
|
@@ -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"
|
||||||
|
Reference in New Issue
Block a user