Gstreamer開發環境安裝與測試


Gstreamer開發環境安裝與測試

1)安裝:

sudo apt-get install libgstreamer0.10-dev gstreamer-tools gstreamer0.10-tools gstreamer0.10-doc

sudo apt-get install gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse

apt-get install libgstreamer* // 該命令的目的是安裝頭文件;注意’*’

2)測試gstreamer開發庫:

#include <gst/gst.h>

int main (int   argc,char *argv[])

{

    const gchar *nano_str;

    guint major, minor, micro, nano;

    gst_init (&argc, &argv);

    gst_version (&major, &minor, &micro, &nano);

    if (nano == 1)

        nano_str = "(CVS)";

    else if (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);

    return 0;

}

將上述代碼保存為hello.c

gcc -Wall hello.c -o hello $(pkg-config --cflags --libs gstreamer-0.10)  //編譯,生成hello的可執行文件

sudo ./hello //執行該文件

運行結果:This program is linked against GStreamer 0.10.22 //若運行出該結果,說明Gstreamer已成功安裝


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM