我正在尝试让GStreamer SDK的basic-tutorial-5在OSX上工作。
从http://gstreamer.freedesktop.org/data/pkg/osx/1.2.4.1/下载的SDK
http://cgit.freedesktop.org/~slomo/gst-sdk-tutorials/的教程(针对1.0)
我收到以下错误
basic-tutorial-5.c:5:10: fatal error: 'gst/video/videooverlay.h' file not found
当我运行时
gcc `pkg-config gstreamer-1.0 gtk+-3.0 --cflags --libs` basic-tutorial-5.c -o basic5
任何指针都将有所帮助!
谢谢。
编辑:
gst/video/videooverlay.h
中有一个/local/frameworks/Gstreamer.framework/Headers
。pkg-config gstreamer-1.0 gtk+-3.0 --cflags --libs
的输出不包括/Library/Frameworks/Gstreamer.framework/Versions/1.0/Headers
感谢@Biffen在使用时
gcc `pkg-config --cflags --libs gtk+-3.0` -o basic5 basic-tutorial-5.c -I/Library/Frameworks/Gstreamer.framework/Versions/1.0/Headers -framework GStreamer
还有更多 Action :
basic-tutorial-5.c:114:17: warning: 'gtk_button_new_from_stock' is deprecated
[-Wdeprecated-declarations]
play_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PLAY);
^
/usr/local/Cellar/gtk+3/3.12.2/include/gtk-3.0/gtk/gtkbutton.h:103:16: note:
'gtk_button_new_from_stock' declared here
GtkWidget* gtk_button_new_from_stock (const gchar *stock_id);
^
basic-tutorial-5.c:114:44: warning: 'GtkStock' is deprecated
[-Wdeprecated-declarations]
play_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PLAY);
^
/usr/local/Cellar/gtk+3/3.12.2/include/gtk-3.0/gtk/deprecated/gtkstock.h:747:38: note:
expanded from macro 'GTK_STOCK_MEDIA_PLAY'
#define GTK_STOCK_MEDIA_PLAY ((GtkStock)"gtk-media-play")
^
/usr/local/Cellar/gtk+3/3.12.2/include/gtk-3.0/gtk/deprecated/gtkstock.h:107:16: note:
'GtkStock' declared here
typedef char * GtkStock;
^
basic-tutorial-5.c:117:18: warning: 'gtk_button_new_from_stock' is deprecated
[-Wdeprecated-declarations]
pause_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PAUSE);
^
/usr/local/Cellar/gtk+3/3.12.2/include/gtk-3.0/gtk/gtkbutton.h:103:16: note:
'gtk_button_new_from_stock' declared here
GtkWidget* gtk_button_new_from_stock (const gchar *stock_id);
^
basic-tutorial-5.c:117:45: warning: 'GtkStock' is deprecated
[-Wdeprecated-declarations]
pause_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PAUSE);
^
/usr/local/Cellar/gtk+3/3.12.2/include/gtk-3.0/gtk/deprecated/gtkstock.h:733:38: note:
expanded from macro 'GTK_STOCK_MEDIA_PAUSE'
#define GTK_STOCK_MEDIA_PAUSE ((GtkStock)"gtk-media-pause")
^
/usr/local/Cellar/gtk+3/3.12.2/include/gtk-3.0/gtk/deprecated/gtkstock.h:107:16: note:
'GtkStock' declared here
typedef char * GtkStock;
^
basic-tutorial-5.c:120:17: warning: 'gtk_button_new_from_stock' is deprecated
[-Wdeprecated-declarations]
stop_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_STOP);
^
/usr/local/Cellar/gtk+3/3.12.2/include/gtk-3.0/gtk/gtkbutton.h:103:16: note:
'gtk_button_new_from_stock' declared here
GtkWidget* gtk_button_new_from_stock (const gchar *stock_id);
^
basic-tutorial-5.c:120:44: warning: 'GtkStock' is deprecated
[-Wdeprecated-declarations]
stop_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_STOP);
^
/usr/local/Cellar/gtk+3/3.12.2/include/gtk-3.0/gtk/deprecated/gtkstock.h:799:38: note:
expanded from macro 'GTK_STOCK_MEDIA_STOP'
#define GTK_STOCK_MEDIA_STOP ((GtkStock)"gtk-media-stop")
^
/usr/local/Cellar/gtk+3/3.12.2/include/gtk-3.0/gtk/deprecated/gtkstock.h:107:16: note:
'GtkStock' declared here
typedef char * GtkStock;
^
6 warnings generated.
所以它符合...这似乎是向前迈出的一大步,但仍然没有雪茄...
当我尝试运行basic5时,我得到:
(process:73178): GLib-GObject-WARNING **: cannot register existing type 'gchar'
**
GLib-GObject:ERROR:gvaluetypes.c:455:_g_value_types_init: assertion failed: (type == G_TYPE_CHAR)
Abort trap: 6
编辑v2:
多亏了nemequ我现在可以使用
gcc -o basic5 basic-tutorial-5.c
pkg-config --libs --cflags gstreamer-1.0 gstreamer-video-1.0 gtk + -3.0``编译并运行./basic5
来获取以下错误:Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
(basic5:77683): Gtk-WARNING **: cannot open display:
似乎
/Library/Frameworks/Gstreamer.framework/Versions/1.0/Headers
文件夹中缺少gtk文件夹(以及其他无疑的文件夹),因此使用pkg-config..
可能是一种解决方法。如果我在XQuartz终端中运行
./basic5
,则会出现以下错误:Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
(basic5:78227): GLib-GIO-ERROR **: No GSettings schemas are installed on the system
Trace/BPT trap: 5
其他人有什么想法吗?
最佳答案
对于最初的问题,解决方案取决于您的系统,因此很难给您一个好的答案,但是gst/video/videooverlay.h是gstreamer-video-1.0
软件包的一部分,而不是gstreamer-1.0
。
也就是说,如果您使用的是GStreamer SDK,则根据GStreamer SDK文档you should be using -framework GStreamer而不是pkg-config。
至于您看到的关于“无法注册现有类型”的错误,当您尝试链接同一库的两个不同版本时,往往会发生这种错误。 TBH我从未见过gchar会发生这种情况,但这可能意味着您正在尝试链接到glib或gobject的两个不同版本,这很有意义-gtk+-3.0
pkg-config文件将把glib-2.0
和gobject-2.0
作为依赖项,它们都已经包含在GStreamer SDK中。 GStreamer SDK中还包含AFAICT GTK +,因此请尝试摆脱pkg-config的内容:
gcc -o basic5 basic-tutorial-5.c -I/Library/Frameworks/Gstreamer.framework/Versions/1.0/Headers -framework GStreamer
关于c - Quartz的GTK窗口[从GStreamer的问题开始],我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23777031/