Skip to content

Commit

Permalink
Merge pull request #85 from OurEra/master
Browse files Browse the repository at this point in the history
Release for v5.2.2
  • Loading branch information
OurEra authored Jan 9, 2023
2 parents 3dba41b + 8282bfc commit 286ebcd
Show file tree
Hide file tree
Showing 22 changed files with 76 additions and 27 deletions.
4 changes: 2 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 30
versionCode 41
versionName "5.2.1"
versionCode 42
versionName "5.2.2"
buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
}

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private void checkToUploadCrashFiles() {
return;
}
for (File crashFile : crashFiles) {
if (crashFile.isFile()) {
if (crashFile.isFile() && crashFile.getName().contains("xcrash")) {
QNFileLogHelper.getInstance().reportLogFileByPath(crashFile.getPath(), new QNFileLogHelper.LogReportCallback() {
@Override
public void onReportSuccess(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class MainActivity extends AppCompatActivity {

private EditText mRoomEditText;
private ProgressDialog mProgressDialog;
private PermissionChecker mChecker;

private String mUserName;
private String mRoomName;
Expand All @@ -52,6 +53,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
EventBus.getDefault().registerSticky(this);
SharedPreferences preferences = getSharedPreferences(getString(R.string.app_name), Context.MODE_PRIVATE);
mUserName = preferences.getString(Config.USER_NAME, "");
mChecker = new PermissionChecker(this);
if ("".equals(mUserName)) {
Intent intent = new Intent(this, UserConfigActivity.class);
startActivityForResult(intent, USERNAME_REQUEST_CODE);
Expand Down Expand Up @@ -87,6 +89,12 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
}
}

@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] state) {
super.onRequestPermissionsResult(requestCode, permissions, state);
mChecker.onRequestPermissionsResult(requestCode, permissions, state);
}

public void onEvent(ProgressEvent progressEvent) {
mProgressDialog.setProgress(progressEvent.getProgress());
if (progressEvent.getProgress() == 100) {
Expand Down Expand Up @@ -254,11 +262,7 @@ private void goToDownload(String downloadUrl) {
}

private boolean isPermissionOK() {
PermissionChecker checker = new PermissionChecker(this);
boolean isPermissionOK = Build.VERSION.SDK_INT < Build.VERSION_CODES.M || checker.checkPermission();
if (!isPermissionOK) {
ToastUtils.showLongToast(this, "Some permissions is not approved !!!");
}
boolean isPermissionOK = Build.VERSION.SDK_INT < Build.VERSION_CODES.M || mChecker.checkPermission();
return isPermissionOK;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,12 @@ protected void onDestroy() {
}

private void destroyLocalTracks() {
for (QNLocalTrack localTrack : mLocalTrackList) {
localTrack.destroy();
if (mLocalTrackList != null) {
for (QNLocalTrack localTrack : mLocalTrackList) {
localTrack.destroy();
}
mLocalTrackList.clear();
}
mLocalTrackList.clear();
mCameraTrack = null;
mLocalScreenTrack = null;
mMicrophoneTrack = null;
Expand Down Expand Up @@ -493,7 +495,8 @@ public void onServiceConnected(ComponentName name, IBinder service) {
.setVideoEncoderConfig(new QNVideoEncoderConfig(mVideoWidth, mVideoHeight, mVideoFps, mVideoBitrate));
mLocalScreenTrack = QNRTC.createScreenVideoTrack(screenVideoTrackConfig);
mLocalTrackList.add(mLocalScreenTrack);
if (mClient.getConnectionState() == QNConnectionState.CONNECTED || mClient.getConnectionState() == QNConnectionState.RECONNECTED) {
if (mClient != null && (mClient.getConnectionState() == QNConnectionState.CONNECTED
|| mClient.getConnectionState() == QNConnectionState.RECONNECTED)) {
mClient.publish(mPublishResultCallback, Collections.singletonList(mLocalScreenTrack));
}
}
Expand Down Expand Up @@ -621,7 +624,9 @@ private void showKickoutDialog(final String userId) {
}
mKickOutDialog.setMessage(getString(R.string.kickout_tips, userId));
mKickOutDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.positive_dialog_tips), (dialog, which) -> {
mClient.sendMessage(Collections.singletonList(userId),CUSTOM_MESSAGE_KICKOUT,CUSTOM_MESSAGE_KICKOUT);
if (mClient != null) {
mClient.sendMessage(Collections.singletonList(userId),CUSTOM_MESSAGE_KICKOUT,CUSTOM_MESSAGE_KICKOUT);
}
});
mKickOutDialog.show();
}
Expand Down Expand Up @@ -862,12 +867,16 @@ public void onToggleDirectLiving() {
}
}
mCurrentDirectConfig.setUrl(String.format(getResources().getString(R.string.publish_url), mRoomId, mSerialNum));
mClient.startLiveStreaming(mCurrentDirectConfig);
if (mClient != null) {
mClient.startLiveStreaming(mCurrentDirectConfig);
}
} else {
mClient.stopLiveStreaming(mCurrentDirectConfig);
mIsDirectStreaming = false;
mControlFragment.updateDirectText(getString(R.string.direct_btn_text));
ToastUtils.showShortToast(RoomActivity.this, "已停止 id=" + mCurrentDirectConfig.getStreamID() + " 的单流转推!!!");
if (mClient != null) {
mClient.stopLiveStreaming(mCurrentDirectConfig);
mIsDirectStreaming = false;
mControlFragment.updateDirectText(getString(R.string.direct_btn_text));
ToastUtils.showShortToast(RoomActivity.this, "已停止 id=" + mCurrentDirectConfig.getStreamID() + " 的单流转推!!!");
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ public void onReportError(String name, String errorMsg) {
}
});
}
QNFileLogHelper.getInstance().init(this);
mLogFileNames = QNFileLogHelper.getInstance().getLogFiles();
if (mLogFileNames == null || mLogFileNames.size() == 0) {
ToastUtils.showShortToast(SettingActivity.this, "当前无可上报日志");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in
// all permissions granted
} else {
// some permissions denied
ToastUtils.showShortToast(mActivity, "some permissions denied");
ToastUtils.showShortToast(mActivity, "Some permissions is not approved !!!");
}
}
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified QNDroidRTCDemo/app/src/main/jniLibs/x86/libqndroid_rtc.so
Binary file not shown.
4 changes: 2 additions & 2 deletions QNRTC-API-Examples/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "com.qiniu.droid.rtc.api.examples"
minSdkVersion 18
targetSdkVersion 30
versionCode 3
versionName "1.0.2"
versionCode 4
versionName "1.0.3"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "long", "BUILD_TIMESTAMP", System.currentTimeMillis() + "L"
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,27 @@

public class MainActivity extends AppCompatActivity {

private PermissionChecker mChecker;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

mChecker = new PermissionChecker(this);
TextView appInfo = findViewById(R.id.app_info);
JSONObject roomInfo = Utils.parseRoomToken(Config.ROOM_TOKEN);
String userID = roomInfo.optString(Config.KEY_USER_ID);
String roomName = roomInfo.optString(Config.KEY_ROOM_NAME);
appInfo.setText(String.format(getString(R.string.app_info), userID, roomName, getSdkVersion(), getBuildTimeDescription()));
}

@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] state) {
super.onRequestPermissionsResult(requestCode, permissions, state);
mChecker.onRequestPermissionsResult(requestCode, permissions, state);
}

public void onClickScenes(View v) {
if (v.getId() != R.id.screen_microphone && !isPermissionOK()) {
return;
Expand Down Expand Up @@ -81,11 +90,7 @@ public void onClickScenes(View v) {
}

private boolean isPermissionOK() {
PermissionChecker checker = new PermissionChecker(this);
boolean isPermissionOK = Build.VERSION.SDK_INT < Build.VERSION_CODES.M || checker.checkPermission();
if (!isPermissionOK) {
Toast.makeText(this, "Some permissions is not approved !!!", Toast.LENGTH_SHORT).show();
}
boolean isPermissionOK = Build.VERSION.SDK_INT < Build.VERSION_CODES.M || mChecker.checkPermission();
return isPermissionOK;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in
// all permissions granted
} else {
// some permissions denied
//ToastUtils.s(mActivity, "some permissions denied");
ToastUtils.showShortToast(mActivity, "some permissions denied");
}
}
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified QNRTC-API-Examples/app/src/main/jniLibs/x86/libqndroid_rtc.so
Binary file not shown.
30 changes: 30 additions & 0 deletions ReleaseNotes/release-notes-5.2.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# QNDroidRTC Release Notes for 5.2.2

## 简介

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

## 版本

- 发布 qndroid-rtc-5.2.2.jar
- 更新 libqndroid_rtc.so

## 缺陷

- 修复在 armv7 架构手机上使用软件 AEC 时崩溃的问题
- 修复在重连失败再次加入房间后,离开房间会崩溃的问题
- 修复在观众角色时,无法回调本地网络质量信息的问题
- 修复采集分辨率和编码分辨率不一致,导致画面被裁剪的问题

## 优化

- 优化在 RTT 一定波动网络环境下视频卡顿的现象

## 注意事项
- 从 5.1.1 开始,视频默认使用软件编码。若有需要,可以通过 QNRTCSetting.setHWCodecEnabled() 修改
- 从 5.1.1 开始,取消对接口 QNTranscodingLiveStreamingConfig.setHoldLastFrame() 的支持
- 如果您使用的版本是 5.0.1+,将不再需要依赖 happy-dns 库

## 问题反馈

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

0 comments on commit 286ebcd

Please sign in to comment.