This gist was moved to:
https://github.com/EXL/Stuff/tree/master/Examples/Linux-OpenGL-ES
| /** | |
| * 用AudioManager获取音频焦点避免音视频声音重叠问题 | |
| */ | |
| public class AudioFocusManager { | |
| private static final String TAG = "AudioFocusManager"; | |
| private Context mContext; | |
| private AudioManager mAudioManager; | |
| private AudioManager.OnAudioFocusChangeListener mAudioFocusChangeListener; |
This gist was moved to:
https://github.com/EXL/Stuff/tree/master/Examples/Linux-OpenGL-ES
| #include "logger.h" | |
| int DebugLevel = DEBUG_WARN; | |
| int main(void) | |
| { | |
| DBGPRINT(DEBUG_WARN, ("hello,debug=%s\n", "aaa")); | |
| return 0; | |
| } |
| #!/bin/bash | |
| rm -rf CMake* | |
| export NDK=/home/syoyo/local/android-ndk-r10e | |
| export SYSROOT=$NDK/platforms/android-21/arch-arm64 | |
| export CC="$NDK/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-gcc" | |
| export CXX="$NDK/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++" |
| #include <iostream> | |
| #include <locale> | |
| #include <string> | |
| #include "voe_base.h" | |
| #include "voe_codec.h" | |
| #include "voe_volume_control.h" | |
| #include "voe_dtmf.h" | |
| #include "voe_rtp_rtcp.h" | |
| #include "voe_audio_processing.h" |
| ---- | |
| Linux 基于策略的路由(Linux Policy Routing) | |
| Linux 有传统的基于数据包目的地址的路由算法,和新的基于策略的路由算法 | |
| 新算法优点:支持多个路由表,支持按数据报属性(源地址、目的地址、协议、端口、数据包大小、内容等)选择不同路由表 | |
| # 查看规则命令,后面可跟其它参数,默认为 show(list) 显示全部 | |
| ip rule |
| #!/bin/sh | |
| while : | |
| do | |
| dev=$(ip link | grep state | awk '{ sub(":", "", $2); print $2 }' | grep vpn) | |
| if [ $? -ne 0 ]; then | |
| sleep 5 | |
| continue | |
| fi | |
| break |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs