How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf...
Transcript of How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf...
![Page 1: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/1.jpg)
HowIcross-compiledKurentoMediaServerforWindows
KyryloPolezhaiev
![Page 2: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/2.jpg)
Alotofmodulesanddependencies
• kms-core• kurento-media-server• kurento-filters• kurento-elements• kms-jsonrpc• jsoncpp
• gstreamer-1.5• gst-plugins-base-1.5• gst-plugins-good-1.5• gst-plugins-bad-1.5• gst-plugins-ugly-1.5• openwebrtc-gst-plugins-1.5
• libiconv• boost• libffi• Glib,Glibmm• gettext• gcc• Libxml2• usrsctp• libevent
• libnice• SQLite• libsigc++• libopus• OpenCV• libsoup• OpenSSL• winpthreads• libvpx
![Page 3: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/3.jpg)
Ideas
• Tocross-compileKMSfromFedorausingMinGWcompiler• BuildprototypeusinghandmadeMakefilesthenuseCMake
![Page 4: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/4.jpg)
Pros.ofcross-compilingusingFedora
• WehaveLinuxenvironmentandpackagemanager• Fedorahasalotofready-to-usepackagesprebuiltwithMinGW
sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2 mingw32-orc mingw32-libtheora mingw32-libvorbis mingw32-opus mingw32-libsigc++20 mingw32-glibmm24 yasm mingw32-openssl indent astyle
![Page 5: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/5.jpg)
Alotofmodulesanddependencies
• kms-core• kurento-media-server• kurento-filters• kurento-elements• kms-jsonrpc• jsoncpp
• gstreamer-1.5• gst-plugins-base-1.5• gst-plugins-good-1.5• gst-plugins-bad-1.5• gst-plugins-ugly-1.5• openwebrtc-gst-plugins-1.5
• libiconv• boost• libffi• Glib,Glibmm• gettext• gcc• Libxml2• usrsctp• libevent
• libnice• SQLite• libsigc++• libopus• OpenCV• libsoup• OpenSSL• winpthreads• libvpx
![Page 6: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/6.jpg)
Alotofmodulesanddependencies
• kms-core• kurento-media-server• kurento-filters• kurento-elements• kms-jsonrpc• jsoncpp
• gstreamer-1.5• gst-plugins-base-1.5• gst-plugins-good-1.5• gst-plugins-bad-1.5• gst-plugins-ugly-1.5• openwebrtc-gst-plugins-1.5
• libiconv• boost• libffi• Glib,Glibmm• gettext• gcc• Libxml2• usrsctp• libevent
• libnice• SQLite• libsigc++• libopus• OpenCV• libsoup• OpenSSL• winpthreads• libvpx
![Page 7: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/7.jpg)
BuildusinghandmadeMakefiles
• IwrotehugeMakefilesmanually• UsedvanillaGStreamer
![Page 8: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/8.jpg)
TweaksIhadtodo:
• libuuid (uuid_generate,uuid_unparse)→ rpcrt4(CoCreateGuid,UuidToStringA,RpcStringFree)• ushort,uint → unsignedshort,unsignedorguint etc.• <sys/socket.h>,<arpa/inet.h>→ <ws2tcpip.h>,<winsock2.h>• Linkagainst-lws2_32-liphlpapi• Use–no-undefinedflag,don’tuse–dland-fPIC• %ld,%zd,%hhx → G_GUINT64_FORMAT,G_GSIZE_FORMAT• Define-DWIN32_LEAN_AND_MEAN=1
![Page 9: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/9.jpg)
StandardCMake+Autotoolsway
• ForAutotool-basedcases,simpleautogen.sh +mingw32-configure+make+makeinstallscenarioworks• Forlibvpx thismagicworks:eval `rpm --eval %{mingw32_env}`export AS=yasm./configure \--target=x86-win32-gcc \--prefix=/usr/i686-w64-mingw32/sys-root/mingw/
![Page 10: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/10.jpg)
StandardCMake+Autotoolsway
• ForCMake-controlledKMSmodules:
mingw32-cmake -DCMAKE_BUILD_TYPE=Release \-DCMAKE_MODULE_PATH=\/usr/i686-w64-mingw32/sys-root/mingw/share/cmake-3.5/Modules/ \-DCMAKE_INSTALL_PREFIX=\/usr/i686-w64-mingw32/sys-root/mingw \-DKURENTO_MODULES_DIR=\/usr/i686-w64-mingw32/sys-root/mingw/share/kurento/modules/ \<path>
![Page 11: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/11.jpg)
TweakstoCMakeFiles
• ExplicitlydefinedsomelibrariesSTATIC• Explicitlylink*endpointswith-lkmssdpagent -lgstsdp-1.5.dll• Replacedlinkingorderforsomelibs
![Page 12: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/12.jpg)
PrepareDistro
• Aftereverythingisbuild,it’sinstalledin/usr/i686-w64-mingw32/sys-root/mingw/
• Takekurento-media-server.exe andsomeof.dlls tobin/• PutneededGStreamerpluginsintolib/gstreamer-1.5/• PutKurentomoduless intolib/kurento/modules/• Put configurationfilesintoetc/kurento/andetc/kurento/modules/kurento
![Page 13: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/13.jpg)
![Page 14: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/14.jpg)
DebugProblems
• CannottestWinsock2onWine• Difficulttouse&navigatesourcesonWindows
![Page 15: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/15.jpg)
Debug
• Takegdbserver.exe providedbyFedoraMinGWpackageandputintoWindowsmachinenearkurento-media-server.exe• MakesureWindowsfirewallallowsgdbserver andKMSlistenports.• Rungdbserver.exe likethat:gdbserver.exe :4444 kurento-media-server.exe
• Connecttoitviagdb,specifyingsomethinglike:set target-file-system-kind dos-based
target remote 172.16.211.244:4444
![Page 16: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/16.jpg)
Don’tselecttextinConsoleWindow!J
![Page 17: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/17.jpg)
![Page 18: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/18.jpg)
![Page 19: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/19.jpg)
Todo:
• MakeKMSworkasstandardWindowsService• Fixrandomsequencesgeneration• Fixpaths-relatedproblems
![Page 20: How I cross-compiled Kurento Media Server for Windows · sudo dnf install autoconf mingw32-filesystem cmake mingw32-gcc-c++ maven mingw32-boost gettext-devel bison flex mingw32-glib2](https://reader033.fdocuments.us/reader033/viewer/2022042003/5e6e724e73818c58903a637f/html5/thumbnails/20.jpg)
Thankyou!
Youcancomecloserandtakealookhowitworks