[TOC]

https://www.benq.com/en-ap/projector/cinehome-home-cinema/w1120.html
https://www.benq.eu/en-dk/projector/cinehome-home-cinema/w1120/specifications.html
https://www.benq.com/en-ap/projector/cinehome-home-cinema/w1120.html
https://www.benq.com/en-ap/support/downloads-faq/products/projector/w1120/faq.html
https://www.benq.com/en-me/support/downloads-faq/products/projector/w1120/faq.html
https://www.benq.com/en-ap/support/downloads-faq/products/projector/w1120/manual.html
https://www.benq.com/en-ap/support/downloads-faq/products/projector/w1120/manual.html
明基(BenQ)Qcast Mirror 无线投屏器 2.4G/5G双频 高清 投影仪同屏器hdmi视频传输器 苹果安卓 无线同屏器
https://www.projectorcentral.com/projection-calculator-pro.cfm
img
这款机器本身可以直接放桌子上面使用,也可以购买吊架吊装使用。留一根HDMI线可以外接电脑或者电视盒子。本身内置音箱,如果要外接音箱的话,可以再留一根3.5mm音频线用来连接音箱哦
投影仪距离幕布越远,画面越大; 如果先确定画面大小,就能得到投影仪距离幕布的最小和最大距离;如果先确定投影仪距离幕布多远,就能得到画面尺寸。
机器安装高度具体根据您幕布高度来定哦img 机器正放的话,镜头对着幕布下沿;机器吊装(机器要倒置)的话,镜头对着幕布上沿~
img
img

除湿机 抽湿机

https://item.jd.com/100000117862.html 我们商品原厂配件是不带水管的,您有需要的话可以自行附近市场购买呢,水管内径是16mm

香港对除湿机需求量大,产品也非常领先,加上无需变压器和汇率优惠等因素,人肉带回,其他地区可以选择马云家代购。当地购买可以选择百老汇等连锁,想更便宜可以考虑上Price上找店铺。

香港出售的松下压缩式除湿机全线台湾制造,遗憾的是上一代产品,没有10倍纳米水离子、空净版没有PM2.5数显,同时安全防护减至15项,最大型号由22L降至18L(27℃,湿度60%),能耗也高了。但以上说的都是小问题,松下仍是220V里最好的除湿机之一。KDK有同款且价格更低,不介意logo的不二选择。

https://www.price.com.hk/buying-guide/dehumidifier-review

由于中高端的除湿机都要四五千元,所以建议除湿需求大且预算充足的朋友考虑带热除湿的空调(富士通Z、松下VE、三菱电机AHJZHJ),节省空间,更安静,虽然预算更高但与增加一台高端除湿机相差无几。

https://post.smzdm.com/p/apzexrx9/

大体上分为两类:压缩机式和热石式。虽然热石式除湿机的优点在于受温度湿度影响小、体积重量小、噪音小。但现在市面上的压缩式除湿机较为主流。鉴于我家的使用环境。还是在主流机型里面挑一挑吧。对于小家电,日淘总会有巨大的价格和技术优势,只是运费方面有些小贵,在日亚上面看到了三菱2016年的旗舰:MJ-180LX。

When to use VDI, server-based computing, and how Citrix Ardence dynamic desktop fits into all this
Citrix HDX
XenDesktop.&text=In%20other%20words%2C%20the%20difference,a%20desktop%20or%20an%20application.](https://www.lakesidesoftware.com/blog/what-xendesktop-explaining-difference-between-xenapp-and-xendesktop#:~:text=The main difference is how,SBC (Server Based Computing).&text=In other words%2C the difference,a desktop or an application.))
https://www.citrix.com/zh-cn/glossary/what-is-desktop-virtualization.html

[TOC]

TURN服务器测试网站验证
https://blog.piasy.com/2018/05/24/WebRTC-Video-Native-Journey/index.html
https://github.com/barry-ran/learn-webrtc/tree/master/doc
音频开发
webrtc学习笔记四:Webrtc源码目录结构
Webrtc官方网址:https://webrtc.org/
Webrtc老版官网地址:https://webrtc.github.io/webrtc-org/
Webrtc学习网址:https://webrtc.org.cn/
Webrtc中文文档https://github.com/RTC-Developer/WebRTC-Documentation-in-Chinese
W3C API文档:https://www.w3.org/TR/webrtc/
RTSP stream
WebRTC Custom OpenCV Video Capture
https://webrtchacks.com/
WebRTC data channels - HTML5 Rocks
WebRTC in the real world: STUN, TURN and signaling …
webrtc-自定义视频流-分析篇
webrtc-自定义视频流-实现篇(基于release-54)
WebRTC视频采集模块和数据流水线建立- 简书
Capture a MediaStream From a Canvas, Video or Audio …
RTCVideoCapturer
WebRTC的apprtc和collider源码分析
Colllider源码分析

webrtc 架构

2

目录结构

webrtc是架构分层的

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594

$ tree -d -L 2
.
├── api webrtc的接口层。比如浏览器、我们自己写的应用程序大多数时候都是直接从webrtc提供的这些api进行调用。如果我们想增加接口或者调整接口,就需要到api目录下去找相应的文件
│   ├── adaptation
│   ├── audio
│   ├── audio_codecs
│   ├── call
│   ├── crypto
│   ├── neteq
│   ├── rtc_event_log
│   ├── stats
│   ├── task_queue
│   ├── test
│   ├── transport
│   ├── units
│   ├── video
│   ├── video_codecs
│   └── voip
├── audio # 与音频相关的逻辑。
│   ├── test
│   ├── utility
│   └── voip
├── base
│   ├── allocator
│   ├── android
│   ├── containers
│   ├── debug
│   ├── files
│   ├── fuchsia
│   ├── hash
│   ├── i18n
│   ├── ios
│   ├── json
│   ├── mac
│   ├── memory
│   ├── message_loop
│   ├── metrics
│   ├── nix
│   ├── numerics
│   ├── posix
│   ├── power_monitor
│   ├── process
│   ├── profiler
│   ├── sampling_heap_profiler
│   ├── strings
│   ├── synchronization
│   ├── system
│   ├── task
│   ├── test
│   ├── third_party
│   ├── threading
│   ├── time
│   ├── timer
│   ├── trace_event
│   ├── util
│   └── win
├── build
│   ├── android
│   ├── args
│   ├── chromeos
│   ├── cipd
│   ├── config
│   ├── docs
│   ├── fuchsia
│   ├── internal
│   ├── ios
│   ├── linux
│   ├── mac
│   ├── sanitizers
│   ├── toolchain
│   ├── util
│   └── win
├── build_overrides
├── buildtools
│   ├── android
│   ├── checkdeps
│   ├── clang_format
│   ├── linux64
│   ├── mac
│   ├── third_party
│   └── win
├── call # 数据流的管理层,Call代表同一个端点的所有数据的流入流出,那当有多个端进行流入流出的时候就需要有多个Call。主要是对音频流、视频流的管理,当与对端建立连接之后,同一个端的这些流的管理就是通过call进行管理的。
│   ├── adaptation
│   └── test
├── common_audio
│   ├── include
│   ├── mocks
│   ├── resampler
│   ├── signal_processing
│   ├── third_party
│   └── vad
├── common_video
│   ├── generic_frame_descriptor
│   ├── h264
│   ├── include
│   ├── libyuv
│   └── test
├── data
│   ├── audio_processing
│   └── voice_engine
├── docs
│   └── native-code
├── examples
│   ├── aarproject
│   ├── androidapp
│   ├── androidjunit
│   ├── androidnativeapi
│   ├── androidtests
│   ├── objc
│   ├── objcnativeapi
│   ├── peerconnection
│   ├── stunprober
│   ├── stunserver
│   ├── turnserver
│   └── unityplugin
├── ios
│   ├── build
│   ├── chrome
│   ├── components
│   ├── net
│   ├── public
│   ├── showcase
│   ├── testing
│   ├── third_party
│   ├── web
│   └── web_view
├── logging
│   └── rtc_event_log
├── media #与多媒体相关的逻辑处理,如编解码的逻辑处理。比如什么时候进行编码,什么时候进行解码这些都是在media目录下控制的。
│   ├── base
│   ├── engine
│   └── sctp
├── modules #重中之重!!!!!!!!!!!
│   ├── audio_coding #音频编解码器相关代码
./modules/audio_coding/audio_network_adaptor/bitrate_controller.h
./modules/audio_coding/audio_network_adaptor/bitrate_controller_unittest.cc
./modules/audio_coding/audio_network_adaptor/bitrate_controller.cc
码率控制的相关代码。控制码流是500K,1M,还是2M,这个码流的控制就是在这个目录下。想改变码流,想看码流相关的控制,就进入这个目录下即可
│   ├── audio_device #音频采集与音频播放相关的代码
│   ├── audio_mixer #混音相关

│   ├── audio_processing #音频前后处理的相关代码。对音频的前处理,后处理;比如回音消除,降噪,增益等等
│   ├── congestion_controller # 流量控相关代码。当检测到网络流量比较高的时候,需要做一些网络流量控制,防止网络包把带宽打死,具体怎么控制就是在这里设置的,想要看流控相关的代码就在这个目录中查看。
│   ├── desktop_capture #桌面采集相关,win,linux,mac目录下,如图所示
│   ├── include
│   ├── pacing #pacing目录:码率探测及平滑处理相关的代码。首先需要检测到音频视频的码率是多少,检测到后做一个平滑的处理,就是不是让数据一下发送出去,需要做平滑处理,比如有时候是10K,有时候是500K,给做一个平均,不能一会儿高一会儿低,而是给做一个平滑处理
│   ├── remote_bitrate_estimator #emote_bitrate_estimator目录:远端码率估算相关代码。评估远端能接收的带宽是多少,不是我本地的发送的带宽,是远程接收端的估算带宽。不仅仅需要知道发送端单位时间能发送多少,还需要知道对方端单位时间能收多少,所以需要一个远端码率的评估。评估的代码就在这个目录下。
│   ├── rtp_rtcp #rtp/rtcp协议相关代码
│   ├── third_party
│   ├── utility
│   ├── video_capture #视频采集相关的代码。捕获视频相关的代码 平台无关的代码在该直接目录下
│   ├── video_coding #视频编解码器相关的代码。视频的编码器VP8/VP9等等,编码器都是放在这里的。
│   └── video_processing #视频前处理、后处理相关的代码。视频帧的增强,检测,还有如果增加人脸识别就可以放在这个目录下。
├── out
│   ├── Aios64
│   └── ios
├── p2p # 端到端相关代码,stun/turn。端到端要进行传输的时候需要看p2p是不是能打通,p2p有很多类型,链接能不能打通,相应的侦测工具都是在这个p2p目录下。相应的协议有STUN协议TURN协议。
│   ├── base
│   ├── client
│   └── stunprober
├── pc # Peer Connection,连接相关的逻辑层。Peer Connection代表的是与对端的一个连接,在上层有一个连接的概念,在连接下面就有很多的东西了,比如连接的时候有stream流,流里面又有轨track,一个流里面可以有很多轨,包括音频轨、视频轨、桌面轨等等,轨道的概念就可以理解为两个平行的线,是不相交叉,音频、视频都是单独的,这样一个概念。通过Peer Connection拿到Stream流,流里能拿到每一个多媒体,也就是音频视频,当然还可以拿到所有的统计信息,比如媒体流的统计信息、传输的统计信息等等。 Peer Connection是一个非常重要的目录,相当于上层接口的一个统一的接口层
│   ├── scenario_tests
│   └── test
├── resources
│   ├── audio_coding
│   ├── audio_device
│   ├── audio_processing
│   ├── images
│   ├── media
│   ├── network_tester
│   ├── remote_bitrate_estimator
│   ├── rtp_rtcp
│   ├── utility
│   ├── video_coding
│   ├── video_engine
│   └── voice_engine
├── rtc_base # 基础代码,如线程、锁相关的统一接口代码。由于webrtc是夸平台的,所以线程、锁这些会有所不同,特别是在Windows和Linux上使用的函数差别特别大,那怎么办呢?如果上层根据每个平台去做不同的处理的话,就需要些很多代码了。但是分层之后,对于上层逻辑来说,只需要统一调用webrtc定义的这个规范,比如线程规范、锁规范,就可以了,具体在rtc_base这个目录下再区分是Windows层的还是Linux层的还是mac层的等等。
————————————————
版权声明:本文为CSDN博主「费城之鹰」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/jakezhang1990/article/details/104690208
│   ├── deprecated
│   ├── experiments
│   ├── java
│   ├── memory
│   ├── network
│   ├── numerics
│   ├── strings
│   ├── synchronization
│   ├── system
│   ├── task_utils
│   ├── third_party
│   ├── time
│   ├── units
│   └── win
├── rtc_tools # 里面是一些工具,音视频分析相关的工具代码。比如对H264进行分析的话有I帧、B帧、P帧、NALL头等都可以找到相应的分析工具。(音视频相关的专门的测试工具目录)
│   ├── audioproc_f
│   ├── converter
│   ├── frame_analyzer
│   ├── loopback_test
│   ├── network_tester
│   ├── psnr_ssim_analyzer
│   ├── py_event_log_analyzer
│   ├── rtc_event_log_visualizer
│   ├── rtp_generator
│   ├── testing
│   └── unpack_aecdump
├── sdk # sdk目录:主要存放Android和iOS层代码。如音频视频的采集,渲染等。
│   ├── android
│   └── objc
├── stats #stats目录:存放各种数据统计相关的类。比如,丢包率、抖动时长等等。
│   └── test
├── style-guide
├── system_wrappers #system_wrappers目录:与具体操作系统相关的代码。如CPU特性,原子操作,锁等。各个平台分别形成一个文件,比如Windows的形成一个文件,Linux的形成一个文件等等。
│   ├── include
│   └── source
├── test
│   ├── android
│   ├── fuzzers
│   ├── gl
│   ├── ios
│   ├── linux
│   ├── logging
│   ├── mac
│   ├── network
│   ├── pc
│   ├── peer_scenario
│   ├── scenario
│   ├── testsupport
│   ├── time_controller
│   └── win
├── testing
│   ├── android
│   ├── buildbot
│   ├── chromoting
│   ├── clusterfuzz
│   ├── gmock
│   ├── gtest
│   ├── gtest_ios
│   ├── iossim
│   ├── libfuzzer
│   ├── merge_scripts
│   ├── perf
│   ├── scripts
│   ├── trigger_scripts
│   └── variations
├── third_party
│   ├── Python-Markdown
│   ├── SPIRV-Tools
│   ├── abseil-cpp
│   ├── accessibility-audit
│   ├── accessibility_test_framework
│   ├── adobe
│   ├── afl
│   ├── android_build_tools
│   ├── android_crazy_linker
│   ├── android_data_chart
│   ├── android_deps
│   ├── android_media
│   ├── android_opengl
│   ├── android_platform
│   ├── android_protobuf
│   ├── android_protoc
│   ├── android_provider
│   ├── android_sdk
│   ├── android_support_test_runner
│   ├── android_swipe_refresh
│   ├── android_system_sdk
│   ├── apache-mac
│   ├── apache-portable-runtime
│   ├── apache-win32
│   ├── apple_apsl
│   ├── arcore-android-sdk
│   ├── arcore-android-sdk-client
│   ├── ashmem
│   ├── axe-core
│   ├── bazel
│   ├── blanketjs
│   ├── blink
│   ├── boringssl
│   ├── bouncycastle
│   ├── breakpad
│   ├── brotli
│   ├── bspatch
│   ├── byte_buddy
│   ├── cacheinvalidation
│   ├── catapult
│   ├── ced
│   ├── chaijs
│   ├── checkstyle
│   ├── chromevox
│   ├── cld_3
│   ├── closure_compiler
│   ├── colorama
│   ├── crashpad
│   ├── crc32c
│   ├── d3
│   ├── dav1d
│   ├── decklink
│   ├── depot_tools
│   ├── devscripts
│   ├── dom_distiller_js
│   ├── dpkg-shlibdeps
│   ├── emoji-segmenter
│   ├── espresso
│   ├── expat
│   ├── feed_library
│   ├── ffmpeg
│   ├── flatbuffers
│   ├── fontconfig
│   ├── freetype
│   ├── fuchsia-sdk
│   ├── gif_player
│   ├── glfw
│   ├── glslang
│   ├── google-truth
│   ├── google_android_play_core
│   ├── google_appengine_cloudstorage
│   ├── google_benchmark
│   ├── google_input_tools
│   ├── google_toolbox_for_mac
│   ├── google_trust_services
│   ├── googletest
│   ├── gradle_wrapper
│   ├── grpc
│   ├── gtest-parallel
│   ├── guava
│   ├── gvr-android-keyboard
│   ├── gvr-android-sdk
│   ├── hamcrest
│   ├── harfbuzz-ng
│   ├── hunspell
│   ├── iaccessible2
│   ├── iccjpeg
│   ├── icu
│   ├── icu4j
│   ├── ijar
│   ├── ink
│   ├── inspector_protocol
│   ├── instrumented_libraries
│   ├── isimpledom
│   ├── jacoco
│   ├── javalang
│   ├── jdk
│   ├── jetifier_standalone
│   ├── jinja2
│   ├── jsoncpp
│   ├── jstemplate
│   ├── junit
│   ├── khronos
│   ├── lcov
│   ├── leveldatabase
│   ├── libFuzzer
│   ├── libXNVCtrl
│   ├── libaddressinput
│   ├── libaom
│   ├── libavif
│   ├── libbrlapi
│   ├── libdrm
│   ├── libgav1
│   ├── libipp
│   ├── libjingle_xmpp
│   ├── libjpeg_turbo
│   ├── liblouis
│   ├── libovr
│   ├── libphonenumber
│   ├── libpng
│   ├── libprotobuf-mutator
│   ├── libsecret
│   ├── libsrtp
│   ├── libsync
│   ├── libudev
│   ├── libusb
│   ├── libvpx
│   ├── libwebm
│   ├── libwebp
│   ├── libxml
│   ├── libxslt
│   ├── libyuv
│   ├── llvm-build
│   ├── logilab
│   ├── lottie
│   ├── lzma_sdk
│   ├── mako
│   ├── markdown
│   ├── markupsafe
│   ├── material_design_icons
│   ├── mesa_headers
│   ├── metrics_proto
│   ├── microsoft_webauthn
│   ├── minigbm
│   ├── minizip
│   ├── mocha
│   ├── mockito
│   ├── modp_b64
│   ├── motemplate
│   ├── mozilla
│   ├── nasm
│   ├── netty-tcnative
│   ├── netty4
│   ├── node
│   ├── objenesis
│   ├── ocmock
│   ├── one_euro_filter
│   ├── opencv
│   ├── openh264
│   ├── openscreen
│   ├── openvr
│   ├── openxr
│   ├── opus
│   ├── ots
│   ├── ow2_asm
│   ├── pexpect
│   ├── pffft
│   ├── ply
│   ├── polymer
│   ├── private-join-and-compute
│   ├── private_membership
│   ├── proguard
│   ├── protobuf
│   ├── protoc_javalite
│   ├── pycoverage
│   ├── pyjson5
│   ├── pylint
│   ├── pymock
│   ├── pystache
│   ├── pywebsocket
│   ├── pywebsocket3
│   ├── qcms
│   ├── quic_trace
│   ├── qunit
│   ├── r8
│   ├── re2
│   ├── requests
│   ├── rnnoise
│   ├── robolectric
│   ├── s2cellid
│   ├── schema_org
│   ├── shaderc
│   ├── shell-encryption
│   ├── simplejson
│   ├── sinonjs
│   ├── six
│   ├── smhasher
│   ├── snappy
│   ├── speech-dispatcher
│   ├── spirv-cross
│   ├── spirv-headers
│   ├── sqlite
│   ├── sqlite4java
│   ├── subresource-filter-ruleset
│   ├── sudden_motion_sensor
│   ├── tcmalloc
│   ├── test_fonts
│   ├── tlslite
│   ├── turbine
│   ├── ub-uiautomator
│   ├── unrar
│   ├── usb_ids
│   ├── usrsctp
│   ├── v4l-utils
│   ├── vulkan_headers
│   ├── wayland
│   ├── wayland-protocols
│   ├── wds
│   ├── web-animations-js
│   ├── webdriver
│   ├── webgl
│   ├── webgpu-cts
│   ├── webrtc_overrides
│   ├── webxr_test_pages
│   ├── weston
│   ├── widevine
│   ├── win_build_output
│   ├── woff2
│   ├── wtl
│   ├── wuffs
│   ├── xstream
│   └── zlib
├── tools
│   ├── accessibility
│   ├── android
│   ├── binary_size
│   ├── bisect_repackage
│   ├── cfi
│   ├── check_ecs_deps
│   ├── checkbins
│   ├── checklicenses
│   ├── checkperms
│   ├── checkteamtags
│   ├── chrome_extensions
│   ├── chrome_proxy
│   ├── clang
│   ├── code_coverage
│   ├── compile_test
│   ├── coverity
│   ├── cr
│   ├── cros
│   ├── cygprofile
│   ├── cygprofile_win
│   ├── determinism
│   ├── diagnosis
│   ├── dromaeo_benchmark_runner
│   ├── dump_process_memory
│   ├── emacs
│   ├── find_runtime_symbols
│   ├── flags
│   ├── flakiness
│   ├── fuchsia
│   ├── gdb
│   ├── generate_library_loader
│   ├── generate_shim_headers
│   ├── generate_stubs
│   ├── git
│   ├── gn
│   ├── grit
│   ├── gritsettings
│   ├── idl_parser
│   ├── imagediff
│   ├── infra
│   ├── ipc_fuzzer
│   ├── json_comment_eater
│   ├── json_schema_compiler
│   ├── json_to_struct
│   ├── linux
│   ├── lldb
│   ├── luci-go
│   ├── mac
│   ├── mb
│   ├── md_browser
│   ├── media_engagement_preload
│   ├── memory
│   ├── memory_inspector
│   ├── metrics
│   ├── msan
│   ├── oopif
│   ├── origin_trials
│   ├── page_cycler
│   ├── perf
│   ├── polymer
│   ├── protoc_wrapper
│   ├── python
│   ├── real_world_impact
│   ├── resources
│   ├── security
│   ├── site_compare
│   ├── stats_viewer
│   ├── strict_enum_value_checker
│   ├── style_variable_generator
│   ├── sublime
│   ├── swarming_client
│   ├── symsrc
│   ├── tcmalloc
│   ├── tests
│   ├── traceline
│   ├── traffic_annotation
│   ├── translation
│   ├── ubsan
│   ├── usb_gadget
│   ├── v8_context_snapshot
│   ├── valgrind
│   ├── variations
│   ├── vim
│   ├── vscode
│   ├── web_bluetooth
│   ├── web_dev_style
│   ├── win
│   └── xdisplaycheck
├── tools_webrtc #.tool_webrtc目录:webrtc测试相关的工具代码,各种单元测试如网络模拟器,网络的测试,音频的测试,视频的测试都是在这个目录下。(整个webrtc的测试工具目录)
│   ├── android
│   ├── audio_quality
│   ├── autoroller
│   ├── coverage
│   ├── cpu
│   ├── ios
│   ├── libs
│   ├── matlab
│   ├── mb
│   ├── msan
│   ├── network_emulator
│   ├── perf
│   ├── presubmit_checks_lib
│   ├── sancov
│   ├── sanitizers
│   ├── sslroots
│   ├── ubsan
│   ├── video_quality_toolchain
│   └── vim
└── video #与视频相关的逻辑。当视频编解码处理等相关逻辑
├── adaptation
├── end_to_end_tests
└── test

581 directories

cloud-game

cloud-game/pkg/worker/room/room.go
func NewRoom(roomID string, gameName string, videoEncoderType string, onlineStorage *storage.Client, cfg worker.Config) *Room {
z505/goDLL

go Call c 函数

fan out Ver. 成扇形展开

A wind faned her hair out behand her. 一阵风把她的头发吹的飘散着背后。

1
2

# /Users/choe/go/src/cloud-game/pkg/emulator/libretro/nanoarch/nanoarch.go
image-20200619121245180
coreVideoRefresh // image is resized here and push to channel. On the other side, images will be fan out
WorkerInternal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

$ tree /Users/choe/go/src/cloud-game/pkg/emulator/libretro/
/Users/choe/go/src/cloud-game/pkg/emulator/libretro/
├── image
│   ├── color.go
│   ├── draw.go
│   └── scale.go
└── nanoarch
├── cfuncs.go
├── libretro.h
├── naemulator.go
├── nanoarch.go
└── savestates.go

2 directories, 8 files

~/go/src/cloud-game/pkg/emulator/libretro/image on  master! ⌚ 12:34:29
$ cat draw.go
package image

import (
"image"
)

func DrawRgbaImage(pixFormat int, scaleType int, w int, h int, packedW int, vw int, vh int, bpp int, data []byte, image *image.RGBA) {
switch pixFormat {
case BIT_FORMAT_SHORT_5_6_5:
Resize(scaleType, rgb565, w, h, packedW, vw, vh, bpp, data, image)
case BIT_FORMAT_INT_8_8_8_8_REV:
Resize(scaleType, rgba8888, w, h, packedW, vw, vh, bpp, data, image)
case BIT_FORMAT_SHORT_5_5_5_1:
fallthrough
default:
image = nil
}
}


Resize reference from scale.go

func Resize(scaleType int, fn Format, w int, h int, packedW int, vw int, vh int, bpp int, data []byte, out *image.RGBA) {

// !to implement own image interfaces img.Pix = bytes[]
src := image.NewRGBA(image.Rect(0, 0, w, h))
toRgba(fn, w, h, packedW, bpp, data, src)

// !to do set it once instead switching on each iteration
// !to do skip resize if w=vw h=vh
switch scaleType {
case ScaleSkip:
skip(fn, w, h, packedW, vw, vh, bpp, data, src, out)
case ScaleNearestNeighbour:
draw.NearestNeighbor.Scale(out, out.Bounds(), src, src.Bounds(), draw.Src, nil)
//nearest(fn, w, h, packedW, vw, vh, bpp, data, src, out)
case ScaleBilinear:
draw.ApproxBiLinear.Scale(out, out.Bounds(), src, src.Bounds(), draw.Src, nil)
//bilinear(fn, w, h, packedW, vw, vh, bpp, data, src, out)
case ScaleOld:
fallthrough
default:
old(fn, w, h, packedW, vw, vh, bpp, data, src, out)
}
}
image-20200619145256862
Room 的 startVideo的主流程

Go code that imports a pseudo-package “C” 导入”伪包” “C”,引用C的类型 C.size_t,C的变量C.stdout, C的函数 C.printf

http://einverne.github.io/post/2013/12/projector.html

https://post.smzdm.com/p/andg0kdp/

高压汞灯是传统光源,也是目前主流产品使用的光源系统,分为DLP和3LCD技术。其中爱普生是3LCD的主要支持者,3LCD在亮度、色彩、对比度都有不错的表现,同时避免彩虹眼的发生。不过也存在时间长了面板老化问题;DLP技术则是台系品牌主要使用的技术,包括主流的明基投影产品都是DLP的。DLP有优秀的亮度、对比度表现出色,分辨率高,可以靠抖实现4K分辨率。不过对一些人来说可能存在彩虹眼的风险。综合而言DLP和3LCD没有高低之分,都是经受住市场考验的产品。

LED光源是近2年才开始大规模应用在投影机上的,随着LED亮度大幅的提高,使LED在投影上应用成为了可能。目前国产的智能投影仪都是采用LED作为光源,部分产品已经可以达到2000ANSI亮度,可以与入门级灯泡机一较高下。而色彩方面虽然仍然不及传统灯泡光源鲜艳,但终究还是有大幅的提升。经过几年的市场考验,LED投影凭借高度集成化、高性价比、低发热、低噪音、体积便携的特性,终究还是活了下来,被越来越多的消费者所认可。这也是为什么楼主在卧室场景下推荐使用LED投影仪的原因。

image-20200607150420682
image-20200607150510834
image-20200607151817209
image-20200607152137017
image-20200607152511436
image-20200607152823115
image-20200607152913267
image-20200607153103927
image-20200607152556989

http_proxy可以用socks5来代理 http_proxy=socks5://127.0.0.1:8080 go get github.com/mattn/go-sqlite3
ALL_PROXY=”socks5h://NNN.NNN.NNN.NNN.PPPP
ALL_PROXY=”socks5://NNN.NNN.NNN.NNN.PPPP”

curl.md:25:# socks5
curl.md:30:$curl -x socks5://127.0.0.1:1080 abc.om
curl.md:32:$curl -so /dev/null -w “%{http_code}” abc.com -x socks5://127.0.0.1:1080
curl.md:345:默认在本机解析hostname (socks5h使用proxy 来解决hostname . -x + socks5h = –sock5-hostname)
curl.md:346: The proxy string can be specified with a protocol:// prefix. No protocol specified or http:// will be treated as HTTP proxy. Use socks4://, socks4a://, socks5:// or socks5h:// to request a specific SOCKS version to be used. (The protocol support was added in curl 7.21.7)
curl.md:353:–socks5-hostname <host[:port]>
curl.md:359: Since 7.21.7, this option is superfluous(多余的,不必要的) since you can specify a socks5 hostname proxy with -x, –proxy using a socks5h:// protocol prefix.
curl.md:369:> Since 7.21.7, this option is superfluous since you can specify a socks5 hostname proxy with -x, –proxy using a socks5h:// protocol prefix.
curl.md:371:> The little h following the socks5 tells curl to lookup hostnames via proxy too.
curl.md:375:> ALL_PROXY=”socks5h://NNN.NNN.NNN.NNN.PPPP”
curl.md:378:> ALL_PROXY=”socks5://NNN.NNN.NNN.NNN.PPPP”
git-command.md:43:# git with socks5 proxy
git-command.md:47:git config –global http.proxy socks5://127.0.0.1:8080
git-command.md:48:http_proxy=socks5://127.0.0.1:8080 go get github.com/mattn/go-sqlite3
go.md:157:http_proxy=socks5://ip:port go get packageA
go.md:163:git config –global http.proxy socks5://127.0.0.1:8080
go.md:164:http_proxy=socks5://127.0.0.1:8080 go get github.com/mattn/go-sqlite3
go.md:169:| | https://www.topcaver.com/go-get-through-socks5-proxy | |
go.md:2256: // and “socks5” are supported. If the scheme is empty,
homebrew.md:4:tags: [2018,201802, homebrew, proxy, socks5]
homebrew.md:7:- socks5
homebrew.md:237:+ 支持socks5代理
homebrew.md:239:$ export ALL_PROXY=socks5://127.0.0.1:1080
linux.md:1999:socks5h://192.168.212.34:1080
proxy.md:37:| | IPv6, HTTP(S), SOCKS, socks5 over TLS, DNS via Proxy, Proxy Checker, NTLM, Windows Service, XML Config, Proxy Redundancy. a virtual network interface |
proxy.md:131:# socks5
proxy.md:222:git config –global http.proxy socks5://127.0.0.1:7070
proxy.md:223:http_proxy=socks5://127.0.0.1:7070 go get github.com/mattn/go-sqlite3
proxy.md:228:| | https://www.topcaver.com/go-get-through-socks5-proxy | |
python.md:404:requests (2.12.4) 在Windows下使用socks5代理时,出现报错:
rtp.md:85:$ ALL_PROXY=socks5h://ip:port brew install nasm
socks5.md:2:title: socks5
socks5.md:5:typora-copy-images-to: socks5
ssh-config.md:973:-D [bind_address:]port 指定一个本地动态应用程序级别的端口转发. 原理: 在本地启动一个监听端口, 当有连接进入这个端口时, 连接经由隧道转发, 应用协议决定从远程机器转发到哪个目标地址. -D 使ssh 扮演了 SOCKS 服务器的角色,支持 socks4, socks5 . | -D [bind_address:]port
Specifies a local ``dynamic’’ application-level port forwarding. This works by allocating a socket to listen to port on the local side, optionally bound to the specified bind_address. Whenever a connection is made to this port, the connection is forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are supported, and ssh will act as a SOCKS server. Only root can forward privileged ports. Dynamic port forwardings can also be specified in the configuration file.
vscodeProxy.md:35:# “http.proxy” setting no longer allows socks5 proxies
vscodeProxy.md:52:#和chrome同根同源 不支持 socks5

[TOC]

About SDL

Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve‘s award winning catalog and many Humble Bundle games.

SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. Support for other platforms may be found in the source code.

SDL is written in C, works natively with C++, and there are bindings available for several other languages, including C# and Python.

SDL 2.0 is distributed under the zlib license. This license allows you to use SDL freely in any software.

1
2
3
4
5
6
7
8
++++++++++++++++++++++++++++++
+ ffplay +
++++++++++++++++++++++++++++++
+ SDL +
++++++++++++++++++++++++++++++
+ OpenGL + Direct3D +
++++++++++++++++++++++++++++++
Simple DirectMedia Layer

[TOC]

TURN服务器测试网站验证
ICE 交互式链接建立 https://webrtchacks.com/trickle-ice/
ICE是计算机网络中使用的技术用来在点对点的网络中查找两台计算机(endpoint)之间尽可能的直接通讯的路径
测试环境搭建 https://webrtc.org/getting-started/testing
AppRTC collider offical doc https://github.com/webrtc/apprtc/blob/master/src/collider/README.md
AppRTC 搭建 自建 AppRTC
分析andriod 信令服务器工作过程 WebRTC for Android
挺详细的搭建指南 WebRTC开源项目-手把手教你搭建AppRTC
CloudRetro 游戏栗子 https://github.com/giongto35/cloud-game
webM libvpx: VP8/VP9 Codec SDK https://www.webmproject.org/code/
webrtc 的js栗子 https://webrtc.github.io/samples/
coturn服务器的配置 https://docs.bigbluebutton.org/2.2/setup-turn-server.html
coturn github https://github.com/coturn/coturn
coturn官方安装文档 https://github.com/coturn/coturn/blob/master/INSTALL
how to install coturn
How to create and configure your own STUN/TURN server with coturn in Ubuntu 18.04
原生开发 The currently supported platforms are Windows, Mac OS X, Linux, http://webrtc.github.io/webrtc-org/native-code/development/
APP Android and iOS. See the Android and iOS pages
ios App开发 http://webrtc.github.io/webrtc-org/native-code/ios/
android App开发 http://webrtc.github.io/webrtc-org/native-code/android/
Cannot see the v4l2loopback using google-chrome or …
https://srcco.de/posts/using-obs-studio-with-v4l2-for-google-hangouts-meet.html
https://webrtc.org/->source Repository https://webrtc.googlesource.com/src
拥塞优化 evaluate the Google Congestion Control for WebRTC
go call windows dll https://github.com/golang/go/wiki/WindowsDLLs

gn reference gn 参考

https://gn.googlesource.com/gn/+/master/docs/reference.md

target_os https://gn.googlesource.com/gn/+/master/docs/reference.md#var_target_os

1
2
3
4
5
6
7
- "android"
- "chromeos"
- "ios"
- "linux"
- "nacl"
- "mac"
- "win"

IDE-options https://gn.googlesource.com/gn/+/master/docs/reference.md#IDE-options

depot_tools

depot_tools 批处理脚本(fetch 为bash 文件,内部调用 fetch.py )

是对mac/windows/linux等平台构建开发环境和下封装代码控制的工具gi t/svn的wrapper工具 ,可以认为是代码和工具包的上层接口。

利用depot_tools 如何 fetch构建目标开发环境

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
$ fetch --help
usage: fetch.py [options] <config> [--property=value [--property2=value2 ...]]

This script can be used to download the Chromium sources. See
http://www.chromium.org/developers/how-tos/get-the-code
for full usage instructions.

Valid options:
-h, --help, help Print this message.
--nohooks Don't run hooks after checkout.
--force (dangerous) Don't look for existing .gclient file.
-n, --dry-run Don't run commands, only print them.
--no-history Perform shallow clones, don't fetch the full git history.

Valid fetch configs:
android
android_internal
breakpad
chromium
config_util
crashpad
dart
depot_tools
devtools-frontend
goma_client
gyp
infra
infra_internal
inspector_protocol
ios
ios_internal
nacl
naclports
node-ci
pdfium
skia
skia_buildbot
syzygy
v8
webrtc #windows ??
webrtc_android # android
webrtc_ios # ios
1
2
3
4
5
6
7
Your current directory appears to already contain, or be part of,
a checkout.
"fetch" is used only to get new checkouts.
Use "gclient sync" to update existing checkouts.

Fetch also does not yet deal with partial checkouts, so if fetch
failed, delete the checkout and start over (crbug.com/230691).
1
2
3
4
5
6
7
8
9
10
11
12
# http://webrtc.github.io/webrtc-org/native-code/development/
fetch --nohooks webrtc
gclient sync


# ios #http://webrtc.github.io/webrtc-org/native-code/ios/
fetch --nohooks webrtc_ios
gclient sync

# http://webrtc.github.io/webrtc-org/native-code/android/
fetch --nohooks webrtc_android
gclient sync

Block Diagram http://webrtc.github.io/webrtc-org/native-code/native-apis/

apprtc 房间+web 服务器 + collider 信令服务器

coturn 打洞/中转服务器

1、AppRTC - 房间服务器。Github
2、Collider - 信令服务器。上面 Github 工程里自带,在 src/collider 下
3、coTurn - 打洞(内网穿透)服务器
4、还需要自己实现一个 coTurn 连接信息(主要是用户名、密码的配置)获取接口,通常叫做 TURN REST API。

https://amryousef.me/android-webrtc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

yum -y install java-1.8.0-openjdk-devel java-1.8.0-openjdk
yum -y install openssl-devel libevent libevent-devel
yum -y install nodejs npm python python-webtest golang php-fpm nginx
npm -g install grunt-cli


# https://openjdk.java.net/install/




$ apt install nodejs
node --version
v8.10.0

sudo apt install -y curl && curl -O https://nodejs.org/dist/v12.16.3/node-v12.16.3-linux-x64.tar.xz

tar -xvf node-v12.16.3-linux-x64.tar.xz

cd ~/cui/node-v12.16.3-linux-x64/bin

$sudo ln -s `pwd`/node /usr/local/bin/
$sudo ln -s `pwd`/npm /usr/local/bin

$sudo npm -g install grunt-cli
sudo ln -s `pwd`/grunt /usr/local/bin/

#重新exit bash, node 生效

搭建AppRTC Demo

apprtc

https://github.com/webrtc/apprtc

搭建环境指南

README.md

Running AppRTC locally requires Google App Engine SDK for Python, Node.js and Grunt.

Follow the instructions on Node.js website, Python PIP and on Grunt website to install them.

安装Python和Python-webtest (python2.7)

When Node.js and Grunt are available you can install the required dependencies running npm install and pip install -r requirements.txt from the project root folder.

Before you start the AppRTC dev server and everytime you update the source code you need to recompile the App Engine package by running grunt build.

Start the AppRTC dev server from the out/app_engine directory by running the Google App Engine SDK dev server,

1
<path to sdk>/dev_appserver.py ./out/app_engine

Then navigate to http://localhost:8080 in your browser (given it’s on the same machine).

  1. server OS: Ubuntu 18.04.3 LTS

  2. install openJDK

    1
    2
    3
    4
    5
    6
    7
    8
    9

    $sudo apt update
    $sudo apt-get install openjdk-8-jdk
    ##// sudo update-alternatives --config java
    ##// sudo update-alternatives --config javac
    $ java -version
    openjdk version "1.8.0_252"
    OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
    OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
  3. install python 2

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10


    # 没有则输入下命令
    sudo apt-get install python
    # python 安装之后安装 Python-webtest
    sudo apt-get install python-webtest


    python -V
    Python 2.7.17
  1. Google App Engine SDK for Python

install GAE for python (offline version) 安装Python和Python-webtest (python2.7)

Google Engine SDK

官网地址:https://cloud.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python

https://cloud.google.com/appengine/docs/standard/python/download

if Python 2.7 isn’t installed, install it now using the installation instructions for your Linux distribution.

A6883E96-561F-4C79-87AF-065DEEE8FB23

47149482-8A67-478B-B346-9D8C8CC9AC37

3D4B284F-C3F7-4A73-8916-6799A073FA5F

下载 GAE (下载并安装原始的 Python 2 版 App Engine SDK)

https://cloud.google.com/appengine/docs/standard/python/download#python_linux

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

wget https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.91.zip

版本:
1.9.91 - 2020-05-11

大小:
53.8MB

SHA1 校验和:
36c802d46ccc7ea9b02bcaed40014f9ecbd1158c

如需在 Linux 系统中安装,请执行以下操作:

解压缩您下载的 google_appengine_1.9.91.zip 文件,例如:
unzip google_appengine_1.9.91.zip

将文件解压缩后,无需运行 App Engine 安装脚本。

将 google_appengine 目录添加到您的 PATH 环境变量:
export PATH=$PATH:DIRECTORY_PATH/google_appengine/

使用以下命令验证您的机器已安装 Python 2.7:
/usr/bin/env python -V

输出应如下所示:Python 2.7.[NUMBER]。如果未安装 Python 2.7,请立即使用您的 Linux 发行版的安装说明进行安装。
  1. install Go

    1
    2
    3
    4
    wget https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz

    export PATH=$PATH:/DIRECT_PATH/go/bin
    export GOPATH=

    path 防重机制 export 多次路径

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#set -x
echo "before:" $PATH

if [ $(echo $PATH|grep -c google_appengine) -eq 0 ] ; then
export PATH=$PATH:/home/andrew/cui/webrtcSetEnv/google_appengine
fi

if [ $(echo $PATH|grep -c "go/bin") -eq 0 ] ; then
export PATH=$PATH:/home/andrew/cui/webrtcSetEnv/go/bin
fi

echo "after:" $PATH

#set +x
  1. apprtc (js+python) (默认端口 8080)

    image-20200604184917430
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

# 依赖

# AppRTC 依赖 grunt 和 Google AppEngine SDK for Python 离线版本
$npm install grunt-cli
$sudo apt update
$sudo apt-get install python-pip python-setuptools -y
$pip install -U pip setuptools
$sudo pip install requests

git clone https://github.com/webrtc/apprtc.git

#将collider的源码软连接到go的工作目录下
https://github.com/webrtc/apprtc/blob/master/src/collider/README.md


AppRTC 依赖 grunt 和 Google AppEngine SDK for Python 离线版本。




sudo grunt build


cd apprtc
$grunt build
$. ./env.sh

cd apprtc
dev_appserver.py --host=0.0.0.0 --port=8080 ./out/app_engine --skip_sdk_update_check

--port PORT lowest port to which application modules should bind
(default: 8080)

$ ./runapprtc.sh
[in] /home/andrew/cui/webrtcSetEnv/apprtc
INFO 2020-06-04 09:30:39,636 devappserver2.py:289] Skipping SDK update check.
WARNING 2020-06-04 09:30:40,607 simple_search_stub.py:1198] Could not read search indexes from /tmp/appengine.None.andrew/search_indexes
INFO 2020-06-04 09:30:40,609 api_server.py:282] Starting API server at: http://localhost:33401
INFO 2020-06-04 09:30:40,625 dispatcher.py:267] Starting module "default" running at: http://0.0.0.0:8080
INFO 2020-06-04 09:30:40,625 admin_server.py:150] Starting admin server at: http://localhost:8000
INFO 2020-06-04 09:30:42,669 instance.py:294] Instance PID: 29277





1.
修改apprtc/src/app_engine/apprtc.py
搜索 "wss:""https:"
可以在方法 get_wss_parameters 里搜索到,
把 wss: -> ws:、把 https: -> http:,保存

146: wss_url = 'wss://' + wss_host_port_pair + '/ws'
147: wss_post_url = 'https://' + wss_host_port_pair


2. 修改apprtc/src/app_engine/constants.py
./src/app_engine/constants.py:41:ICE_SERVER_BASE_URL = 'https://networktraversal.googleapis.com'


① 搜索 TURN_BASE_URL
将等号后面的字符串替换为 apprtc 可以访问到的地址,如:'http://apprtc.domain.com:8083'

② 搜索 WSS_INSTANCES
./out/app_engine/constants.py:49:WSS_INSTANCES = [{
./out/app_engine/constants.py-50- WSS_INSTANCE_HOST_KEY: 'apprtc-ws.webrtc.org:443',
./out/app_engine/constants.py-51- WSS_INSTANCE_NAME_KEY: 'wsserver-std',
./out/app_engine/constants.py-52- WSS_INSTANCE_ZONE_KEY: 'us-central1-a'
./out/app_engine/constants.py-53-}, {
./out/app_engine/constants.py-54- WSS_INSTANCE_HOST_KEY: 'apprtc-ws-2.webrtc.org:443',
./out/app_engine/constants.py-55- WSS_INSTANCE_NAME_KEY: 'wsserver-std-2',
./out/app_engine/constants.py-56- WSS_INSTANCE_ZONE_KEY: 'us-central1-f'
./out/app_engine/constants.py-57-}]
./out/app_engine/constants.py-58-
# 即是: 只保留一个 WSS_INSTANCES
WSS_INSTANCES = [{
#只修改 WSS_INSTANCE_HOST_KEY 对应的值为Collider 服务器的可访问地址,比如:apprtc.domain.com:8089 不需要协议,没有 URI。
WSS_INSTANCE_HOST_KEY: 'apprtc-ws.webrtc.org:443',
WSS_INSTANCE_NAME_KEY: 'wsserver-std',
WSS_INSTANCE_ZONE_KEY: 'us-central1-a'
}]

CEOD_KEY要和上面TURN REST API中的key相同
保存退出

3.
在apprtc文件夹下编译npm install和grunt build -force
在google_appengine文件夹下执行/dev_appserver.py
如果要外网访问,加上host和端口,如:./dev_appserver.py --host 121.40.28.178 --port 80 --admin_host 121.40.28.178 /root/apprtc/out/app_engine/
4. 参照上面的配置,在浏览器中打开http://121.40.28.178即可访问



---------------build-error---------------------------------------------
$sudo grunt build
grunt-cli: The grunt command line interface (v1.3.2)

Fatal error: Unable to find local grunt.

If you're seeing this message, grunt hasn't been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide:

https://gruntjs.com/getting-started


$ sudo grunt build
Running "shell:buildAppEnginePackage" (shell) task
Traceback (most recent call last):
File "./build/build_app_engine_package.py", line 12, in <module>
import requests
ImportError: No module named requests
Warning: Command failed: python ./build/build_app_engine_package.py src out/app_engine
Traceback (most recent call last):
File "./build/build_app_engine_package.py", line 12, in <module>
import requests
ImportError: No module named requests
Use --force to continue.

Aborted due to warnings.


sudo pip install requests

第四个 Server:ICE Server。

https://blog.piasy.com/2017/06/17/out-of-the-box-webrtc-dev-env/index.html

https://github.com/Piasy/WebRTC-Docker/blob/master/apprtc-server/constants.py

#将collider的源码软连接到go的工作目录下
https://github.com/webrtc/apprtc/blob/master/src/collider/README.md

  1. Open src/app_engine/constants.py and do the following:

    Collider

    这里的 8089 是服务端口 对外提供服务需要将 8089:tcp 映射出外网。

  • If using Google Cloud Engine VM’s for Collider
    • Change WSS_INSTANCE_HOST_KEY, WSS_INSTANCE_NAME_KEY and WSS_INSTANCE_ZONE_KEY to corresponding values for your VM instances which can be found in the Google Cloud Engine management console.
  • Else if using other VM hosting solution
    • Change WSS_INSTANCE_HOST_KEY to the hostname and port Collider is listening too, e.g. localhost:8089 or otherHost:443.
  1. a

  2. a

信令服务器(Collider Server)(代码包含在 apprtc代码内 apprtc/src/collider)

1
2
3
4
# 配置防火墙允许访问8089/tcp端口(用于客户端和collider建立websocket信令通信)

# 执行collider 信令服务器
sudo nohup $GOPATH/bin/collidermain -port=8089 -tls=false -room-server="http://0.0.0.0:8080" > sig.log 2>sigerr.log &

STUN\TURN服务器 coturn

https://github.com/coturn/coturn/blob/master/INSTALL
coturn->INSTALL->IV. OPENSSL
https://github.com/openssl/openssl
Configure TURN
OpenSSL vs FIPS enabled OpenSSL
OpenSSL 3.0 and FIPS Update

ubuntu 18.04 sudo apt install coturn

/etc/init.d/coturn (启动文件)

/etc/turnserver.conf (默认的配置文件,编译的话,默认是/usr/local/etc/turnserver.conf下)

/etc/default/coturn

1
2
3
4
5
6
cat /etc/default/coturn
#
# Uncomment it if you want to have the turnserver running as
# an automatic system service daemon
#
#TURNSERVER_ENABLED=1

/etc/logrotate.d/coturn (自定义文件)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
wget http://coturn.net/turnserver/v4.5.0.7/turnserver-4.5.0.7.tar.gz

sudo apt-get install libssl-dev
sudo apt-get install libevent-dev

# 返回webrtc目录
cd ~/webrtc
#git clone https://github.com/coturn/coturn.git
#cd coturn
#提供另一种安装方式turnserver是coturn的升级版本
wget http://coturn.net/turnserver/v4.5.0.7/turnserver-4.5.0.7.tar.gz
tar xfz turnserver-4.5.0.7.tar.gz
cd turnserver-4.5.0.7

# dependencies
# OpenSSL, SQLite, libevent2, PostgreSQL, MySQL (or MariaDB) and Hiredis
# libraries can be downloaded from their web sites:
- http://www.openssl.org (required);
- http://www.libevent.org (required);
- http://www.sqlite.org (optional);
- http://www.postgresql.org (optional);
- http://www.mysql.org (or http://mariadb.org) (optional);
- https://github.com/mongodb/mongo-c-driver (optional);
- http://redis.io (optional).



1) Download the OpenSSL version from openssl.org.
2) Let's assume that we want to install the "custom" OpenSSL into /opt.
Configure and build OpenSSL as:
$ ./config --prefix=/opt
$ make
$ make install
# coturn
./configure --prefix=/opt
make
sudo make install


sudo apt search libevent

src/client/ns_turn_msg.c:257:7: warning: implicit declaration of function ‘FIPS_mode’ [-Wimplicit-function-declaration]
if (FIPS_mode()) {
src/client/ns_turn_msg.c:257:7: warning: nested extern declaration of ‘FIPS_mode’ [-Wnested-externs]
/usr/bin/ld: warning: libssl.so.1.1, needed by /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libevent_openssl.so, may conflict with libssl.so.3
/usr/bin/ld: warning: libcrypto.so.1.1, needed by /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libevent_openssl.so, may conflict with libcrypto.so.3
/usr/bin/ld: /tmp/ccm8psVp.o: undefined reference to symbol 'FIPS_mode@@OPENSSL_1_1_0'
//usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:134: recipe for target 'bin/turnserver' failed
https://docs.nginx.com/nginx/fips-compliance-nginx-plus/
# ------------OPENSSL_1_1_0--FIPS mode not supported-------------------
# https://docs.nginx.com/nginx/fips-compliance-nginx-plus/

openssl$ ./config fips --prefix=/opt
Operating system: x86_64-whatever-linux2

Failure! build file wasn't produced.
Please read INSTALL.md and associated NOTES files. You may also have to
look over your available compiler tool chain or change your configuration.

FIPS mode not supported

# ----------------------------- # -----------------------------

https://gist.github.com/konklone/3e3a7072088a3352f3f6


sudo make install
install -d /usr/local
install -d /usr/local/bin
install -d /usr/local/var/db
install -d /usr/local/man/man1
install -d /usr/local/etc
install -d /usr/local/lib
install -d /usr/local/share/examples/turnserver
install -d /usr/local/share/doc/turnserver
install -d /usr/local/share/turnserver
install -d /usr/local/include/turn
install bin/turnserver /usr/local/bin
install bin/turnadmin /usr/local/bin
install bin/turnutils_uclient /usr/local/bin
install bin/turnutils_peer /usr/local/bin
install bin/turnutils_stunclient /usr/local/bin
install bin/turnutils_oauth /usr/local/bin
install bin/turnutils_natdiscovery /usr/local/bin
install man/man1/turnserver.1 /usr/local/man/man1/
install man/man1/turnadmin.1 /usr/local/man/man1/
install man/man1/turnutils.1 /usr/local/man/man1/
install man/man1/turnutils_uclient.1 /usr/local/man/man1/
install man/man1/turnutils_stunclient.1 /usr/local/man/man1/
install man/man1/turnutils_oauth.1 /usr/local/man/man1/
install man/man1/turnutils_natdiscovery.1 /usr/local/man/man1/
install man/man1/turnutils_peer.1 /usr/local/man/man1/
install man/man1/coturn.1 /usr/local/man/man1/
install lib/libturnclient.a /usr/local/lib
install LICENSE /usr/local/share/doc/turnserver
install README.turnserver /usr/local/share/doc/turnserver
install README.turnadmin /usr/local/share/doc/turnserver
install README.turnutils /usr/local/share/doc/turnserver
install INSTALL /usr/local/share/doc/turnserver
install postinstall.txt /usr/local/share/doc/turnserver
install turndb/schema.sql /usr/local/share/doc/turnserver
install turndb/schema.sql /usr/local/share/turnserver
install turndb/schema.mongo.sh /usr/local/share/doc/turnserver
install turndb/schema.mongo.sh /usr/local/share/turnserver
install turndb/testredisdbsetup.sh /usr/local/share/turnserver
install turndb/testmongosetup.sh /usr/local/share/turnserver
install turndb/testsqldbsetup.sql /usr/local/share/turnserver
install turndb/schema.userdb.redis /usr/local/share/doc/turnserver
install turndb/schema.userdb.redis /usr/local/share/turnserver
install turndb/schema.stats.redis /usr/local/share/doc/turnserver
install turndb/schema.stats.redis /usr/local/share/turnserver
if [ -f sqlite/turndb ] ; then install sqlite/turndb /usr/local/var/db/turndb; fi
install examples/etc/turnserver.conf /usr/local/etc/turnserver.conf.default
cp -rpf examples/etc /usr/local/share/examples/turnserver
cp -rpf examples/scripts /usr/local/share/examples/turnserver
rm -rf /usr/local/share/examples/turnserver/scripts/rfc5769.sh
cp -rpf include/turn/client /usr/local/include/turn
install include/turn/ns_turn_defs.h /usr/local/include/turn
cat /usr/local/share/doc/turnserver/postinstall.txt
==================================================================

1) If your system supports automatic start-up system daemon services,
then to enable the turnserver as a system service that is automatically
started, you have to:

a) Create and edit /etc/turnserver.conf or
/usr/local/etc/turnserver.conf .
Use /usr/local/etc/turnserver.conf.default as an example.

b) For user accounts settings: set up SQLite or PostgreSQL or
MySQL or MongoDB or Redis database for user accounts.
Use /usr/local/share/turnserver/schema.sql as SQL database schema,
or use /usr/local/share/turnserver/schema.userdb.redis as Redis
database schema description and/or
/usr/local/share/turnserver/schema.stats.redis
as Redis status & statistics database schema description.

If you are using SQLite, the default database location is in
/var/db/turndb or in /usr/local/var/db/turndb or in /var/lib/turn/turndb.

c) add whatever is necessary to enable start-up daemon for the
/usr/local/bin/turnserver.

2) If you do not want the turnserver to be a system service,
then you can start/stop it "manually", using the "turnserver"
executable with appropriate options (see the documentation).

3) To create database schema, use schema in file
/usr/local/share/turnserver/schema.sql.

4) For additional information, run:

$ man turnserver
$ man turnadmin
$ man turnutils

==================================================================


/usr/local/etc$ sudo cp turnserver.conf.default turnserver.conf
1
2
3
4
5
6


turnserver in /usr/local/ directory (or to whatever directory
was set in the PREFIX variable). You will have to copy
/usr/local/etc/turnserver.conf.default to /usr/local/etc/turnserver.conf file
and adjust your runtime configuration

https://www.red5pro.com/docs/server/turnstun.html

https://amryousef.me/android-webrtc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266

sudo apt-get update
$ sudo apt-get install coturn







# 可为 TURN 服务提供更安全的访问
stale-nonce

# SSL 需要用到的, 生成命令:
# sudo openssl req -x509 -newkey rsa:2048 -keyout /etc/turn_server_pkey.pem -out /etc/turn_server_cert.pem -days 99999 -nodes
cert=/etc/turn_server_cert.pem
pkey=/etc/turn_server_pkey.pem





diff turnserver.conf turnserver.conf.default
12c12
< listening-device=eno1
---
> #listening-device=eth0
60c60
< listening-ip=192.168.1.103
---
> #listening-ip=172.17.19.101
92c92
< relay-device=eno1
---
> #relay-device=eth1
157,158c157,158
< min-port=49152
< max-port=65535
---
> #min-port=49152
> #max-port=65535
162c162
< verbose
---
> #verbose
173c173 # WebRTC 的消息里会用到
< fingerprint
---
> #fingerprint
178c178 # WebRTC 的认证
< lt-cred-mech
---
> #lt-cred-mech
224c224 # REST API 认证需要

< use-auth-secret
---
> #use-auth-secret
232c232 # REST API 加密所需的 KEY
< static-auth-secret=north2202
---
> #static-auth-secret=north
346c346 # 用户登录域
< realm=myRealm
---
> #realm=mycompany.org
513c513
< log-file=/var/log/turn.log
---
> #log-file=/var/tmp/turn.log
523c523 # To enable single filename logs you need to enable the simple-log flag
< simple-log
---
> #simple-log
604c604 # 屏蔽 multicast IP地址的 relay
< no-multicast-peers
---
> #no-multicast-peers
637c637
< mobility
---
> #mobility
662c662
< no-cli
---
# 禁用本地 telnet cli 管理接口
no-cli
> #no-cli
723,724c723,724
< no-tlsv1
< no-tlsv1_1
---
> #no-tlsv1
> #no-tlsv1_1


sudo find /etc/ -iname "coturn" -type f
/etc/init.d/coturn
/etc/default/coturn
/etc/logrotate.d/coturn


$cat /etc/default/coturn
#
# Uncomment it if you want to have the turnserver running as
# an automatic system service daemon
#
#TURNSERVER_ENABLED=1


$ cat /etc/init.d/coturn
#!/bin/sh
### BEGIN INIT INFO
# Provides: coturn
# Required-Start: $network $local_fs $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: coturn TURN Server
# Description: STUN and TURN Relay Server for VoIP and WebRTC
### END INIT INFO

# Author: Oleg Moskalenko <mom040267@gmail.com>

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/usr/bin:/sbin:/usr/sbin:/bin
DESC=coturn # COTURN
NAME=coturn # TURN Server
PROCNAME=turnserver # Binary name
DAEMON=/usr/bin/turnserver
DAEMON_ARGS="-c /etc/turnserver.conf -o -v" # Arguments to run the daemon with
PIDFILE_DIR=/var/run
PIDFILE=/var/run/$PROCNAME.pid
SCRIPTNAME=/etc/init.d/$NAME
USER=turnserver
GROUP=turnserver

# Exit if the package is not installed
[ -x $DAEMON ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

if [ ! -d "$PIDFILE_DIR" ];then
mkdir -p "$PIDFILE_DIR"
chown $USER:$GROUP "$PIDFILE_DIR"
fi

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
}

#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name ${PROCNAME}
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}

#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $PROCNAME
return 0
}

case "$1" in
start)

if test "$TURNSERVER_ENABLED" = 1; then
log_daemon_msg "Starting $DESC " "$PROCNAME"
do_start
case "$?" in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
else
log_daemon_msg "${NAME} disabled in /etc/default/${NAME}" "${PROCNAME}"
log_end_msg 0
log_daemon_msg "See /etc/default/${NAME} for instructions on enabling" "${PROCNAME}"
log_end_msg 0
exit 0
fi
;;
stop)
log_daemon_msg "Stopping $DESC" "$PROCNAME"
do_stop
case "$?" in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$PROCNAME" && exit 0 || exit $?
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$PROCNAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac

exit 0
andrew@N8:~/cui/webrtcSetEnv/coturn$

To rotate the logs for coturn, install the following configuration file to /etc/logrotate.d/coturn

1
2
3
4
5
6
7
8
9
10
11
12
13

/var/log/coturn.log
{
rotate 30
daily
missingok
notifempty
delaycompress
compress
postrotate
systemctl kill -sHUP coturn.service
endscript
}

Required DNS EntryAnchor link for: required dns entry

You need to setup a fully qualified domain name that resolves to the external IP address of your turn server. You’ll used this domain name to generate a TLS certificate using Let’s Encrypt (next section).

On the coturn server, you need to have the following ports (in addition port 22) available for BigBlueButton clients to connect (port 3478 and 443) and for coturn to connect to your BigBlueButton server (49152 - 65535).

Ports Protocol Description
3478 TCP/UDP coturn listening port
443 TCP/UDP TLS listening port
49152-65535 UDP relay ports range

安装Nginx

注意安装的时候要带ssl

生成证书

1
2
3
4
5

# CA私钥
openssl genrsa -out key.pem 2048
# 自签名证书
openssl req -new -x509 -key key.pem -out cert.pem -days 1095
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18


upstream roomserver {
server 192.168.1.123:8080;
}
server {
listen 443 ssl;
ssl_certificate /cert/cert.pem;
ssl_certificate_key /cert/key.pem;
charset utf-8;
# ip地址或者域名
server_name 192.168.1.123;
location / {
# 转向代理的地址
proxy_pass http://roomserver$request_uri;
proxy_set_header Host $host;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

upstream websocket {
server 192.168.1.123:8089;
}

server {
listen 8088 ssl;
ssl_certificate /cert/cert.pem;
ssl_certificate_key /cert/key.pem;

server_name 192.168.1.123;
location /ws {
proxy_pass http://websocket;
proxy_http_version 1.1;
proxy_connect_timeout 4s;
proxy_read_timeout 6000s; #配置点2,如果没效,可以考虑这个时间配置长一点
proxy_send_timeout 6000s; #配置点3
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

# https://www.nginx.com/blog/websocket-nginx/
location /wsapp/ {
proxy_pass http://websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
}

How to Proxy WSS WebSockets with NGINX

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

sudo apt-get update
#安装依赖:gcc、g++依赖库
sudo apt-get install build-essential libtool
#安装 pcre依赖库(http://www.pcre.org/)
sudo apt-get install libpcre3 libpcre3-dev
#安装 zlib依赖库(http://www.zlib.net)
sudo apt-get install zlib1g-dev
#安装ssl依赖库
sudo apt-get install openssl


#下载nginx 1.15.8版本
wget http://nginx.org/download/nginx-1.15.8.tar.gz
tar xvzf nginx-1.15.8.tar.gz
cd nginx-1.15.8/


# 配置,一定要支持https
./configure --with-http_ssl_module

# 编译
make

#安装
sudo make install

启动服务

1
2


安装e2esoft vcam 虚拟摄像头

由于我本地是台式电脑,没有摄像头,另一方面,为了调试的方便,安装这个虚拟摄像头。

我是在这里下载的http://www.loveliao.com/downfiles/VCam_v4.5.exe

ubuntu https://github.com/umlaeute/v4l2loopback
git clone https://github.com/umlaeute/v4l2loopback.git
1st make && sudo make instal
2nd sudo depmod -a
3rd sudo modprobe v4l2loopback
4th sudo apt install v4l-utils
sudo modprobe v4l2loopback exclusive_caps=1
1
2
3
4

$sudo v4l2-ctl --list-devices
Dummy video device (0x0000) (platform:v4l2loopback-000):
/dev/video0

OPTIONS https://github.com/umlaeute/v4l2loopback

if you need several independent loopback devices, you can pass the “devices” option, when loading the module; e.g.

1
# modprobe v4l2loopback devices=4

will give you 4 loopback devices (e.g. /dev/video1/dev/video5)

you can also specify the device IDs manually; e.g.

1
# modprobe v4l2loopback video_nr=3,4,7

will create 3 devices (/dev/video3, /dev/video4 & /dev/video7)

1
# modprobe v4l2loopback video_nr=3,4,7 card_label="device number 3","the number four","the last one"

will create 3 devices with the card names passed as the second parameter:

  • /dev/video3 -> device number 3
  • /dev/video4 -> the number four
  • /dev/video7 -> the last one

if you encounter problems detecting your device with Chrome/WebRTC you can try ‘exclusive_caps’ mode:

1
# modprobe v4l2loopback exclusive_caps=1

will enable ‘exclusive_caps’ mode that only reports CAPTURE/OUTPUT capabilities exclusively. the newly created device will announce OUTPUT capabilities only (so ordinary webcam applications (including Chrome) won’t see it). as soon as you have attached a producer to the device, it will start announcing CAPTURE capabilities only (so applications that refuse to open devices that have other capabilities apart from capturing can open it too.)

install chrome on ubuntu 18.04

https://linuxize.com/post/how-to-install-google-chrome-web-browser-on-ubuntu-18-04/

1
2
3

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb

❌错误信息

1
2
3
4
5
6
7
8
9
10
11
12
13
Request: 
Http Reqest Room :8080 webpage
GET /room HTTP/1.1
Host: a.b.com # 反向代理

Response:
Request host is not whitelist enabled for this server. Please use the --host command-line flag to whitelist a specific host (recommended) or use --enable_host_checking to disable host checking. See the command-line flags help text for more information.


$ dev_appserver.py --help |grep check
--enable_host_checking [ENABLE_HOST_CHECKING]
determines whether to enforce HTTP Host checking for
host checking protects against DNS rebinding attacks

https://cloud.google.com/appengine/docs/standard/python/release-notes

December 05, 2017

Python runtime notes

  • Updated Python SDK to version 1.9.64.

  • For all incoming HTTP requests, dev_appserver.py now requires that all HTTP requests must have an HTTP Host header and its value is either localhost, an IPv4 or IPv6 loopback address, or if specified, the value passed in via --host. For HTTP/1.0 only, requests with no Host header are still allowed. To disable host checking, set the --enable_host_checking flag to false. However, it is strongly recommended to leave host checking enabled, as it guards against DNS rebinding attacks.

  • Introduced additional security-header related behavior to the

1
dev_appserver.py

admin console:

  • Inbound requests containing an Origin header are rejected.
  • Added the following headers to all responses:
    • X-Frame-Options=SAMEORIGIN
    • X-XSS-Protection=1; mode=block
    • Content-Security-Policy=default-src 'self'; frame-ancestors 'none'

浏览器通话跨域问题 :pushState

https://github.com/ISBX/apprtc-node-server/issues/7

https://github.com/webrtc/apprtc/issues/309

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Messages:
Failed to start signaling: Failed to execute 'pushState' on 'History': A history state object with URL 'http://a.abc.com/r/961479685' cannot be created in a document with origin 'https://a.abc.com:12345' and URL 'https://a.abc.com:12345/'.

Version:
branch: master
gitHash: 09411754b4fde46f86fa16057c114ff2ff25cb06
time: Tue Jan 21 10:12:29 2020 +0000




$ grep -nrI "displaySharingInfo_" apprtc/

apprtc/src/web_app/js/appcontroller.js:180: this.call_.oncallerstarted = this.displaySharingInfo_.bind(this);
apprtc/src/web_app/js/appcontroller.js:445:AppController.prototype.displaySharingInfo_ = function(roomId, roomLink)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

States:
Signaling: have-local-offer
Gathering: complete
Connection: new
Local: host:1
Remote:

Stats:
Call time: 00:37
Setup time: 0 ms

Messages:
Error getting user media: Failed to execute 'getUserMedia' on 'MediaDevices': At least one of audio and video must be requested
getUserMedia error: Failed to get access to local media. Error name was TypeError. Continuing without sending a stream.

Version:
branch: master
gitHash: 09411754b4fde46f86fa16057c114ff2ff

http://www.lidetao.com/base-webrtc-apprtc.html

How to use TURN_SERVER_OVERRIDE config in AppRTC-Android client? #456

ios App 开发环境搭建

原生开发 http://webrtc.github.io/webrtc-org/native-code/development/
ios App开发 http://webrtc.github.io/webrtc-org/native-code/ios/
预安装的软件 http://webrtc.github.io/webrtc-org/native-code/development/prerequisite-sw/
$ export PATH=/path/to/depot_tools:$PATH

SETTING UP

GET DEPOT TOOLS

LINUX / MAC

Clone the depot_tools repository:

1
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

Add depot_tools to the front of your PATH (you will probably want to put this in your ~/.bashrc or ~/.zshrc). Assuming you cloned depot_tools to /path/to/depot_tools:

1
$ export PATH=/path/to/depot_tools:$PATH

WINDOWS

Download the depot_tools bundle and extract it somewhere.

Warning DO NOT use drag-n-drop or copy-n-paste extract from Explorer, this will not extract the hidden “.git” folder which is necessary for depot_tools to autoupdate itself. You can use “Extract all…” from the context menu though.

Add depot_tools to the front of your PATH (must be ahead of any installs of Python). Assuming you unzipped the bundle to C:\workspace\depot_tools:

  • With Administrator access:

    Control Panel → System and Security → System → Advanced system settingsModify the PATH system variable to include C:\workspace\depot_tools.

  • Without Administrator access:

    Control Panel → User Accounts → User Accounts → Change my environment variablesAdd a PATH user variable: C:\workspace\depot_tools;%PATH%.

From a cmd.exe shell, run the command gclient (without arguments). On first run, gclient will install all the Windows-specific bits needed to work with the code, including msysgit and python.

Note If you run gclient from a non-cmd shell (e.g., cygwin, PowerShell), it may appear to run properly, but msysgit, python, and other tools may not get installed correctly.If you see strange errors with the file system on the first run of gclient, you may want to disable Windows Indexing.After running gclient open a command prompt and type where python and confirm that the depot_tools python.bat comes ahead of any copies of python.exe. Failing to ensure this can lead to overbuilding when using gn - see crbug.com/611087.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# 创建新目录
# 1st
$ fetch --nohooks webrtc_ios
Running: gclient root
Warning: Running gclient on Python 3.
If you encounter any issues, please file a bug on crbug.com under the Infra>SDK component.
WARNING: Your metrics.cfg file was invalid or nonexistent. A new one will be created.
Running: gclient config --spec 'solutions = [
{
"name": "src",
"url": "https://webrtc.googlesource.com/src.git",
"deps_file": "DEPS",
"managed": False,
"custom_deps": {},
},
]
target_os = ["ios", "mac"]
'
Warning: Running gclient on Python 3.
If you encounter any issues, please file a bug on crbug.com under the Infra>SDK component.
Running: gclient sync --nohooks --with_branch_heads
Warning: Running gclient on Python 3.
If you encounter any issues, please file a bug on crbug.com under the Infra>SDK component.

________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://webrtc.googlesource.com/src.git /Users/whoami/github/myWebRTC/_gclient_src__a4lopbz' in '/Users/whoami/github/myWebRTC'
Cloning into '/Users/whoami/github/myWebRTC/_gclient_src__a4lopbz'...
remote: Sending approximately 275.98 MiB ...
remote: Total 355662 (delta 268284), reused 355662 (delta 268284)
Receiving objects: 100% (355662/355662), 275.88 MiB | 2.99 MiB/s, done.
Resolving deltas: 100% (268284/268284), done.

$ du -sh .
11G .

$ll -a
total 24
drwxr-xr-x 6 whoami staff 192B Jun 8 18:41 .
drwxr-xr-x 174 whoami staff 5.4K Jun 8 17:23 ..
drwxr-xr-x 5 whoami staff 160B Jun 8 18:41 .cipd
-rw-r--r-- 1 whoami staff 195B Jun 8 17:25 .gclient
-rw-r--r-- 1 whoami staff 5.8K Jun 8 18:41 .gclient_entries
drwxr-xr-x 63 whoami staff 2.0K Jun 8 18:07 src

# 2nd step
$ gclient sync

$ cd src
$git checkout master
$git new-branch your-branch-name

# Generating project files
$ gn gen out/Aios64 --args='target_os="ios" target_cpu="arm64”'
Done. Made 1173 targets from 237 files in 1881ms

$ cd out/Aios64
~/github/myWebRTC/src/out/Aios64 on  whoami ⌚ 12:02:43
$ ll
total 1040
-rw-r--r-- 1 whoami staff 53B Jun 9 12:01 args.gn
-rw-r--r-- 1 whoami staff 249K Jun 9 12:01 build.ninja
-rw-r--r-- 1 whoami staff 9.0K Jun 9 12:01 build.ninja.d
-rw-r--r-- 1 whoami staff 2.3K Jun 9 12:01 low_bandwidth_audio_perf_test.runtime_deps
drwx------ 34 whoami staff 1.1K Jun 9 12:01 obj
-rw-r--r-- 1 whoami staff 246K Jun 9 12:01 toolchain.ninja

#### Compiling with ninja
# To see a list of available targets, run gn ls out/<output folder
# To compile, just run ninja on the appropriate target.
# $gn ls out out/Aios64
$gn ls out/Aios64 |grep -i apprtc
//examples:AppRTCMobile
//examples:AppRTCMobile_executable
//examples:AppRTCMobile_executable_bundle_data
//examples:AppRTCMobile_info_plist
//examples:AppRTCMobile_info_plist_bundle_data
//examples:AppRTCMobile_info_plist_merge
//examples:AppRTCMobile_lib
//examples:AppRTCMobile_pkg_info
//examples:AppRTCMobile_pkg_info_bundle_data
//examples:apprtc_common
//examples:apprtc_signaling

$ ninja --help
usage: ninja [options] [targets...]

if targets are unspecified, builds the 'default' target (see manual).

options:
--version print ninja version ("1.8.2")

-C DIR change to DIR before doing anything else
-f FILE specify input build file [default=build.ninja]

-j N run N jobs in parallel [default=10, derived from CPUs available]
-k N keep going until N jobs fail [default=1]
-l N do not start new jobs if the load average is greater than N
-n dry run (don't run commands but act like they succeeded)
-v show all command lines while building

-d MODE enable debugging (use -d list to list modes)
-t TOOL run a subtool (use -t list to list subtools)
terminates toplevel options; further flags are passed to the tool
-w FLAG adjust warnings (use -w list to list warnings)

$ninja -C out/Aios64 AppRTCMobile


# Using Xcode

Generating an Xcode project

To have GN generate Xcode project files, pass the argument --ide=xcode when running gn gen. This will result in a file named all.xcworkspace placed in your specified output directory.

Example:


$ gn gen out/ios --args='target_os="ios" target_cpu="arm64"' --ide=xcode
Generating Xcode projects took 159ms
Done. Made 1535 targets from 225 files in 3102ms

$gn gen out/ios --args='target_os="ios" target_cpu="arm64"' --ide=xcode
#原因: 多证书,其中一个过期/吊销证书导致的
#解决: 删除过期/吊销的证书即可
ERROR at //build/config/ios/ios_sdk.gni:163:33: Script returned non-zero exit code.
ios_code_signing_identity = exec_script("find_signing_identity.py",
^----------
Current dir: /Users/whoami/github/myWebRTC/src/out/ios/
Command: python /Users/whoami/github/myWebRTC/src/build/config/ios/find_signing_identity.py --matching-pattern Apple Development
Returned 1 and printed out:

Automatic code signing identity selection was enabled but could not
find exactly one codesigning identity matching "Apple Development".

Check that the keychain is accessible and that there is exactly one
valid codesigning identity matching the pattern. Here is the parsed
output of `xcrun security find-identity -v -p codesigning`:

1) 76FD9*************************: "Apple Development: x (4EEZB*****)"
2) F09A2*************************: "Developer ID Application: x (69SZU*****)"
3) 4C392*************************: "Apple Development: x(2CV36*****)"
4) 70C1E*************************: "Apple Development: x (4EEZB*****)"
5) 780DB*************************: "iPhone Developer: x (2CV36*****)"
5 valid identities found

See //build/config/sysroot.gni:74:5: whence it was imported.
import("//build/config/ios/ios_sdk.gni")
^--------------------------------------
See //build/config/linux/pkg_config.gni:5:1: whence it was imported.
import("//build/config/sysroot.gni")
^----------------------------------
See //BUILD.gn:15:1: whence it was imported.
import("//build/config/linux/pkg_config.gni")
^-------------------------------------------





$open -a Xcode.app out/ios/all.xcworkspace
Compile and run with Xcode

# Compiling with Xcode is not supported! What we do instead is compile using a script that runs ninja from Xcode. This is done with a custom run script action in the build phases of the generated project. This script will simply call ninja as you would when building from the command line.

#This gives us access to the usual deployment/debugging workflow iOS developers are used to in Xcode, without sacrificing the build speed of Ninja



#### Deploying to Device
#NOTICE: To deploy to an iOS device you must have a valid signing identity set up. You can verify this by running:
$ xcrun security find-identity -v -p codesigning

If you don’t have a valid signing identity, you can still build for ARM, but you won’t be able to deploy your code to an iOS device. To do this, add the flag ios_enable_code_signing=false to the gn gen args when you generate the build files.

gn gen out/Aios64 –args=’target_os=”ios” target_cpu=”arm64”’

ninja -C out/Aios64 AppRTCMobile

$ ios-deploy -b AppRTCMobile.app

Download available profile, regenerate app, iOS-deploy ok.

修改 appid 为你自己的 appid

Com.google.AppRTCMobile为 我自己的appid com.ouid.AppRTCMobile

~/webrtc/webrtc_ios/src/webrtc/examples/objc/AppRTCMobile/ios/Info.plist

~/webrtc/webrtc_ios/src/webrtc/sdk/objc/Framework/Info.plist

1A6A172C-0EB8-4D3B-AE0F-0FAB544BC407
gn gen out/Aios64 –args=’target_os=”ios” target_cpu=”arm64”‘
55B1FBC4-387D-4BBE-BA52-2E8D9A56C362
ninja -C out/Aios64 AppRTCMobile
D5133157-6926-40E2-88E6-A6E1F91E078D
Xcode 快捷键 Shift + command +2 安装
F98E182C-9F71-47DD-BCAF-E2E5C889D0E6

$ ll

total 1256

drwxr-xr-x 24 whoami staff 816B 10 25 19:52 AppRTCMobile.app

drwxr-xr-x 8 whoami staff 272B 10 25 19:52 WebRTC.framework

-rw-r–r– 1 whoami staff 39B 10 25 18:52 args.gn

-rw-r–r– 1 whoami staff 190K 10 25 18:52 build.ninja

-rw-r–r– 1 whoami staff 8.9K 10 25 18:52 build.ninja.d

drwx—— 5 whoami staff 170B 10 25 19:50 clang_x64

drwxr-xr-x 3 whoami staff 102B 10 25 19:49 gen

drwx—— 6 whoami staff 204B 10 25 18:52 obj

drwxr-xr-x 3 whoami staff 102B 10 25 19:50 pyproto

-rw-r–r– 1 whoami staff 416K 10 25 18:52 toolchain.ninja

~/webrtc/webrtc_ios/src/out/Aios64 on  7aeabd081! ⌚ 20:15:31

$ tree AppRTCMobile.app

6 directories, 65 files

$Cd ~/webrtc/webrtc_ios/src/out/Aios64

安装app到手机上

~/webrtc/webrtc_ios/src/out/Aios64 on  7aeabd081! ⌚ 20:29:20

$ ios-deploy -b AppRTCMobile.app

[….] Waiting for iOS device to be connected

[….] Using (N56AP, iPhone 6 Plus, iphoneos, arm64) a.k.a. ‘iPhone’.

—— Install phase ——

[ 95%] GeneratingApplicationMap

[100%] Installed package AppRTCMobile.app

即使没有ios developer program 也可以在真机上跑

0D6E1E6F-1677-4CC4-BE76-0870E7EC28E1
71947ADD-222C-446E-8C4D-AE0A1656469C
生成一个project, 随便填写appid (orgnation + productioName), xcode 会自动(Generation->check autogenerate option)帮你生成appid, 在webrtc/src下修改 Info.plist 的id,为自己的前面生成的appid,(注意保持唯一性)
0F6B0BF2-B074-45B6-9BFA-5A4129B77679

编译webrtc框架 WebRTC.framework Using WebRTC in your app

Refer: http://webrtc.github.io/webrtc-org/native-code/ios/

To build WebRTC for use in a native iOS app, it’s easiest to build WebRTC.framework. This can be done with ninja as follows, replacing ios with the actual location of your generated build files.

1
ninja -C out/ios framework_objc

This should result in a .framework bundle being generated in out/ios. This bundle can now be directly included in another app.

If you need a FAT .framework, that is, a binary that contains code for multiple architectures, and will work both on device and in the simulator, a script is available here

To build the framework with bitcode support, pass the --bitcode flag to the script like so

1
python build_ios_libs.py --bitcode

The resulting framework can be found in out_ios_libs/.

Please note that you can not ship the FAT framework binary with your app if you intend to distribute it through the app store. To solve this either remove “x86-64” from the list of architectures in the build script or split the binary and recreate it without x86-64. For instructions on how to do this see here

ios App http://webrtc.github.io/webrtc-org/native-code/ios/
https://webrtc.googlesource.com/src
fetch –nohooks webrtc_ios vs git clone https://webrtc.googlesource.com/src
image-20200608221754925

gdi capture

1
2
3
4
5
6
7
8
9
// Set up a timer to give me a frame rate / basic update time. seperate from WM_PAINT
TIMESYS_t dwTimeWaitMS = 1000 / 60; //60fps
m_uTimerId = ::SetTimer( m_hWnd, IDT_TIMER, dwTimeWaitMS, NULL );

window proc handle timer GDI.OnTimer(放重入)
window proc WM_PAINT GDI.OnTimer (防重入)

// 重中之中
HRESULT CTaksiGAPI_GDI::GetFrame( CVideoFrame& frame, bool bHalfSize )
1
2
3
4
5
6
7
8
9

HRESULT CTaksiGAPI_GDI::HookFunctions()
{
// we should capture WM_PAINT + periodic

// we should capture WM_PAINT + periodic
// ONLY CALLED FROM AttachGAPI()
// RETURN:
// S_FALSE = wont hook but not an error.

webrtc 全平台编译指南

webrtc所有平台下载编译步骤详细说明- 简书

webrtc mac

[WebRTC 开发(五)编译与运行Mac 工程 Depth.Love Blog](https://depthlove.github.io/2019/10/18/webrtc-development-5-run-mac-project/)
WebRTC iOS&OSX 库的编译
下载WebRTC最新源码并编译动态库
https://raw.githubusercontent.com/barry-ran/learn-webrtc/master/build_for_mac.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
export GYP_DEFINES="OS=mac"
fetch --nohooks webrtc_ios
gclient sync




gn gen out/Debug-mac --args='target_os="mac" target_cpu="x64" is_component_build=false'

gn gen out/mac --args='target_os="mac" target_cpu="x64"' --ide=xcode

gn gen out/Debug --ide=xcode --args='is_debug=true' --mac_deployment_target=10.10 --rtc_include_tests=true
gn gen out/Release --ide=xcode --args='is_debug=false' --mac_deployment_target=10.10 --rtc_include_tests=true



for i in `find /Users/zf/webrtc1128/webrtc-checkout/src/out_ios32 -name "lib*.a"`
do
echo $i
cp $i ./out_ios32/
done
libtool -static -v -o out_ios32/libwebrtc32.a out_ios32/*.a
strip -S -X out_ios32/libwebrtc32.a
for i in `find /Users/zf/webrtc1128/webrtc-checkout/src/out_ios64 -name "lib*.a"`
do
echo $i
cp $i ./out_ios64/
done
libtool -static -v -o out_ios64/libwebrtc64.a out_ios64/*.a
strip -S -X out_ios64/libwebrtc64.a

webrtc ios

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
export GYP_DEFINES="OS=ios"
fetch --nohooks webrtc_ios
gclient sync





gn gen out/ios --args='target_os="ios" target_cpu="arm64"' --ide=xcode


# target_os

- "android"
- "chromeos"
- "ios"
- "linux"
- "nacl"
- "mac"
- "win"

build_ios_libs.sh

1
2
3
4
5
6
7
8
9
10
11
12

~/github/webrtc_ios/src/tools_webrtc/ios on  choe! ⌚ 17:26:46
$ ll
total 88
-rw-r--r-- 1 choe staff 18B Jun 8 17:30 OWNERS
-rwxr-xr-x 1 choe staff 8.2K Jun 8 17:30 build_ios_libs.py
-rwxr-xr-x 1 choe staff 563B Jun 8 17:30 build_ios_libs.sh
-rw-r--r-- 1 choe staff 1.1K Jun 8 17:30 generate_modulemap.py
-rw-r--r-- 1 choe staff 1.5K Jun 8 17:30 generate_umbrella_header.py
-rwxr-xr-x 1 choe staff 4.1K Jun 8 17:30 merge_ios_libs.py
-rw-r--r-- 1 choe staff 495B Jun 8 17:30 no_op.cc
-rw-r--r-- 1 choe staff 764B Jun 8 17:30 objc_app.plis

webrtc on linux

1
2
3
4
5
6
7



export GYP_DEFINES="OS=linux"
fetch --nohooks webrtc_android
gclient sync
./build/install-build-deps.sh

webrtc on android

1
2
3
4
5

export GYP_DEFINES="OS=android"
fetch --nohooks webrtc_android
gclient sync
./build/install-build-deps.sh

windows 编译 webrtc

Windows编译运行webrtc全过程- 云中双月- 博客园
Windows平台WebRTC编译-VS2017 - 剑痴乎
webrtc windows编译+vs2017 - osc_c6q6fan2的个人空间 …
Building and Installing WebRTC on Windows
ssh + tar (windows10) 导致解压缩写文件失败 -> remote desktop + WSL + ubuntu + tar
win10 + cmd(admin mode) 编译成功
https://github.com/barry-ran/learn-webrtc
https://www.jianshu.com/p/351b29e36243
https://juejin.im/post/5e2126926fb9a02fdd3899b6

command line proxy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

set HTTP_PROXY=http://user:password@proxy.domain.com:port
set HTTPS_PROXY=http://user:password@proxy.domain.com:port

set HTTP_PROXY=http://127.0.0.1:8118
set HTTPS_PROXY=http://127.0.0.1:8118

# 验证 OK 1080(socks5)
set HTTP_PROXY=127.0.0.1:1080
set HTTPS_PROXY=127.0.0.1:1080


# 有问题 ???
set http_proxy=socks5://127.0.0.1:1080
set https_proxy=socks5://127.0.0.1:1080


git config –global http.proxy 'socks5://127.0.0.1:1080'
git config –global https.proxy 'socks5://127.0.0.1:1080'
set https_proxy=socks5://127.0.0.1:1080


https://www.cnblogs.com/hongdada/p/10787924.html
https://www.privoxy.org/user-manual/installation.html#INSTALLATION-PACK-WIN
  1. 下载depot-tools 设置到环境变量里面 (PATH)

    http://webrtc.github.io/webrtc-org/native-code/development/prerequisite-sw/

    https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up

    curl -O https://storage.googleapis.com/chrome-infra/depot_tools.zip

    WINDOWS

    Download the depot_tools bundle and extract it somewhere.

    Warning DO NOT use drag-n-drop or copy-n-paste extract from Explorer, this will not extract the hidden “.git” folder which is necessary for depot_tools to autoupdate itself. You can use “Extract all…” from the context menu though.

    Add depot_tools to the front of your PATH (must be ahead of any installs of Python). Assuming you unzipped the bundle to C:\workspace\depot_tools:

    • With Administrator access:

      Control Panel → System and Security → System → Advanced system settingsModify the PATH system variable to include C:\workspace\depot_tools.

    • Without Administrator access:

      Control Panel → User Accounts → User Accounts → Change my environment variablesAdd a PATH user variable: C:\workspace\depot_tools;%PATH%.

    From a cmd.exe shell, run the command gclient (without arguments). On first run, gclient will install all the Windows-specific bits needed to work with the code, including msysgit and python.

    Note If you run gclient from a non-cmd shell (e.g., cygwin, PowerShell), it may appear to run properly, but msysgit, python, and other tools may not get installed correctly.If you see strange errors with the file system on the first run of gclient, you may want to disable Windows Indexing.After running gclient open a command prompt and type where python and confirm that the depot_tools python.bat comes ahead of any copies of python.exe. Failing to ensure this can lead to overbuilding when using gn - see crbug.com/611087.
    1
    2
    3
    4
    5
    6
    7
    8
    depot_tools>where python
    C:\Users\juyun\AppData\Local\Microsoft\WindowsApps\python.exe
    # 第一次运行 gclient
    c:\webrt>gclient
    # 检测
    c:\webrtc>where python
    C:\webrtc\depot_tools\python.bat
    C:\Users\juyun\AppData\Local\Microsoft\WindowsApps\python.exe
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    # 第一次运行 gclient
    c:\cui\depot_tools>gclient
    Downloading CIPD client for windows-amd64 from https://chrome-infra-packages.appspot.com/client?platform=windows-amd64&version=git_revision:0323cbe1ef467af36aa6784f2315c5ee36e89e34...
    Failed to download the file, check your network connection
    所在位置 C:\cui\depot_tools\.cipd_impl.ps1:116 字符: 5
    + throw "Failed to download the file, check your network connection ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (Failed to downl...work connection:String) [], RuntimeException
    + FullyQualifiedErrorId : Failed to download the file, check your network connection

    Failed to bootstrap or update CIPD client
    Error updating depot_tools, no revision tool found.

    c:\cui\depot_tools>gclient
    Downloading CIPD client for windows-amd64 from https://chrome-infra-packages.appspot.com/client?platform=windows-amd64&version=git_revision:0323cbe1ef467af36aa6784f2315c5ee36e89e34...
    Warning: Running gclient on Python 3.
    If you encounter any issues, please file a bug on crbug.com under the Infra>SDK component.
    WARNING: Your metrics.cfg file was invalid or nonexistent. A new one will be created.
    Usage: gclient.py <command> [options]

    Meta checkout dependency manager for Git.

    Commands are:
    config creates a .gclient file in the current directory
    diff displays local diff for every dependencies
    fetch fetches upstream commits for all modules
    。。。。。。。。。。。
  1. 安装完VS 2019, VC 2019 + win10 SDK 10.0.19041.0

  2. cmd设置环境变量

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
   cmd设置临时环境变量:
#ninja Build https://chromium.googlesource.com/chromium/src/+/56.0.2886.1/docs/ninja_build.md

#export GYP_DEFINES="OS=win"

set DEPOT_TOOLS_UPDATE=0 #不更新depot_tools

set DEPOT_TOOLS_WIN_TOOLCHAIN=0
set GYP_GENERATORS=msvs-ninja,ninja

######skip begin######
mkdir webrtc-checkout
cd webrtc-checkout
fetch --nohooks webrtc #获取代码VPN
######skip end######

gclient sync --force
cd src
gn gen out/Default --ide=vs2019
ninja -C out/Default



####################可能不需要的################################

set GYP_MSVS_VERSION=2019
set GYP_MSVS_OVERRIDE_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
set GYP_GENERATORS=msvs-ninja,ninja
set WINDOWSSDKDIR="C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10"
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
#也可以直接设置环境变量,告诉depot_tools使用我们本机的VS进行编译。
######skip begin######
mkdir webrtc-checkout
cd webrtc-checkout
fetch --nohooks webrtc #获取代码VPN
######skip end######

gclient sync

cd src
gn gen out/Default --ide=vs2019
gn.py: Could not find gn executable at: c:\webrtc\webrtcNative\src\buildtools\win\gn.exe

Exception: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"\VC\vcvarsall.bat is missing
实际情况是:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat
# -------------------------------------------
Toolchain is out of date. Run "gclient runhooks" to update the toolchain, or set DEPOT_TOOLS_WIN_TOOLCHAIN=0 to use the locally installed toolchain.
#####





ninja -C out/Default


编译支持h264:

gn gen out/Debug_h264_ffmpeg --args="is_component_build=false rtc_use_h264=true proprietary_codecs=true is_component_ffmpeg=true ffmpeg_branding=\"Chrome\"" --ide=vs2019
ninja -C out/Debug_h264_ffmpeg

gn gen out/Debug_h264 --args="is_component_build=false rtc_use_h264=true proprietary_codecs=true ffmpeg_branding=\"Chrome\"" --ide=vs2019
ninja -C out/Debug_h264



生成debug版ninja:gn gen out/Default
生成release版ninja:gn gen out/Default --args='is_debug=false'
清空:gn clean out/Default


#####################编译############################################
c:\cui\webrtcNative\src>set DEPOT_TOOLS_WIN_TOOLCHAIN=0

c:\cui\webrtcNative\src>set GYP_GENERATORS=msvs-ninja,ninja

c:\cui\webrtcNative\src>gn gen out/Default --ide=vs2019
Generating Visual Studio projects took 9233ms
Done. Made 1106 targets from 234 files in 20037ms
c:\cui\webrtcNative\src>ninja -C out/Default
ninja: Entering directory `out/Default'
[5044/5044] STAMP obj/default.stamp
is_debug 是否是Debug版,默认true,false:表示编译Release版。
target_os 平台类型,可以取值win、mac ,android、ios、linux等
target_cpu cpu类型,Windows下可以取x86、x64
is_component_build 是否使用动态运行期库,这里取false,使用静态运行期库,Release版本将对应MT,Debug版将对应MTd。
proprietary_codecs 是否使用版权编码,也就是H264,这里取true。
rtc_use_h264 是否使用H264,这里取true,注意Windows平台编码使用OpenH264,解码使用ffmpeg。
ffmpeg_branding ffmpeg的分支名,这里采用Chrome的分支。
rtc_build_ssl 是否编译BoringSSL,这里取false,因为后面我们要替换成OpenSSL。
rtc_ssl_root OpenSSL的头文件路径,会被写到生成的ninja文件中。

gn help args可以查看args的帮助文件

gn args out/Debug_h264可以得到指定编译输出目录下的args配置文件

  1. bash

    1
    2
    3
    4
    5

    git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

    #或者:
    curl -O https://storage.googleapis.com/chrome-infra/depot_tools.zip

    eerconnection_client要有摄像头

gclient sync error:提示 “You have unstaged changes”

1
2
3
4
5
6
7
8
9
10
11
12
13
14

fetch --nohooks webrtc
gclient sync

Error: 6>
6> ____ src\third_party at af73a24f3376b1d85dd1ea541e12de76312f24db
6> You have unstaged changes.
6> Please commit, stash, or reset.

cd src\third_party
git config core.filemode false
git restore .
cd ../..
gclient sync
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# gclient sync 最后面会执行hook

c:\webrtc\webrtc>gclient sync
Warning: Running gclient on Python 3.
If you encounter any issues, please file a bug on crbug.com under the Infra>SDK component.
Syncing projects: 100% (41/41), done.
Hook 'vpython.bat src/build/landmines.py --landmine-scripts src/tools_webrtc/get_landmines.py --src-dir src' took 31.68 secs
Running hooks: 50% (11/22) clang
________ running 'vpython.bat src/tools/clang/scripts/update.py' in 'C:\webrtc\webrtc'
Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Win/clang-n358615-fb1aa286-2.tgz .......... Done.
Running hooks: 59% (13/22) clang_format_win
________ running 'download_from_google_storage --no_resume --platform=win32 --no_auth --bucket chromium-clang-format -s src/buildtools/win/clang-format.exe.sha1' in 'C:\webrtc\webrtc'
0> Downloading src/buildtools/win/clang-format.exe@d4afd4eba27022f5f6d518133aebde57281677c9...
Downloading 1 files took 202.988000 second(s)
NOTICE: You have PROXY values set in your environment, but gsutilin depot_tools does not (yet) obey them.
Also, --no_auth prevents the normal BOTO_CONFIG environmentvariable from being used.
To use a proxy in this situation, please supply those settingsin a .boto file pointed to by the NO_AUTH_BOTO_CONFIG environmentvariable.
Hook 'download_from_google_storage --no_resume --platform=win32 --no_auth --bucket chromium-clang-format -s src/buildtools/win/clang-format.exe.sha1' took 203.19 secs
Running hooks: 72% (16/22) rc_win
________ running 'vpython.bat src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang/rc -s src/build/toolchain/win/rc/win/rc.exe.sha1' in 'C:\webrtc\webrtc'
0> Downloading src/build/toolchain/win/rc/win/rc.exe@ba51d69039ffb88310b72b6568efa9f0de148f8f...
Downloading 1 files took 11.590000 second(s)
NOTICE: You have PROXY values set in your environment, but gsutilin depot_tools does not (yet) obey them.
Also, --no_auth prevents the normal BOTO_CONFIG environmentvariable from being used.
To use a proxy in this situation, please supply those settingsin a .boto file pointed to by the NO_AUTH_BOTO_CONFIG environmentvariable.
Hook 'vpython.bat src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang/rc -s src/build/toolchain/win/rc/win/rc.exe.sha1' took 12.28 secs
Running hooks: 86% (19/22) test_fonts
________ running 'download_from_google_storage --no_resume --extract --no_auth --bucket chromium-fonts -s src/third_party/test_fonts/test_fonts.tar.gz.sha1' in 'C:\webrtc\webrtc'
0> Downloading src/third_party/test_fonts/test_fonts.tar.gz@cd96fc55dc243f6c6f4cb63ad117cad6cd48dceb...
0> Extracting 33 entries from src/third_party/test_fonts/test_fonts.tar.gz to src/third_party/test_fonts/test_fonts
Downloading 1 files took 561.083000 second(s)
NOTICE: You have PROXY values set in your environment, but gsutilin depot_tools does not (yet) obey them.
Also, --no_auth prevents the normal BOTO_CONFIG environmentvariable from being used.
To use a proxy in this situation, please supply those settingsin a .boto file pointed to by the NO_AUTH_BOTO_CONFIG environmentvariable.
Hook 'download_from_google_storage --no_resume --extract --no_auth --bucket chromium-fonts -s src/third_party/test_fonts/test_fonts.tar.gz.sha1' took 561.30 secs
Running hooks: 100% (22/22)

gclient sync 可以多次执行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
c:\webrtc\webrtc>gclient sync
Warning: Running gclient on Python 3.
If you encounter any issues, please file a bug on crbug.com under the Infra>SDK component.
Syncing projects: 100% (41/41), done.
Running hooks: 59% (13/22) clang_format_win
________ running 'download_from_google_storage --no_resume --platform=win32 --no_auth --bucket chromium-clang-format -s src/buildtools/win/clang-format.exe.sha1' in 'C:\webrtc\webrtc'
NOTICE: You have PROXY values set in your environment, but gsutilin depot_tools does not (yet) obey them.
Also, --no_auth prevents the normal BOTO_CONFIG environmentvariable from being used.
To use a proxy in this situation, please supply those settingsin a .boto file pointed to by the NO_AUTH_BOTO_CONFIG environmentvariable.
Running hooks: 72% (16/22) rc_win
________ running 'vpython.bat src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-browser-clang/rc -s src/build/toolchain/win/rc/win/rc.exe.sha1' in 'C:\webrtc\webrtc'
NOTICE: You have PROXY values set in your environment, but gsutilin depot_tools does not (yet) obey them.
Also, --no_auth prevents the normal BOTO_CONFIG environmentvariable from being used.
To use a proxy in this situation, please supply those settingsin a .boto file pointed to by the NO_AUTH_BOTO_CONFIG environmentvariable.
Running hooks: 86% (19/22) test_fonts
________ running 'download_from_google_storage --no_resume --extract --no_auth --bucket chromium-fonts -s src/third_party/test_fonts/test_fonts.tar.gz.sha1' in 'C:\webrtc\webrtc'
NOTICE: You have PROXY values set in your environment, but gsutilin depot_tools does not (yet) obey them.
Also, --no_auth prevents the normal BOTO_CONFIG environmentvariable from being used.
To use a proxy in this situation, please supply those settingsin a .boto file pointed to by the NO_AUTH_BOTO_CONFIG environmentvariable.
Running hooks: 100% (22/22)
________ running 'download_from_google_storage --directory --recursive --num_threads=10 --no_auth --quiet --bucket chromium-webrtc-resources src/resources' in 'C:\webrtc\webrtc'
NOTICE: You have PROXY values set in your environment, but gsutilin depot_tools does not (yet) obey them.
Also, --no_auth prevents the normal BOTO_CONFIG environmentvariable from being used.
To use a proxy in this situation, please supply those settingsin a .boto file pointed to by the NO_AUTH_BOTO_CONFIG environmentvariable.
Running hooks: 100% (22/22), done.

user32.lib not foud

控制面板-》程序和功能 =〉vs 2019 右键菜单—》更改—〉check win10SDK 10.0.19041.0->修改

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
c:\webrtc\webrtc\src>gn gen out/Default --ide=vs2019
Traceback (most recent call last):
File "c:/webrtc/webrtc/src/build/toolchain/win/setup_toolchain.py", line 291, in <module>
Traceback (most recent call last):
File "c:/webrtc/webrtc/src/build/toolchain/win/setup_toolchain.py", line 291, in <module>
main()
File "c:/webrtc/webrtc/src/build/toolchain/win/setup_toolchain.py", line 244, in main
main()
vc_lib_um_path = FindFileInEnvList(env, 'LIB', ';', 'user32.lib')
File "c:/webrtc/webrtc/src/build/toolchain/win/setup_toolchain.py", line 244, in main
File "c:/webrtc/webrtc/src/build/toolchain/win/setup_toolchain.py", line 198, in FindFileInEnvList
vc_lib_um_path = FindFileInEnvList(env, 'LIB', ';', 'user32.lib')
file_name, env_name, '\n'.join(parts))
File "c:/webrtc/webrtc/src/build/toolchain/win/setup_toolchain.py", line 198, in FindFileInEnvList
AssertionError: ufile_name, env_name, '\n'.join(parts))
ser32.lib is not found in LIB:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\lib\x86
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x86
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x86
C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x86
C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x86

Check if it is installed.AssertionError
: user32.lib is not found in LIB:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\lib\x64
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64
C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64
C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64

Check if it is installed.
ERROR at //build/config/win/BUILD.gn:298:27: Script returned non-zero exit code.
vcvars_toolchain_data = exec_script("../../toolchain/win/setup_toolchain.py",
^----------
Current dir: c:/webrtc/webrtc/src/out/Default/
Command: C:/webrtc/depot_tools/bootstrap-3_8_0_chromium_8_bin/python/bin/python.exe c:/webrtc/webrtc/src/build/toolchain/win/setup_toolchain.py "C:\Program Files (x86)/Microsoft Visual Studio/2019/Community" "C:\Program Files (x86)\Windows Kits\10" "C:\WINDOWS\System32;C:\WINDOWS\SysWOW64;Arm64Unused" win x64 none
Returned 1.
See //build/config/BUILDCONFIG.gn:472:9: which caused the file to be included.

IDE options from https://gn.googlesource.com/gn/+/master/docs/reference.md

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
GN optionally generates files for IDE. Files won't be overwritten if their
contents don't change. Possibilities for <ide options>

--ide=<ide_name>
Generate files for an IDE. Currently supported values:
"eclipse" - Eclipse CDT settings file.
"vs" - Visual Studio project/solution files.
(default Visual Studio version: 2019)
"vs2013" - Visual Studio 2013 project/solution files.
"vs2015" - Visual Studio 2015 project/solution files.
"vs2017" - Visual Studio 2017 project/solution files.
"vs2019" - Visual Studio 2019 project/solution files.
"xcode" - Xcode workspace/solution files.
"qtcreator" - QtCreator project files.
"json" - JSON file containing target information

--filters=<path_prefixes>
Semicolon-separated list of label patterns used to limit the set of
generated projects (see "gn help label_pattern"). Only matching targets
and their dependencies will be included in the solution. Only used for
Visual Studio, Xcode and JSON.

windows webrtc+vs2019 成功编译

image-20200701113744176
image-20200701112330402
Exception: dbghelp.dll not found
c:\webrtc\webrtc\src>set DEPOT_TOOLS_WIN_TOOLCHAIN=0

c:\webrtc\webrtc\src>gn gen out/Default –ide=vs2019
Generating Visual Studio projects took 8700ms
Done. Made 1106 targets from 234 files in 18781ms
c:\cui\webrtcNative\src>echo %DEPOT_TOOLS_WIN_TOOLCHAIN%

c:\cui\webrtcNative\src>gn gen out/Default –ide=vs2019
Traceback (most recent call last):
File “c:/cui/webrtcNative/src/build/vs_toolchain.py”, line 578, in
sys.exit(main())
File “c:/cui/webrtcNative/src/build/vs_toolchain.py”, line 574, in main
return commandssys.argv[1]
File “c:/cui/webrtcNative/src/build/vs_toolchain.py”, line 389, in CopyDlls
_CopyDebugger(target_dir, target_cpu)
File “c:/cui/webrtcNative/src/build/vs_toolchain.py”, line 425, in _CopyDebugger
(debug_file, full_path))
Exception: dbghelp.dll not found in “C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbghelp.dll”
You must installWindows 10 SDK version 10.0.19041.0 including the “Debugging Tools for Windows” feature.
ERROR at //build/toolchain/win/BUILD.gn:49:3: Script returned non-zero exit code.
exec_script(“../../vs_toolchain.py”,
image-20200702185223589
image-20200702185108105

[TOC]

x #X

1
2
3
4
5
6
7
8
9
10
11
12
#define X(x) { x, #x },
struct WindowsMessage
{
int msgid;
char* pname;
} WindowsMessages[] =
{
X( WM_PAINT )
X( WM_NCPAINT )
...
};
#undef X