关于linux:GStreamer上的“黑名单”是什么意思?

What's the meaning of 'blacklisted' on GStreamer?

我正在尝试交叉编译GStreamer。 版本是1.2.3。 主机PC的操作系统是x86 linux,目标系统的操作系统是MIPSEL linux操作系统。

我成功地为目标设备编译了gstreamer和插件。 并且可以执行gst-launch-1.0。 因此,我尝试使用基本插件libgstvideotestsrc。 但这没有用。 所以我运行```gst-inspect-1.0'检查插件,然后发现如下结果。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# gst-inspect-1.0 -b
Blacklisted files:
  libgstinterlace.so
  libgstfbdevsink.so
  libgstgeometrictransform.so
  libgstmultifile.so
  libgstencodebin.so
  libgstfestival.so
  libgstlevel.so
  libgstdvdspu.so
  libgstauparse.so
  libgsty4menc.so
  libgstvideofilter.so
  libgstvideoscale.so
  libgstaccurip.so
  libgstvideoconvert.so
  libgstaudioparsers.so
  libgsttcp.so
  libgstvolume.so
  libgstcoreelements.so
  libgstmpegtsdemux.so
  libgstid3tag.so
  libgstadpcmdec.so
  libgstmfc.so
  libgstrtpmanager.so
  libgstaudiotestsrc.so
  libgstdeinterlace.so
  libgstdebug.so
  libgstplayback.so
  libgstspeed.so
  libgstasfmux.so
  libgsticydemux.so
  libgstmpegpsdemux.so
  libgstalaw.so
  libgstwavparse.so
  libgstpnm.so
  libgstnavigationtest.so
  libgstcamerabin2.so
  libgstsdpelem.so
  libgstisomp4.so
  libgstliveadder.so
  libgstmpegtsmux.so
  libgstautodetect.so
  libgstmultipart.so
  libgstvideofiltersbad.so
  libgstaudioresample.so
  libgstautoconvert.so
  libgstdvbsuboverlay.so
  libgstid3demux.so
  libgstvideobox.so
  libgstgio.so
  libgstdtmf.so
  libgstremovesilence.so
  libgstreplaygain.so
  libgstaudioconvert.so
  libgstcutter.so
  libgstgaudieffects.so
  libgstdvb.so
  libgstaudiovisualizers.so
  libgstudp.so
  libgstimagefreeze.so
  libgstadder.so
  libgstpcapparse.so
  libgstmxf.so
  libgstshapewipe.so
  libgstgdp.so
  libgstwavenc.so
  libgstshm.so
  libgstflv.so
  libgstfreeverb.so
  libgstoss4audio.so
  libgstsubenc.so
  libgstaudiorate.so
  libgstinter.so
  libgsttypefindfunctions.so
  libgstvideorate.so
  libgstrtp.so
  libgstcoloreffects.so
  libgstmpegpsmux.so
  libgstivtc.so
  libgstjpegformat.so
  libgstsmpte.so
  libgstalphacolor.so
  libgstsubparse.so
  libgstaudiofxbad.so
  libgstvideomixer.so
  libgstmulaw.so
  libgstdebugutilsbad.so
  libgsteffectv.so
  libgstfieldanalysis.so
  libgstadpcmenc.so
  libgstrawparse.so
  libgstavi.so
  libgstdataurisrc.so
  libgstapetag.so
  libgstinterleave.so
  libgstmidi.so
  libgstrtsp.so
  libgstapp.so
  libgstalpha.so
  libgstaudiofx.so
  libgstvideocrop.so
  libgstvideotestsrc.so
  libgstspectrum.so
  libgstbayer.so
  libgstaiff.so
  libgstsegmentclip.so
  libgstfrei0r.so

Total count: 106 blacklisted files

我想知道"列入黑名单"的含义以及我该如何解决这个问题。 如果您需要一些信息来解决此问题,请告诉我。

这是我的GStreamer构建配置。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#PACKAGES: Name + version
export GST_PLUGIN_BASE="gst-plugins-base-1.2.3"
export GST_PLUGIN_GOOD="gst-plugins-good-1.2.3"
export GST_PLUGIN_BAD="gst-plugins-bad-1.2.3"


#HOST & Build configuration.
export HOST="mips-linux-gnu"
export BUILD="i686-pc-linux-gnu"


#Set path for file system.
export BUILD_PATH="~~~~~"
export ROOTFS_PATH="${BUILD_PATH}/rootfs"
export MIPS_LIB="~~~"
export INSTALL_PATH="${ROOTFS_PATH}/usr"
export INSTALL_PATH_LIB="${ROOTFS_PATH}/usr/lib"

#Compiler options
export PATH="${PATH}:${INSTALL_PATH}/bin"
export CFLAGS="-I${ROOTFS_PATH}/usr/include  -I${ROOTFS_PATH}/usr/include/glib-2.0 -I${ROOTFS_PATH}/usr/lib/glib-2.0/include -I${ROOTFS_PATH}/usr/include/gstreamer-1.0 -I${ROOTFS_PATH}/usr/include/gio-unix-2.0 -mno-compact-eh -EL"  
export CPPFLAGS="-I${ROOTFS_PATH}/usr/include  -I${ROOTFS_PATH}/usr/include/glib-2.0 -I${ROOTFS_PATH}/usr/lib/glib-2.0/include -I${ROOTFS_PATH}/usr/include/gstreamer-1.0 -I${ROOTFS_PATH}/usr/include/gio-unix-2.0 -mno-compact-eh -EL"
export CXXFLAGS=$CPPFLAGS
export GST_CHECK_CFLAGS="-I${ROOTFS_PATH}/usr/include -I${ROOTFS_PATH}/usr/include/glib-2.0/include"
export PKG_CONFIG="/usr/bin/pkg-config"
export PKG_CONFIG_PATH="${PATH}:${ROOTFS_PATH}/lib/pkgconfig/:${ROOTFS_PATH}/usr/lib/pkgconfig/:${ROOTFS_PATH}/usr/local/lib/pkgconfig/:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/lib/pkgconfig"
export LD_LIBRARY_PATH="/lib:/usr/local/lib"
export CC="~~~mips-linux-gnu-gcc -EL"
export CXX="~~~mips-linux-gnu-g++ -EL"



cd ${BUILD_PATH}


#GStreamer 1.2.3
#http://greenday96.egloos.com/viewer/4627046
wget http://gstreamer.freedesktop.org/src/gstreamer/$GSTREAMER.tar.xz
tar xf $GSTREAMER.tar.xz
cd $GSTREAMER
./configure --prefix=$INSTALL_PATH --build=$BUILD  --host=$HOST  --disable-nls --disable-static
sudo make
sudo make install
cd ..

#gst-plugin-base 1.2.3
wget http://gstreamer.freedesktop.org/src/gst-plugins-base/$GST_PLUGIN_BASE.tar.xz
tar xf $GST_PLUGIN_BASE.tar.xz
cd $GST_PLUGIN_BASE
./configure --prefix=$INSTALL_PATH --build=$BUILD  --host=$HOST  --disable-nls --disable-static --disable-examples --disable-pango
sudo make
sudo make install
cd ..


# gst-plugin-good-1.2.3
# http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.2.3.tar.xz
wget http://gstreamer.freedesktop.org/src/gst-plugins-good/$GST_PLUGIN_GOOD.tar.xz
tar xf $GST_PLUGIN_GOOD.tar.xz
cd $GST_PLUGIN_GOOD
./configure --prefix=$INSTALL_PATH --build=$BUILD  --host=$HOST  --disable-nls --disable-static --disable-valgrind --disable-equalizer --disable-flx --disable-goom --disable-goom2k1 --disable-matroska --disable-monoscope  --disable-oss  --disable-cairo  --disable-gdk_pixbuf   --disable-soup  --disable-libpng --disable-gst_v4l2
sudo make
sudo make install
cd ..


# gst-plugin-bad-1.2.3
# http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-1.2.3.tar.xz
wget http://gstreamer.freedesktop.org/src/gst-plugins-bad/$GST_PLUGIN_BAD.tar.xz
tar xf $GST_PLUGIN_BAD.tar.xz
cd $GST_PLUGIN_BAD
./configure --prefix=$INSTALL_PATH --build=$BUILD  --host=$HOST  --disable-nls --disable-static   --disable-y4m --disable-siren --disable-librfb  --disable-yadif --disable-smooth --disable-videoparsers --disable-decklink --disable-valgrind --disable-directfb --disable-examples
sudo make
sudo make install
cd ..

如果您想确定为什么将这些插件列入黑名单,则可以删除" registry.dat"(运行定位以查找其位置),然后重新运行gst-inspect,将再次检查这些插件并将其列入黑名单的原因应该打印出来。

将它们列入黑名单的原因可能有多种,如果这样做,您应该将它们找出来。

或者,您也可以运行gst-inspect location_of_the_dynamic_library.so


对于gstreamer 1.8,需要使用其他GST_DEBUG = 4 env var释放gst-inspect-1.0,以查看详细原因(本例中的版本不兼容):

1
GST_DEBUG=4 gst-inspect-1.0  /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgst_some_plugin.so
1
2
3
4
...15-20 lines with non-interesting details...

0:00:00.035553207  4287     0x29f93c00 WARN      GST_PLUGIN_LOADING gstplugin.c:485:gst_plugin_register_func: plugin"/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgst_some_plugin.so" has incompatible version (plugin: 1.10, gst: 1,8), not loading
Could not load plugin file: File"/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgst_some_plugin.so" appears to be a GStreamer plugin, but it failed to initialize


在我的情况下,由于我构建了kvssink而依赖其他库,因此它被列入了黑名单。而且GStreamer找不到它们。

就像这样:

1
2
3
4
gst-inspect-1.0 kvssink

(gst-plugin-scanner:22): GStreamer-WARNING **: 13:07:28.097: Failed to load plugin '/root/bin/producer/libgstkvssink.so': libproducer.so: cannot open shared object file: No such file or directory
(gst-plugin-scanner:22): GStreamer-WARNING **: 13:07:28.204: Failed to load plugin '/root/bin/producer/libproducer.so': libcproducer.so: cannot open shared object file: No such file or directory

为了确认库问题,我使用了ldd

1
ldd libgstkvssink.so

它将列出所有可能在系统中找到的依赖项及其路径。
找不到我的库libcproducer.so和libcproducer.so。

基于为其他可见库指定的路径

1
2
    linux-vdso.so.1 (0x00007ffc3c1a6000)
libgstreamer-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 (0x00007f064d24d000)

我只是将缺少的库复制到/ usr / lib / x86_64-linux-gnu /
以我为例:

1
2
cp libcproducer.so  /usr/lib/x86_64-linux-gnu/
cp libproducer.so /usr/lib/x86_64-linux-gnu/

然后:

1
gst-inspect-1.0 kvssink

打印插件详细信息。

我已解决此问题,这要归功于该线程中的信息:
使用自动工具在gstreamer插件中链接到外部库


我找到了原因。它是GLIB,而不是GStreamer。

要为mipsel构建GLIB,我应该设置glib_cv_uscore=no。这取决于您的嵌入式设备。因此,请检查目标硬件的CPU规格。因此,如下所示,我为GLIB创建了构建脚本。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#Glib 2.42.1
wget ftp://ftp.gnome.org/pub/gnome/sources/glib/2.42/$GLIB.tar.xz
tar xf $GLIB.tar.xz
cd $GLIB

#Build for MIPS
echo"ac_cv_func_posix_getgrgid_r=yes">  mips.cache
echo"ac_cv_func_posix_getpwuid_r=yes">>  mips.cache
echo"glib_cv_stack_grows=no">> mips.cache
echo"glib_cv_uscore=no">>mips.cache
./configure --prefix=$INSTALL_PATH --host=$HOST  --cache-file=mips.cache --build=$BUILD
make
make install
cd ..

我从这里得到了线索。