TAG:
最近有一个语言项目方面的调研,需要评估一下libjingle,所以研究了半个月的libjingle,现在把经验总结如下(如有不对,请不吝赐教): Add the following lines into the libjingle.scons file.
(FandyM)In the "talk.Library(env, name = "libjingle",..." section, you need to add: "HAVE_LINPHONE", "HAVE_SPEEX", "HAVE_ILBC", to the "cppdefines = [". add: "session/phone/linphonemediaengine.cc",
to the "srcs = [ ..."add: "third_party/mediastreamer/include", "third_party/ortp/include"
to the "includedirs = [ ..."In the "talk.App(env, name = "call",..." section, you need to add: "ortp" "mediastreamer", to the "libs = [". 然后, 访问http://download.savannah.gnu.org/releases-noredirect/linphone/ortp/sources/下载ortp代码, 访问http://download.savannah.gnu.org/releases-noredirect/linphone/mediastreamer/下载mediastreamer,
并复制到libjingle库的third_party中,文件夹名需与上一步添加的路径名一致。在windows下需要dll,所以还得编译两个库的dll,方法转自: http://www.rosoo.net/a/201302/16518.html Mingw&msys的手动安装;
http://www.rosoo.net/a/201302/16519.html Mingw&msys环境中编译mediastreamer2和ortp。
接着, copy .lib文件到talk\build\dbg\lib目录, copy .dll到talk\build\dbg\staging目录。 然后,修改libjingle库的socketaddress.cc里的一个bug,参考http://www.rosoo.net/a/201302/16517.html 增加红色,解决域名转IP的问题: bool SocketAddress::StringToIP(const std::string& hostname, uint32* ip) {
in_addr addr; struct hostent *host; if (isalpha(hostname.c_str()[0])) { host = gethostbyname(hostname.c_str()); if (host == NULL) { printf("gethostbyname error\n"); return false; } memcpy(&addr.s_addr, host->h_addr_list[0],host->h_length); } else if (inet_aton(hostname.c_str(), &addr) == 0) { return false; } *ip = NetworkToHost32(addr.s_addr); return true; } 按照README的方法,编译。 通过后运行call.exe,与Gtalk通话。 如果音质不好,断断续续,可以在mingw&msys下, 移除 winsnd2.c 添加winsnd3.c 重新编译ortp库。
这篇文章,也没有解决,不过不影响音质。还有就是关于receiving RTCP packet: Connection reset by peer. 参考:http://www.rosoo.net/a/201302/16515.html |