Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: could not determine kind of name for C.GST_MESSAGE_DEVICE_CHANGED #17

Open
andpp opened this issue Jun 28, 2021 · 11 comments
Open
Labels
documentation Improvements or additions to documentation

Comments

@andpp
Copy link

andpp commented Jun 28, 2021

Keep getting error:

~/work/go-gst/examples$ go run playbin/main.go 
# github.com/tinyzimmer/go-gst/gst
../gst/constants.go:335:40: could not determine kind of name for C.GST_MESSAGE_DEVICE_CHANGED
../gst/constants.go:832:30: could not determine kind of name for C.GST_QUERY_BITRATE

libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev are installed. What else do I miss?

@brucekim
Copy link
Collaborator

I found that GST_MESSAGE_DEVICE_CHANGED is defined in gstmessage.h that is one of headers inclusion in gst.h.
Since gst/gst.go.h includes gst.h, it seems that your environment has not been correctly path setting for gstreamer.

In my environment, pkg-config found followings

) ✗ pkg-config --list-all | grep gst
gstreamer-player-1.0                GStreamer Player - GStreamer Player convenience library
gstreamer-video-1.0                 GStreamer Video Library - Video base classes and helper functions
gstreamer-riff-1.0                  GStreamer RIFF Library - RIFF helper functions
gstreamer-1.0                       GStreamer - Streaming media framework
gstreamer-net-1.0                   GStreamer networking library - Network-enabled GStreamer plug-ins and clocking
gstreamer-pbutils-1.0               GStreamer Base Utils Library - General utility functions
gstreamer-codecparsers-1.0          GStreamer codec parsers - Bitstream parsers for GStreamer elements
gstreamer-app-1.0                   GStreamer Application Library - Helper functions and base classes for application integration
gstreamer-photography-1.0           GStreamer Photography - GStreamer Photography digital image capture library
gstreamer-audio-1.0                 GStreamer Audio library - Audio helper functions and base classes
gstreamer-transcoder-1.0            GStreamer Transcoder - GStreamer Transcoder library
gstreamer-mpegts-1.0                GStreamer MPEG-TS - GStreamer MPEG-TS support
gstreamer-tag-1.0                   GStreamer Tag Library - Tag base classes and helper functions
gstreamer-webrtc-1.0                GStreamer WebRTC - GStreamer WebRTC support
gstreamer-gl-prototypes-1.0         GStreamer OpenGL Plugins Libraries (OpenGL Prototypes) - Streaming media framework, OpenGL plugins libraries (OpenGL Prototypes)
gstreamer-plugins-base-1.0          GStreamer Base Plugins Libraries - Streaming media framework, base plugins libraries
gstreamer-sctp-1.0                  GStreamer SCTP Library - SCTP helper functions
gstreamer-allocators-1.0            GStreamer Allocators Library - Allocators implementation
gstreamer-rtsp-1.0                  GStreamer RTSP Library - RTSP base classes and helper functions
gstreamer-check-1.0                 GStreamer check unit testing - Unit testing helper library for GStreamer modules
gstreamer-base-1.0                  GStreamer base classes - Base classes for GStreamer elements
gstreamer-fft-1.0                   GStreamer FFT Library - FFT implementation
gstreamer-plugins-bad-1.0           GStreamer Bad Plugin libraries - Streaming media framework, bad plugins libraries
gstreamer-insertbin-1.0             GStreamer Insert Bin - Bin to automatically and insertally link elements
gstreamer-sdp-1.0                   GStreamer SDP Library - SDP helper functions
gstreamer-rtp-1.0                   GStreamer RTP Library - RTP base classes and helper functions
gstreamer-bad-audio-1.0             GStreamer bad audio library, uninstalled - Bad audio library for GStreamer elements, Not Installed
gstreamer-gl-1.0                    GStreamer OpenGL Plugins Libraries - Streaming media framework, OpenGL plugins libraries
gstreamer-controller-1.0            GStreamer controller - Dynamic parameter control for GStreamer elements

@andpp
Copy link
Author

andpp commented Jun 29, 2021

Interesting. There is no GST_MESSAGE_DEVICE_CHANGED defined in my gstmessage.h
What is your version of gstreamer? Mine is default for Ubuntu 18.04

~$ gst-launch-1.0 --gst-version
GStreamer Core Library version 1.14.5

@brucekim
Copy link
Collaborator

I found a comment of the macro as follow (required >= 1.16)

@GST_MESSAGE_DEVICE_CHANGED: Message indicating a #GstDevice was changed
125  *     a #GstDeviceProvider (Since: 1.16)

I installed gstreamer through gst-build

$ gst-inspect-1.0 --version
gst-inspect-1.0 version 1.18.4
GStreamer 1.18.4

@tinyzimmer
Copy link
Owner

Mine is default for Ubuntu 18.04

The ubuntu repos have really old versions of GStreamer. These bindings assume at least 1.16 (maybe 1.18 recently I don't remember). As a separate topic, need to find a better way to handle gstreamer versioning.

@andpp
Copy link
Author

andpp commented Jun 29, 2021

Thank you, all!
I'll try to upgrade to newer version. Maybe it would be good to add to the README minimal supported version of gstreamer?

@tinyzimmer
Copy link
Owner

tinyzimmer commented Jun 29, 2021

It's there, albeit it in an obscure place. At the bottom under "Contributing" with other things I'm looking for more help on:

The bindings are not structured in a way to make version matching with GStreamer easy. Basically, you need a version compatible with what the bindings were written with (>=1.16).

Should probably make that pop out more

@andpp
Copy link
Author

andpp commented Jun 29, 2021

Yes, unfortunately I skipped section "Contributing" because I have none to contribute yet. It is my first experience with golang :)

@tinyzimmer
Copy link
Owner

Probably will leave this open as a reminder to myself that the README needs some serious love

@andpp
Copy link
Author

andpp commented Jun 29, 2021

I updated to newer version and it looks like gstreamer 1.16 is not enough. I guess it requiers 1.18

~/work/go-gst/examples$ go run playbin/main.go 
# github.com/tinyzimmer/go-gst/gst
../gst/gst_values.go:575:2: could not determine kind of name for C.gst_value_array_init
../gst/gst_values.go:633:2: could not determine kind of name for C.gst_value_list_init
~/work/go-gst/examples$ gst-launch-1.0 --version
gst-launch-1.0 version 1.16.2
GStreamer 1.16.2

Does golang support someting similar to #ifdef - #endif of C?

@tinyzimmer
Copy link
Owner

The go compiler doesn't have a preprocessor, so no, unfortunately.

The closest thing I could think of for accomplishing it would be build tags.

@tinyzimmer tinyzimmer added the documentation Improvements or additions to documentation label Jun 30, 2021
@RSWilli
Copy link

RSWilli commented Aug 24, 2023

please continue a discussion at https://github.com/go-gst/go-gst (where future development of the bindings will take place), although this issue concerns very outdated versions of gstreamer, so it might not be necessary by now.

biglittlebigben pushed a commit to livekit/go-gst that referenced this issue Aug 28, 2023
change more time.Durations to gst.ClockTime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants