<<<<<<< HEAD This documentation directs how to integrate k-push scheme into the libdash library
- Prerequisite
While the libdash library does not support the emerging http/2 protocol, which is necessary for k-push, we have to replace the underlayer http library with the latest version of libcurl and libnghttp2 that provides http/2 functionalities.
1.1 libnghttp2
To build the latest nghttp2 library, follow the steps
$ git clone https://github.com/nghttp2/nghttp2 $ autoreconf -i $ automake $ autoconf $ ./configure $ make $ sudo make install
1.2 libcurl
To build the latest libcurl library, follow the steps
$ git clone https://github.com/curl/curl $ ./buildconf $ ./configure $ make $ sudo make install
- Build HTTP/2-supported libdash
The libdash has two parts. One is the libdash library that support mpeg-dash standard, and the other one is a qt4player can retrieve the remote segments and play them.
2.1 libdash
We need to replace the current curl library in the source code with our newly built one.
$ git clone git@git.corp.adobe.com:menxiao/libdash.git
$ git checkout kpush
$ rm libdash/libdash/libcurl/lib/lib*
$ ln -s ${PATH_TO_LIBNGHTTP2} libdash/libdash/libcurl/lib/libnghttp2.so.14
$ ln -s ${PATH_TO_LIBCURL} libdash/libdash/libcurl/lib/libcurl.so.4.4.0
$ ln -s ${PATH_TO_LIBCURL} libdash/libdash/libcurl/lib/libcurl.so.4
$ ln -s ${PATH_TO_LIBCURL} libdash/libdash/libcurl/lib/libcurl.so
Then To build the http/2-supported libdash, follow the commands below:
$ cd ./libdash/libdash
$ rm -rf build
$ mkdir build
$ cd build
$ cmake ../
$ make
2.2 qt4player
There is also a qt4player in the libdash library, which can stream the mpeg-dash video data. To build this player, follow this step
$ cd ./libdash/libdash/qtsampleplayer
$ rm -rf build
$ mkdir build
$ export LIBAVROOT="${PATH_TO_LIBDASH_REPO}/libdash/libav"
$ cd build
$ cmake ../
$ make
use
$ ./qtsampleplayer
to launch the video player
- Design and implementation
To integrate k-push into the libdash, two main modules, which are http/2 manager module and k-push logic module, are designed and implemented.
3.1 HTTP/2 manager module
The http/2 manager module is implemented in 'libdash/libdash/source/network/CurlmManager.cpp'. While http/2 supports to multiplex more then one segment transmission in a transmission channel, we need to manage the states of the transmissions.
CurlmManager.cpp is designed as an http/2 manager where the http requests can be submitted. The requests can be submitted to this module in the thread safe manner. Also a cache accepting the pushed segments is implemented inside this module.
3.2 k-push logic module
The k-push logic is integrated in 'libdash/qtsampleplayer/libdashframework/DASHReceiver.cpp'. The logic is, when the a push cycle ends, it checks the current k (specified in the UI) and set the k+1 following segments as the same quality.
- Miscs
- The qtsampleplayer does not support some mpd format (generated by MP4Box). The initialization tag must be put under the segmentlist tag, otherwise the qtsampleplayer cannot figure out what the initialization segment is. =======
63dd94f8e56ebd99c58f75aeb5aaa42537db832f