Monday, September 10, 2012

To Build the Live555 library with MinGW

The Live555 streaming media library is an open-source implementation of RTP/RTCP/RTSP/SIP multimedia streaming protocols. I mainly use it with MPlayer. To compile it with MinGW, download the source for live555 library and extract the tarball under /mingw/lib:



cd /mingw/lib
tar xzvf live555-latest.tar.gz
cd live


compile it like this:



./genMakefiles mingw
make


Live555 and MPlayer



Normally, mplayer will detect the live555 library automatically. If not, append --enable-live to the ./configure command.

After running ./configure, open config.mak in a text editor and make the following changes.




  • Append the following text to CXXFLAGS= line.
    -I/mingw/lib/live/liveMedia/include -I/mingw/lib/live/UsageEnvironment/include -I/mingw/lib/live/BasicUsageEnvironment/include -I/mingw/lib/live/groupsock/include

  • Append the following text to EXTRALIBS= line.
    /mingw/lib/live/liveMedia/libliveMedia.a /mingw/lib/live/UsageEnvironment/libUsageEnvironment.a /mingw/lib/live/BasicUsageEnvironment/libBasicUsageEnvironment.a /mingw/lib/live/groupsock/libgroupsock.a -lstdc++



Creating a Shared Library for live555


To create a shared library from the static live555 libraries, I ran the following command:


gcc -shared -o livemedia.dll -Wl,--out-implib,liblivemedia.dll.a -Wl,--whole-archive liveMedia/libliveMedia.a UsageEnvironment/libUsageEnvironment.a BasicUsageEnvironment/libBasicUsageEnvironment.a groupsock/libgroupsock.a -Wl,--no-whole-archive -lstdc++ -lws2_32

I got livemedia.dll and liblivemedia.dll.a. I copied these files under MinGW.


cp -iv livemedia.dll /mingw/bin
cp -iv liblivemedia.dll.a /mingw/lib

To use these files, I would define environment variables as follows:


CXXFLAGS='-I/mingw/lib/live/liveMedia/include -I/mingw/lib/live/UsageEnvironment/include -I/mingw/lib/live/BasicUsageEnvironment/include -I/mingw/lib/live/groupsock/include'



LIBS='-lstdc++ /mingw/lib/liblivemedia.dll.a'

No comments:

Post a Comment

About This Blog

KBlog logo This blog seeks to provide a collection of interesting pictures found on the Web. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

Powered By Blogger