Thursday 16 February 2012

Linux / Ubuntu - Steps to Compile QTMultimediaKit inside QT Mobility 1.2



Steps to Compile QTMultimediaKit inside QT Mobility 1.2

QT ships its valuable Multimedia Kit inside QT Mobility. Now this kit is shipped only in the QT Mobility package which is available for Mobile platforms, for QT Mobility package which are meant for the Desktop OS such as Linux, Windows or Mac, this multimedia kit is unavailable. i.e. If u want to use the valuable elements of this Multimedia Kit in your QT Desktop application then you are out of luck. However, by following the below steps we can compile the unavailable QT Multimedia Kit for Linux / Ubuntu and then make its elements available for our QT application.

  • First we need to place the “qmake” of Desktop framework in our path. for this we will make its symbolic in /usr/bin, Moreover if u have any already present "qmake" item present inside this directory then make sure to remove it before applying the following commands :
    • cd /usr/bin
    • sudo ln -s /home/junaid/QtSDK/Desktop/Qt/4.8.0/gcc/bin/qmake qmake
(In this case I have my QTSDK placed in the /home/junaid. This has to be changed according to ur own arrangements )
  • Get the source code for QT Mobility 1.2 from http://get.qt.nokia.com/qt/add-ons/qt-mobility-opensource-src-1.2.0.zip
  • extract in the desired folder. NOTE: All the libraries and required files will be created in the extracted folder. So place this extracted folder at a place where u can easily locate your libraries.
  • Before going Forward to Compiling the Multimedia kit inside this Mobility framework, We will first install the (known) dependencies. execute following commands in the terminal to make sure that you fulfill the dependencies:

    • sudo apt-get install gstreamer0.10-x
    • sudo apt-get install gstreamer0.10-plugins-base
    • sudo apt-get install gstreamer0.10-plugins-good
    • sudo apt-get install gstreamer0.10-plugins-bad
    • sudo apt-get install gstreamer0.10-plugins-bad-multiverse
    • sudo apt-get install gstreamer0.10-plugins-ugly
    • sudo apt-get install gstreamer0.10-ffmpeg
    • sudo apt-get install libgstreamer0.10-dev
    • sudo apt-get install libgstreamer-plugins-base0.10-dev
    • sudo apt-get install libgst-dev
    • sudo apt-get install gstreamer0.10-alsa
    • sudo apt-get install gstreamer0.10-pulseaudio
    • sudo apt-get install libglui-dev
    • sudo apt-get install libasound2-dev
    • sudo apt-get install libxv-dev
    • sudo apt-get install libxv1
    • sudo apt-get install libxvmc-dev
    • sudo apt-get install libxvmc1
    • sudo apt-get install libxvidcore4

  • Now That our dependencies seems fulfilled, we can move forward to compile our QT MultimediaKit. (Please Note that in my case the downloaded source is present in /home/junaid/Downloads/qt-mobility-opensource-src-1.2.0 )
    • cd /home/junaid/Downloads/qt-mobility-opensource-src-1.2.0
    • ./configure -modules multimedia
    • make
    • sudo make install
  • In the above commands we have explicitly mentioned that we want to compile only the “multimedia” Module of the QT mobility framework, hence the “make” and ‘make install” commands only compile the code that completely builds the multimedia kit inside mobility.
  • Now once we have our libraries and other required files compiled and installed, we need to do one Last and very important step without which all our efforts will be useless i.e. we have to export the Library Path in which the compiled libraries are placed.
  • Above steps will place the libraries at “/home/junaid//Downloads/qt-mobility-opensource-src-1.2.0/lib” so we will export this path using following command
    • export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/junaid/Downloads/qt-mobility-opensource-src-1.2.0/lib/

Now you are all set to utilize the multimedia components of QT mobility inside your QT or QML application for Linux/Ubuntu. Enjoy :)

2 comments: