基于Webrtc和Janus的多人视频会议系统开发3 - Peerconnection从ninja工程改造成VS工程

之所以要专门写这一章,是因为这一步卡了不少时间,遇到不少问题,写出来给大家做参考。在做这一步之前您至少要已经完成webrtc在windows下的编译,这个编译的介绍文章比较多,这里就不说了。

在自己改造前,也是参考了这篇文章:

https://www.cnblogs.com/CoderTian/p/7828926.html

根据这个博主留下的下载地址下下来的工程确实能编译通过,可行博主只提供了x64的库,我用我自己编的32为库和博主的工程搭配,始终链接不过,另外该博主的工程里需求另外加入libYUV和json等源码到工程了,而实际上这些东西在webrtc工程里都已经有了。

试了很多方法不行后,最后想ninja工程都能链接生成成功,没理由缺库的,灵机一动,用文本编辑器打开

out\Debug\obj\examples\peerconnection_client.ninja 

看到里面一大堆link的.lib库,copy出来整理下就可以啦,花了不少功夫,方便大家,贴在这里:

#pragma comment(lib, "../../webrtc_src/out/Debug/obj/webrtc.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/libjingle_peerconnection_api.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/media/rtc_media_base.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/builtin_audio_decoder_factory.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/builtin_audio_encoder_factory.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/media/rtc_audio_video.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/video_capture/video_capture_module.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/rtc_base/rtc_base.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/webrtc_common.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/rtc_base/rtc_base_generic.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/boringssl/boringssl.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/boringssl/boringssl_asm.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/libyuv/libyuv_internal.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/libjpeg_turbo/libjpeg.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/libjpeg_turbo/simd.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/libjpeg_turbo/simd_asm.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/common_video/common_video.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/system_wrappers/system_wrappers.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/rtc_base/rtc_numerics.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/common_audio/common_audio.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/openmax_dl/dl/dl.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/common_audio/common_audio_sse2.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/utility/utility.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_processing/audio_processing.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/audio/utility/audio_frame_operations.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/audio_format_conversion.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/protobuf/protobuf_lite.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_processing/vad/vad.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/isac.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/isac_c.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/isac_common.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_processing/audioproc_debug_proto.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/p2p/libstunprober.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/p2p/rtc_p2p.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/L16/audio_decoder_L16.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/pcm16b.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/g711.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/legacy_encoded_audio_frame.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/g711/audio_decoder_g711.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/g722/audio_decoder_g722.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/g722.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/isac/audio_decoder_isac_float.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/ilbc/audio_decoder_ilbc.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/ilbc.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/opus/audio_decoder_opus.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/webrtc_opus.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/opus/opus.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/audio_network_adaptor.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/audio_network_adaptor_config.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/ana_config_proto.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/ana_debug_dump_proto.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/opus/audio_encoder_opus_config.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/L16/audio_encoder_L16.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/g711/audio_encoder_g711.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/g722/audio_encoder_g722.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/isac/audio_encoder_isac_float.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/api/audio_codecs/ilbc/audio_encoder_ilbc.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/video_coding/video_coding.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/video_coding/webrtc_i420.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/rtp_rtcp/rtp_rtcp.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/remote_bitrate_estimator/remote_bitrate_estimator.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/video_coding/webrtc_vp8.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/video_coding/webrtc_vp8_helpers.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/libvpx/libvpx.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/libvpx/libvpx_yasm.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/video_coding/webrtc_vp9.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/video_coding/webrtc_vp9_helpers.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/video_coding/encoded_frame.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/rtc_base/experiments/alr_experiment.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/video_coding/webrtc_h264.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/winsdk_samples/winsdk_samples.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/media/rtc_internal_video_codecs.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/media/rtc_constants.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/media/rtc_software_fallback_wrappers.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/video_coding/webrtc_multiplex.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/call/call.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/bitrate_controller/bitrate_controller.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/pacing/pacing.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/congestion_controller/congestion_controller.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/congestion_controller/transport_feedback.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/congestion_controller/network_control/network_control.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/congestion_controller/rtp/congestion_controller.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/congestion_controller/rtp/transport_feedback.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/rtc_base/experiments/congestion_controller_experiment.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/congestion_controller/bbr/bbr.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/congestion_controller/goog_cc/goog_cc.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/audio/audio.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_processing/aec3/aec3.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/audio_coding.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/cng.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/red.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/neteq.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_coding/rent_a_codec.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/video/video.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/video_processing/video_processing.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/video_processing/video_processing_sse2.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/rtc_base/weak_ptr.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_mixer/audio_mixer_impl.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/modules/audio_mixer/audio_frame_manipulator.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/pc/rtc_pc_base.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/media/rtc_data.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/usrsctp/usrsctp.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/third_party/libsrtp/libsrtp.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/pc/create_pc_factory.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/logging/rtc_event_log_impl_base.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/logging/rtc_event_log_impl_encoder.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/logging/rtc_event_log_proto.lib")
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/pc/peerconnection.lib") 
#pragma comment(lib, "../../webrtc_src/out/Debug/obj/stats/rtc_stats.lib")
#pragma comment(lib, "Winmm.lib")
#pragma comment(lib, "strmiids.lib")
#pragma comment(lib, "IPHLPAPI.lib")  
#pragma comment(lib, "Psapi.lib")  
#pragma comment(lib, "Secur32.lib")
#pragma comment(lib, "libs/x86/websocketsd_static.lib")
#pragma comment(lib, "libs/x86/zlib_internald.lib")

还要加系统lib: ws2_32.lib;msdmo.lib;dmoguids.lib;wmcodecdspuuid.lib;

 

需要注意问题1: peerconnection的代码一定要用配套的webrtc的example里的,我用从别人那下的peerconnection配套自己的webrtc版本,编译错误花了不少时间

需要注意问题2:  VS工程配置里的平台工具集一定要和ninja编译时指定的一致。

 

-------------------------------------------------------------------------------

原创文章,带点个人作品小广告,勿怪勿怪: “证爱网,见证爱

情侣之间,家庭成员之间,欢迎光临本店购买证爱礼物>>>

 

 

你可能感兴趣的:(基于Webrtc和Janus的多人视频会议系统开发3 - Peerconnection从ninja工程改造成VS工程)