Skip to content

Commit

Permalink
Merge pull request #12 from jpxiong/master
Browse files Browse the repository at this point in the history
release v1.2.2
  • Loading branch information
jpxiong committed Jul 31, 2015
2 parents a8007db + 4e6dfa1 commit 6c22809
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 16 deletions.
2 changes: 1 addition & 1 deletion PLDroidCameraStreamingDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile files('libs/pldroid-camera-streaming-1.2.1.jar')
compile files('libs/pldroid-camera-streaming-1.2.2.jar')
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,26 @@ public void run() {
mCameraSwitchBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new Thread(new Runnable() {
@Override
public void run() {
mCameraStreamingManager.switchCamera();
}
}).start();
// new Thread(new Runnable() {
// @Override
// public void run() {
// mCameraStreamingManager.switchCamera();
// }
// }).start();
mHandler.removeCallbacks(mSwitcher);
mHandler.postDelayed(mSwitcher, 100);
}
});
}

private Switcher mSwitcher = new Switcher();
private class Switcher implements Runnable {
@Override
public void run() {
mCameraStreamingManager.switchCamera();
}
}

private void setTorchEnabled(final boolean enabled) {
runOnUiThread(new Runnable() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,27 @@ public class StreamingBaseActivity extends Activity implements CameraStreamingMa
public void handleMessage(Message msg) {
switch (msg.what) {
case MSG_UPDATE_SHUTTER_BUTTON_STATE:
mShutterButtonPressed = !mShutterButtonPressed;
mShutterButton.setPressed(mShutterButtonPressed);
if (mShutterButtonPressed) {
boolean res = mCameraStreamingManager.startStreaming();
Log.i(TAG, "res:" + res);
if (!res) {
mShutterButtonPressed = !mShutterButtonPressed;
mShutterButton.setPressed(mShutterButtonPressed);
}
if (!mShutterButtonPressed) {
new Thread(new Runnable() {
@Override
public void run() {
// disable the shutter button before startStreaming
setShutterButtonEnabled(false);
boolean res = mCameraStreamingManager.startStreaming();
mShutterButtonPressed = true;
Log.i(TAG, "res:" + res);
if (!res) {
mShutterButtonPressed = false;
setShutterButtonEnabled(true);
}
setShutterButtonPressed(mShutterButtonPressed);
}
}).start();
} else {
// disable the shutter button before stopStreaming
setShutterButtonEnabled(false);
mCameraStreamingManager.stopStreaming();
setShutterButtonPressed(false);
}
break;
default:
Expand Down Expand Up @@ -137,16 +147,23 @@ public void onStateChanged(final int state, Object extra) {
break;
case CameraStreamingManager.STATE.STREAMING:
mStatusMsgContent = getString(R.string.string_state_streaming);
setShutterButtonEnabled(true);
break;
case CameraStreamingManager.STATE.SHUTDOWN:
mStatusMsgContent = getString(R.string.string_state_ready);
setShutterButtonEnabled(true);
setShutterButtonPressed(false);
break;
case CameraStreamingManager.STATE.IOERROR:
mStatusMsgContent = getString(R.string.string_state_ready);
setShutterButtonEnabled(true);
break;
case CameraStreamingManager.STATE.NETBLOCKING:
mStatusMsgContent = getString(R.string.string_state_netblocking);
break;
case CameraStreamingManager.STATE.CONNECTION_TIMEOUT:
mStatusMsgContent = getString(R.string.string_state_con_timeout);
break;
case CameraStreamingManager.STATE.UNKNOWN:
mStatusMsgContent = getString(R.string.string_state_ready);
break;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<string name="string_state_connecting">CONNECTING</string>
<string name="string_state_streaming">STREAMING</string>
<string name="string_state_netblocking">NETBLOCKING, STOPPING</string>
<string name="string_state_con_timeout">CONNECTION TIMEOUT</string>
<string name="title_activity_audio_streaming">AudioStreamingActivity</string>

<string name="flash_light_on">ON</string>
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ mCameraStreamingManager.setStreamingStateListener(this);
- STATE.NETBLOCKING
- STATE.CAMERA_SWITCHED
- STATE.TORCH_INFO
- STATE.CONNECTION_TIMEOUT

>您需要注意的是,`onStateChanged` 回调函数可能被非 UI 线程调用,可参考 [CameraStreamingActivity][3]
Expand Down Expand Up @@ -274,6 +275,14 @@ mCameraStreamingManager.setNativeLoggingEnabled(false);
- FFMPEG

### 版本历史
* 1.2.2 ([Release Notes][10])
- 发布 pldroid-camera-streaming-1.2.2.jar
- 更新 libpldroid_ffmpegbridge.so
- 修复概率性的 crash 问题
- 添加 `STATE.CONNECTION_TIMEOUT` 状态
- 修复部分机型因连接错误而导致屏幕 Hang 住
- 在 UI 层对点击事件加入保护逻辑,避免快速点击导致应用 crash

* 1.2.1 ([Release Notes][9])
- 发布 pldroid-camera-streaming-1.2.1.jar
- 更新 libpldroid_ffmpegbridge.so
Expand Down Expand Up @@ -336,3 +345,4 @@ mCameraStreamingManager.setNativeLoggingEnabled(false);
[7]: /ReleaseNotes/release-notes-1.1.0.md
[8]: /ReleaseNotes/release-notes-1.2.0.md
[9]: /ReleaseNotes/release-notes-1.2.1.md
[10]: /ReleaseNotes/release-notes-1.2.2.md
16 changes: 16 additions & 0 deletions ReleaseNotes/release-notes-1.2.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# PLDroidCameraStreaming Release Notes for 1.2.2

## 简介
PLDroidCameraStreaming 是为 Android 开发者提供的 RTMP 直播推流 SDK

## 记录

### 推流 SDK
* 发布 pldroid-camera-streaming-1.2.2.jar
* 更新 libpldroid_ffmpegbridge.so
* 修复概率性的 crash 问题
* 添加 `STATE.CONNECTION_TIMEOUT` 状态:streaming 状态下,若网络断开或连接超时,该状态将会被回调
* 修复部分机型因连接错误而导致屏幕 Hang 住

### Demo
* 在 UI 层对点击事件加入保护逻辑,避免快速点击导致应用 crash
Binary file modified releases/armeabi-v7a/libpldroid_ffmpegbridge.so
Binary file not shown.
Binary file added releases/pldroid-camera-streaming-1.2.2.jar
Binary file not shown.

0 comments on commit 6c22809

Please sign in to comment.