This article mainly introduces WEBRTC in each platform debug or log viewing mode, to facilitate troubleshooting, including Bs,pc,android,ios (this series of articles reproduced please indicate the source, blog Park rtc.blacker).
1, Browser development:
This development method does not need to download and compile WEBRTC source code (many people are "dead" here, but it is really troublesome, the reason is not to repeat), directly invoke the browser provided by the API,
Getting started is relatively simple (this doesn't mean that the effect is poor, the opposite is because the browser maker has done a lot of optimization for you, and many times the effect is much better than the one you're going to get).
The flaw in this way is that you can't modify the underlying code, and if you want to tweak some implementations or combine with an existing system, it's bad.
So if the problem is usually your own problems, the corresponding problem-checking method is Console.log and Wireshake tools.
2,android Development:
This part is I want to highlight, many unfamiliar NDK or Linux do not know how to look at the bottom of the log, in fact, through the logcat you can easily see the bottom of the output.
If you are using talk for development, refer to the following calling methods:
If you are not using Libjingle, you can refer to the Mediaengine.java call method:
Logging.java is implemented in JNI as follows:
The G_trace_callback is constructed because it is necessary to register a Callback,logcattracecontext implementation in its constructor as follows:
Oh ah, have done the NDK development, very familiar with __android_log_print this function bar.
At this point you may have questions about what to do if you want to view the log of the initialized Libjingle environment before calling the Logging.enabletracing () method.
Take a look at the implementation of the Webrtcvoiceengine constructor:
It registers the callback directly inside the constructor, and when WEBRTC needs to output log, it can execute its own defined callback directly.
This can be very good to control the output of the log, the design is very clever, than to see what the design mode of the theoretical books are worked.
Now you have a new question, what if you want to see the WEBRTC bottom log before calling the Logging.enabletracing () method?
The following code is my own (not the best solution), because WEBRTC at present is not perfect reason, the log is so complicated (historical reason is WEBRTC and talk is the back of the integration together), it is estimated that they will be more reasonable later, so I will do so first, hehe.
3,PC Development:
PC is basically with VS in development, very good debugging, can not only output the log to the console, you can also directly in the code breakpoints, or grab packets, means a lot, operation is not complicated.
4,ios Development:
Xcode is about the same as VS, it's convenient, no need to repeat.
Spit Groove A sentence, xcode,eclipse,virtual machine run together, the Mac is very laborious, the machines have to be upgraded, next month's credit card Oh, Alexander.
Android IOS WebRTC Audio Video Development Summary (17)