fix gstreamer 1.20 build

This commit is contained in:
notedit
2022-09-17 23:14:47 +08:00
parent 3ca125d3f9
commit d9cbe75df7
2 changed files with 12 additions and 1 deletions

View File

@@ -21,6 +21,10 @@ brew install gst-plugins-base
brew install gst-plugins-good
brew install gst-plugins-bad
brew install gst-plugins-ugly
// set GST_PLUGIN_PATH
export GST_PLUGIN_PATH=/opt/homebrew/lib/gstreamer-1.0/
```
Then
@@ -31,6 +35,8 @@ go get github.com/notedit/gst
## Examples
https://github.com/notedit/gst-go-demo

View File

@@ -3,6 +3,11 @@ package gst
/*
#cgo pkg-config: gstreamer-1.0
#include "gst.h"
const char* ErrorMessage(GError *err) {
return err->message;
}
*/
import "C"
@@ -26,7 +31,7 @@ func ParseLaunch(pipelineStr string) (p *Pipeline, err error) {
gstElt := C.gst_parse_launch(pDesc, &gError)
if gError != nil {
err = errors.New("create pipeline error")
err = errors.New(C.GoString(C.ErrorMessage(gError)))
return
}