Skip to content

Commit

Permalink
Merge pull request #46 from Johnny1994/dev
Browse files Browse the repository at this point in the history
release v2.3.1
  • Loading branch information
KevinHuo authored Apr 8, 2020
2 parents 81bffc5 + e03f9f0 commit 8136ad2
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 7 deletions.
9 changes: 7 additions & 2 deletions QNDroidRTCDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "com.qiniu.droid.rtc.demo"
minSdkVersion 18
targetSdkVersion 28
versionCode 25
versionName "2.3.0"
versionCode 26
versionName "2.3.1"
buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
}

Expand All @@ -22,6 +22,11 @@ android {
disable 'GoogleAppIndexingWarning'
abortOnError false
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
Expand Down
Binary file removed QNDroidRTCDemo/app/libs/qndroid-rtc-2.3.0.jar
Binary file not shown.
Binary file added QNDroidRTCDemo/app/libs/qndroid-rtc-2.3.1.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ private void initQNRTCEngine() {
boolean isHwCodec = preferences.getInt(Config.CODEC_MODE, Config.HW) == Config.HW;
int videoBitrate = preferences.getInt(Config.BITRATE, DEFAULT_BITRATE[1]);
boolean isMaintainRes = preferences.getBoolean(Config.MAINTAIN_RES, false);
boolean isLowSampleRateEnabled = preferences.getInt(Config.SAMPLE_RATE, Config.HIGH_SAMPLE_RATE) == Config.LOW_SAMPLE_RATE;
boolean isAec3Enabled = preferences.getBoolean(Config.AEC3_ENABLE, false);
mCaptureMode = preferences.getInt(Config.CAPTURE_MODE, Config.CAMERA_CAPTURE);

// get the items in hw black list, and set isHwCodec false forcibly
Expand All @@ -196,6 +198,8 @@ private void initQNRTCEngine() {
.setHWCodecEnabled(isHwCodec)
.setMaintainResolution(isMaintainRes)
.setVideoBitrate(videoBitrate)
.setLowAudioSampleRateEnabled(isLowSampleRateEnabled)
.setAEC3Enabled(isAec3Enabled)
.setVideoEncodeFormat(format)
.setVideoPreviewFormat(format);
mEngine = QNRTCEngine.createEngine(getApplicationContext(), setting, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
import android.view.View;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Switch;
import android.widget.TextView;

import com.qiniu.droid.rtc.demo.BuildConfig;
Expand All @@ -39,15 +41,21 @@ public class SettingActivity extends AppCompatActivity {
private RadioGroup mCodecModeRadioGroup;
private RadioButton mHwCodecMode;
private RadioButton mSwCodecMode;
private RadioGroup mAudioSampleRateRadioGroup;
private RadioButton mLowSampleRateBtn;
private RadioButton mHighSampleRateBtn;
private RadioGroup mMaintainResRadioGroup;
private RadioButton mMaintainResolutionYes;
private RadioButton mMaintainResolutionNo;
private EditText mAppIdEditText;
private Switch mAec3Switch;

private int mSelectPos = 0;
private String mUserName;
private int mEncodeMode = 0;
private int mSampleRatePos = 0;
private boolean mMaintainResolution = false;
private boolean mIsAec3Enabled = false;
private List<String> mDefaultConfiguration = new ArrayList<>();
private ArrayAdapter<String> mAdapter;
private SpinnerPopupWindow mSpinnerPopupWindow;
Expand All @@ -67,13 +75,24 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
mCodecModeRadioGroup.setOnCheckedChangeListener(mOnCheckedChangeListener);
mHwCodecMode = (RadioButton) findViewById(R.id.hw_radio_button);
mSwCodecMode = (RadioButton) findViewById(R.id.sw_radio_button);
mAudioSampleRateRadioGroup = findViewById(R.id.sample_rate_button);
mAudioSampleRateRadioGroup.setOnCheckedChangeListener(mOnCheckedChangeListener);
mLowSampleRateBtn = findViewById(R.id.low_sample_rate_button);
mHighSampleRateBtn = findViewById(R.id.high_sample_rate_button);

mMaintainResRadioGroup = (RadioGroup) findViewById(R.id.maintain_resolution_button);
mMaintainResRadioGroup.setOnCheckedChangeListener(mOnMaintainResCheckedChangeListener);
mMaintainResolutionYes = (RadioButton) findViewById(R.id.maintain_res_button_yes);
mMaintainResolutionNo = (RadioButton) findViewById(R.id.maintain_res_button_no);

mAppIdEditText = (EditText) findViewById(R.id.app_id_edit_text);
mAec3Switch = findViewById(R.id.webrtc_aec3_enable_btn);
mAec3Switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mIsAec3Enabled = isChecked;
}
});

mVersionCodeTextView.setText(String.format(getString(R.string.version_code), getVersionDescription(), getBuildTimeDescription()));

Expand Down Expand Up @@ -103,13 +122,23 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
mSwCodecMode.setChecked(true);
}

int sampleRatePos = preferences.getInt(Config.SAMPLE_RATE, Config.HIGH_SAMPLE_RATE);
if (sampleRatePos == Config.LOW_SAMPLE_RATE) {
mLowSampleRateBtn.setChecked(true);
} else {
mHighSampleRateBtn.setChecked(true);
}

mMaintainResolution = preferences.getBoolean(Config.MAINTAIN_RES, false);
if (mMaintainResolution) {
mMaintainResolutionYes.setChecked(true);
} else {
mMaintainResolutionNo.setChecked(true);
}

mIsAec3Enabled = preferences.getBoolean(Config.AEC3_ENABLE, false);
mAec3Switch.setChecked(mIsAec3Enabled);

mSpinnerPopupWindow = new SpinnerPopupWindow(this);
mSpinnerPopupWindow.setOnSpinnerItemClickListener(mOnSpinnerItemClickListener);

Expand Down Expand Up @@ -144,7 +173,9 @@ public void onClickSaveConfiguration(View v) {

editor.putInt(Config.CONFIG_POS, mSelectPos);
editor.putInt(Config.CODEC_MODE, mEncodeMode);
editor.putInt(Config.SAMPLE_RATE, mSampleRatePos);
editor.putBoolean(Config.MAINTAIN_RES, mMaintainResolution);
editor.putBoolean(Config.AEC3_ENABLE, mIsAec3Enabled);

editor.putInt(Config.WIDTH, Config.DEFAULT_RESOLUTION[mSelectPos][0]);
editor.putInt(Config.HEIGHT, Config.DEFAULT_RESOLUTION[mSelectPos][1]);
Expand Down Expand Up @@ -234,6 +265,12 @@ public void onCheckedChanged(RadioGroup group, int checkedId) {
mEncodeMode = Config.SW;
mMaintainResRadioGroup.setVisibility(View.VISIBLE);
break;
case R.id.low_sample_rate_button:
mSampleRatePos = Config.LOW_SAMPLE_RATE;
break;
case R.id.high_sample_rate_button:
mSampleRatePos = Config.HIGH_SAMPLE_RATE;
break;
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ public class Config {
public static final String HEIGHT = "height";
public static final String FPS = "fps";
public static final String CODEC_MODE = "encodeMode";
public static final String SAMPLE_RATE = "sampleRate";
public static final String CAPTURE_MODE = "captureMode";
public static final String BITRATE = "bitrate";
public static final String MAINTAIN_RES = "maintainRes";
public static final String AEC3_ENABLE = "aec3Enable";

public static final int HW = 0;
public static final int SW = 1;
public static final int LOW_SAMPLE_RATE = 0;
public static final int HIGH_SAMPLE_RATE = 1;
public static final int CAMERA_CAPTURE = 0;
public static final int SCREEN_CAPTURE = 1;
public static final int ONLY_AUDIO_CAPTURE = 2;
Expand Down
49 changes: 46 additions & 3 deletions QNDroidRTCDemo/app/src/main/res/layout/activity_setting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,46 @@
android:textColor="@color/textColor" />
</RadioGroup>

<RadioGroup
android:id="@+id/sample_rate_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/maintain_resolution_button"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="15dp"
android:background="@drawable/oval_edit_text_background"
android:orientation="horizontal"
android:paddingBottom="2dp"
android:paddingEnd="15dp"
android:paddingStart="15dp"
android:paddingTop="2dp">

<RadioButton
android:id="@+id/low_sample_rate_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:shadowColor="@color/blue"
android:text="@string/low_sample_rate_string"
android:textColor="@color/textColor" />

<RadioButton
android:id="@+id/high_sample_rate_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/high_sample_rate_string"
android:textColor="@color/textColor" />
</RadioGroup>

<TextView
android:id="@+id/tips_capture_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignEnd="@id/user_name_edit_text"
android:layout_alignStart="@id/user_name_edit_text"
android:layout_below="@id/maintain_resolution_button"
android:layout_below="@id/sample_rate_button"
android:layout_marginTop="15dp"
android:paddingEnd="15dp"
android:paddingStart="15dp"
Expand All @@ -181,11 +214,21 @@
android:textColorHint="@color/textColor"
android:textSize="15sp" />

<Switch
android:id="@+id/webrtc_aec3_enable_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/app_id_edit_text"
android:layout_marginTop="16dp"
android:layout_marginLeft="45dp"
android:text="启用 AEC3"
android:textColor="@color/textColor"/>

<LinearLayout
android:id="@+id/test_mode_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/app_id_edit_text"
android:layout_below="@id/webrtc_aec3_enable_btn"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="16dp"
Expand Down Expand Up @@ -269,7 +312,7 @@
android:layout_below="@id/test_mode_layout"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="30dp"
android:layout_marginTop="24dp"
android:background="@drawable/oval_btn_background"
android:gravity="center"
android:onClick="onClickSaveConfiguration"
Expand Down
2 changes: 2 additions & 0 deletions QNDroidRTCDemo/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<string name="null_user_name_toast">昵称不能为空!!!</string>
<string name="codec_hw">硬编</string>
<string name="codec_sw">软编</string>
<string name="low_sample_rate_string">16K</string>
<string name="high_sample_rate_string">48K</string>
<string name="maintain_resolution_yes">分辨率固定</string>
<string name="maintain_resolution_no">分辨率自适应</string>
<string name="kicked_by_admin">您被管理员踢出房间!!!</string>
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ QNDroidRTC 是七牛云推出的一款适用于 Android 平台的实时音视频
- 支持截帧功能
- 支持采集分辨率与编码分辨率分别采用不同朝向
- 支持背景音乐混音功能
- 音频支持双声道
- 支持音频双声道
- 支持音量大小回调
- 支持自定义消息
- 支持合流背景图片的设置
- 支持音频低采样率的配置
- 支持音频软件 AEC 的配置

# 3 方案介绍

Expand Down Expand Up @@ -141,7 +144,7 @@ QNDroidRTC 是七牛云推出的一款适用于 Android 平台的实时音视频
## 8.1 如何体验 Demo?

您可以通过扫描下面的二维码,安装我们的 demo 应用『牛会议』,体验通话效果:<br>
![](http://pk0jd2tt5.bkt.clouddn.com/Android-qnsdk-rtc-demo.png)
![](http://docs.qnsdk.com/Android-qnsdk-rtc-demo.png)

## 8.2 实时通话功能是否收费?

Expand Down
23 changes: 23 additions & 0 deletions ReleaseNotes/release-notes-2.3.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# QNDroidRTC Release Notes for 2.3.1

## 简介

QNDroidRTC 是七牛推出的一款适用于 Android 平台的音视频通话 SDK,提供了包括美颜、滤镜、音视频通话等多种功能,提供灵活的接口,支持高度定制以及二次开发。

## 版本

- 发布 qndroid-rtc-2.3.1.jar

## 功能

- 支持合流背景图片的设置功能
- 支持音频低采样率的配置
- 支持音频软件 AEC 的配置

## 缺陷

- 修复设置水印无效的问题

## 问题反馈

当你遇到任何问题时,可以通过在 GitHub 的 repo 提交 `issues` 来反馈问题,请尽可能的描述清楚遇到的问题,如果有错误信息也一同附带,并且在 ```Labels``` 中指明类型为 bug 或者其他。 [通过这里查看已有的 issues 和提交 bug](https://github.com/pili-engineering/QNRTC-Android/issues)
Binary file removed releases/qndroid-rtc-2.3.0.jar
Binary file not shown.
Binary file added releases/qndroid-rtc-2.3.1.jar
Binary file not shown.

0 comments on commit 8136ad2

Please sign in to comment.