ubuntu下基于webrtc native的c++开发--库的使用
2017-12-26 16:32
1261 查看
简介
本文旨在掌握如何使用wenrtc库来编译我们编写的webrtc相关代码。文中提供一份简单的测试代码,末尾附上我用到的webrtc静态库。本文的开发环境为ubuntu14.04。由于webrtc源码编译太复杂,文中用到静态库是google上下载别人编译的,版本未知。代码
test1.cpp#include <iostream> #include <unistd.h> #include "webrtc/api/peerconnectioninterface.h" #include "webrtc/api/jsep.h" #include "webrtc/api/datachannelinterface.h" #include "webrtc/api/test/fakeconstraints.h" #include "webrtc/pc/test/mockpeerconnectionobservers.h" #include "webrtc/base/logging.h" #include "webrtc/base/ssladapter.h" #include "webrtc/base/sslstreamadapter.h" #include "webrtc/base/thread.h" #include "webrtc/p2p/base/common.h" #include "webrtc/base/basictypes.h" #include "webrtc/base/ssladapter.h" //using rtc::scoped_ptr; using rtc::scoped_refptr; using webrtc::MediaStreamInterface; using webrtc::CreatePeerConnectionFactory; using webrtc::DataChannelInterface; using webrtc::MockDataChannelObserver; using webrtc::PeerConnectionFactoryInterface; using webrtc::PeerConnectionInterface; using webrtc::PeerConnectionObserver; //using webrtc::PortAllocatorFactoryInterface; //using webrtc::VideoSourceInterface; using webrtc::VideoTrackInterface; int main() { fprintf(stderr,"Hello World\n"); fprintf(stderr,"Initializing SSL\n"); rtc::InitializeSSL(NULL); fprintf(stderr,"Initialized SSL\n"); fprintf(stderr,"Closing SSL\n"); rtc::CleanupSSL(); fprintf(stderr,"Closed SSL\n"); return 0; }
编译
g++ -DWEBRTC_POSIX -std=gnu++11 -o simpleTest test1.cpp -I/opt/webrtc/include /opt/webrtc/lib/x64/Debug/libwebrtc_full.a -lpthread -lX11 -ldl
webrtc库下载
http://download.csdn.net/download/yingyemin/10174267相关文章推荐
- ubuntu下使用eclipse搭建c/c++开发平台
- Ubuntu使用点滴(3)-C/C++开发环境配置
- 初次使用VS2010基于C++开发项目碰到的问题及解决方法
- Ubuntu下mysql安装与C++开发使用
- linux环境c++开发:ubuntu12.04使用llvm3.4.2
- 初次使用VS2010基于C++开发项目碰到的问题及解决方法
- Ubuntu使用点滴(3)-C/C++开发环境配置
- Ubuntu下使用Eclipse搭建C/C++开发环境
- 初次使用VS2010基于C++开发项目碰到的问题及解决方法
- Ubuntu下sqlite3的配置与使用(以后会说到Ubuntu下C++数据库应用开发程序(窗体程序))
- ubuntu下使用Eclipse搭建C++开发环境
- Linux下使用Eclipse开发基于nms板卡的c/c++程序
- 在Windows下使用Dev-C++开发基于pthread.h的多线程程序【转】
- ubuntu下搭建基于eclipse的c/c++开发环境
- ubuntu下使用eclipse c/c++开发arm linux程序
- Windows下使用Dev-C++开发基于pthread.h的多线程程序
- Ubuntu 安装mysql,以及使用C++开发简单示例
- 如何在Ubuntu中使用Eclipse + CDT开发C/C++程序
- 初次使用VS2010基于C++开发项目碰到的问题及解决方法
- 初次使用VS2010基于C++开发项目碰到的问题及解决方法