Ubuntu12.04 gstreamer的安装
准备工作:
工具:下载地址:http://download.csdn.net/detail/icegoly/6528717
glib-2.24.1.tar.gz
libxml2-2.7.8.tar.gz
gstreamer-0.10.36.tar.bz2
第一:复制这些工具到/root/gstream_x86/root/gstream_arm
用于X86平台安装
cplibxml2-2.7.8.tar.gz /root/gstreamer_x86/ cpglib-2.24.1.tar.gz /root/gstreamer_x86/ cpgstreamer-0.10.36.tar.bz2 /root/gstreamer_x86/ |
用于ARM平台安装
cplibxml2-2.7.8.tar.gz /root/gstreamer_arm/ cpglib-2.24.1.tar.gz /root/gstreamer_ arm / cpgstreamer-0.10.36.tar.bz2 /root/gstreamer_ arm / |
第二:安装libxml2-2.7.8.tar.gz
sudotar –xzf libxml2-2.7.8.tar.gz cdlibxml2-2.7.8/ sudo./configure sudomake sudomake install |
第三:安装glib-2.24.1.tar.gz
X86平台
./configure --prefix=/usr/gstreamer_lib_for_x86 glib_cv_stack_grows=noglib_cv_uscore=no ac_cv_func_posix_getpwuid_r=yesac_cv_func_posix_getgrgid_r=yes ac_cv_lib_rt_clock_gettime=noglib_cv_monotonic_clock=yes sudomake sudomake install |
ARM平台
CC=arm-linux-gcc./configure --build=i686-linux --host=arm-linux--prefix=/root/gstreamer_lib_for_arm glib_cv_stack_grows=noglib_cv_uscore=no ac_cv_func_posix_getpwuid_r=yesac_cv_func_posix_getgrgid_r=yes ac_cv_lib_rt_clock_gettime=noglib_cv_monotonic_clock=yes
sudomake sudomake install |
第四:安装
X86平台
#PKG_CONFIG_PATH=/usr/gstreamer_lib_for_x86/lib/pkgconfig./configure --prefix=/usr/gstreamer_lib_for_x86CFLAGS=-I/usr/gstreamer_lib_for_x86/include --disable-registry--disable-loadsave --disable-gtk-docac_cv_func_register_printf_function=no --disable-tests--disable-valgrind --disable-debug --disable-gst-debug #make #makeinstall |
ARM平台
#CC=arm-linux-gcc PKG_CONFIG_PATH=/root/gstreamer_lib_for_arm/lib/pkgconfig./configure --build=i686-linux --host=arm-linux--prefix=/root/gstreamer_lib_for_armCFLAGS=-I/root/gstreamer_lib_for_arm/include --disable-registry--disable-loadsave --disable-gtk-docac_cv_func_register_printf_function=no --disable-tests--disable-valgrind --disable-debug --disable-gst-debug #make #makeinstall |
第五:测试
#include<gst/gst.h> intmain (int argc, char *argv[]) { constgchar *nano_str; guintmajor, minor, micro, nano;
gst_init(NULL, NULL); gst_version(&major, &minor, µ, &nano); if(nano == 1) nano_str = "(CVS)"; elseif (nano == 2) nano_str = "(Prerelease)"; else nano_str = ""; printf("This program is linked against GStreamer %d.%d.%d %s/n",major, minor, micro, nano_str);
return0; } |
编译:
X86平台
gcchelloworld.c -I /usr/gstreamer_lib_for_x86/include/glib-2.0 -I/usr/gstreamer_lib_for_x86/lib/glib-2.0/include -I /usr/gstreamer_lib_for_x86/include/gstreamer-0.10 -L/usr/gstreamer_lib_for_x86/lib -l gstreamer-0.10 -l glib-2.0 -lgmodule-2.0 -l gobject-2.0 -l gthread-2.0 root@icegoly:gstreams#./a.out Thisprogram is linked against GStreamer 0.10.36 |
ARM平台:
#arm-linux-gcchelloworld.c -I /root/gstreamer_lib_for_arm/include/glib-2.0 -I/root/gstreamer_lib_for_arm/lib/glib-2.0/include -I /root/gstreamer_lib_for_arm/include/gstreamer-0.10 -L/root/gstreamer_lib_for_arm/lib -l gstreamer-0.10 -l glib-2.0 -lgmodule-2.0 -l gobject-2.0 -l gthread-2.0 #cpa.out /opt/rootfs/work //nfs目录 然后在板子上运行a.out即可 |
同时可以测试一个mp3播放:程序如下(注意编译的时候,采用上述的方法编译)
http://www.cnblogs.com/phinecos/archive/2009/06/07/1498166.html
//问题1:***Working zlib library and headers not found ***用新里德
//问题2:error:Could not find bison
#sudoapt-get install bison
//问题3:error:Could not find flexs
#sudoapt-get install flex