Skip to content

Commit

Permalink
Merge pull request #134 from jpxiong/master
Browse files Browse the repository at this point in the history
Release v1.6.1
  • Loading branch information
longbai committed May 24, 2016
2 parents c05d9c7 + 4c1b913 commit 75d317a
Show file tree
Hide file tree
Showing 45 changed files with 67 additions and 74 deletions.
2 changes: 1 addition & 1 deletion PLDroidCameraStreamingDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.qiniu:happy-dns:0.2.5'
compile 'com.android.support:appcompat-v7:22.0.0'
compile files('libs/pldroid-camera-streaming-1.6.0.jar')
compile files('libs/pldroid-camera-streaming-1.6.1.jar')
}
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
package com.pili.pldroid.streaming.camera.demo;

import android.content.Context;
import android.graphics.Bitmap;
import android.hardware.Camera;
import android.os.Build;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.pili.pldroid.streaming.CameraStreamingManager;
import com.pili.pldroid.streaming.CameraStreamingManager.EncodingType;
import com.pili.pldroid.streaming.CameraStreamingSetting;
import com.pili.pldroid.streaming.FrameCapturedCallback;
import com.pili.pldroid.streaming.StreamStatusCallback;
import com.pili.pldroid.streaming.StreamingProfile;
import com.pili.pldroid.streaming.SurfaceTextureCallback;
import com.pili.pldroid.streaming.camera.demo.gles.FBO;
import com.pili.pldroid.streaming.WatermarkSetting;
import com.pili.pldroid.streaming.widget.AspectFrameLayout;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Map;

/**
* Created by jerikc on 15/10/29.
Expand All @@ -45,9 +26,12 @@ protected void onCreate(Bundle savedInstanceState) {
(CameraPreviewFrameView) findViewById(R.id.cameraPreview_surfaceView);
cameraPreviewFrameView.setListener(this);

WatermarkSetting watermarksetting = new WatermarkSetting(this, R.drawable.qiniu_logo, WatermarkSetting.WATERMARK_LOCATION.SOUTH_WEST, 100);

mCameraStreamingManager = new CameraStreamingManager(this, afl, cameraPreviewFrameView,
EncodingType.HW_VIDEO_WITH_HW_AUDIO_CODEC); // hw codec
mCameraStreamingManager.prepare(mCameraStreamingSetting, mProfile);

mCameraStreamingManager.prepare(mCameraStreamingSetting, mMicrophoneStreamingSetting, watermarksetting, mProfile);

mCameraStreamingManager.setStreamingStateListener(this);
mCameraStreamingManager.setSurfaceTextureCallback(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ public void run() {
return;
}
intent.putExtra(Config.EXTRA_KEY_STREAM_JSON, resByHttp);
} else {
showToast("Stream Json Got Fail!");
}

startActivity(intent);
Expand All @@ -88,7 +86,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView mVersionInfoTextView = (TextView) findViewById(R.id.version_info);
mVersionInfoTextView.setText("v1.6.0");
mVersionInfoTextView.setText("v1.6.1");

Button mHWCodecCameraStreamingBtn = (Button) findViewById(R.id.hw_codec_camera_streaming_btn);
if (!isSupportHWEncode()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,55 +1,21 @@
package com.pili.pldroid.streaming.camera.demo;

import android.content.Context;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.hardware.Camera;
import android.opengl.GLSurfaceView;
import android.os.Build;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.pili.pldroid.streaming.CameraStreamingManager;
import com.pili.pldroid.streaming.CameraStreamingManager.EncodingType;
import com.pili.pldroid.streaming.CameraStreamingSetting;
import com.pili.pldroid.streaming.FrameCapturedCallback;
import com.pili.pldroid.streaming.MicrophoneStreamingSetting;
import com.pili.pldroid.streaming.StreamStatusCallback;
import com.pili.pldroid.streaming.StreamingPreviewCallback;
import com.pili.pldroid.streaming.StreamingProfile;
import com.pili.pldroid.streaming.StreamingProfile.StreamStatusConfig;
import com.pili.pldroid.streaming.StreamingProfile.StreamStatus;
import com.pili.pldroid.streaming.StreamingProfile.ENCODING_ORIENTATION;
import com.pili.pldroid.streaming.SurfaceTextureCallback;
import com.pili.pldroid.streaming.camera.demo.gles.FBO;
import com.pili.pldroid.streaming.camera.demo.ui.RotateLayout;
import com.pili.pldroid.streaming.WatermarkSetting;
import com.pili.pldroid.streaming.widget.AspectFrameLayout;
import com.qiniu.android.dns.DnsManager;
import com.qiniu.android.dns.IResolver;
import com.qiniu.android.dns.NetworkInfo;
import com.qiniu.android.dns.http.DnspodFree;
import com.qiniu.android.dns.local.AndroidDnsServer;
import com.qiniu.android.dns.local.Resolver;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.InetAddress;

/**
* Created by jerikc on 15/10/29.
*/
public class SWCodecCameraStreamingActivity extends StreamingBaseActivity {
private static final String TAG = "SWCodecCameraStreaming";


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -60,19 +26,21 @@ protected void onCreate(Bundle savedInstanceState) {
(CameraPreviewFrameView) findViewById(R.id.cameraPreview_surfaceView);
cameraPreviewFrameView.setListener(this);

WatermarkSetting watermarksetting = new WatermarkSetting(this, R.drawable.qiniu_logo, WatermarkSetting.WATERMARK_LOCATION.SOUTH_WEST, WatermarkSetting.WATERMARK_SIZE.MEDIUM, 100);

mCameraStreamingManager = new CameraStreamingManager(this, afl, cameraPreviewFrameView,
EncodingType.SW_VIDEO_WITH_SW_AUDIO_CODEC); // soft codec
mCameraStreamingManager.prepare(mCameraStreamingSetting, mMicrophoneStreamingSetting, mProfile);
EncodingType.SW_VIDEO_WITH_SW_AUDIO_CODEC); // sw codec

mCameraStreamingManager.prepare(mCameraStreamingSetting, mMicrophoneStreamingSetting, watermarksetting, mProfile);

mCameraStreamingManager.setStreamingStateListener(this);
mCameraStreamingManager.setStreamingPreviewCallback(this);
mCameraStreamingManager.setSurfaceTextureCallback(this);
mCameraStreamingManager.setStreamingSessionListener(this);
// mCameraStreamingManager.setNativeLoggingEnabled(false);
mCameraStreamingManager.setStreamStatusCallback(this);

// update the StreamingProfile
// mProfile.setStream(new Stream(mJSONObject1));
// mCameraStreamingManager.setStreamingProfile(mProfile);
// mCameraStreamingManager.setNativeLoggingEnabled(false);
setFocusAreaIndicator();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public class StreamingBaseActivity extends Activity implements
protected boolean mShutterButtonPressed = false;
private boolean mIsTorchOn = false;
private boolean mIsNeedMute = false;
private boolean mIsNeedFB = false;
private boolean isEncOrientationPort = true;

protected static final int MSG_START_STREAMING = 0;
Expand All @@ -100,6 +99,7 @@ public class StreamingBaseActivity extends Activity implements
protected MicrophoneStreamingSetting mMicrophoneStreamingSetting;
protected StreamingProfile mProfile;
protected JSONObject mJSONObject;
private boolean mOrientationChanged = false;

protected boolean mIsReady = false;

Expand Down Expand Up @@ -193,7 +193,7 @@ protected void onCreate(Bundle savedInstanceState) {

try {
mJSONObject = new JSONObject(streamJsonStrFromServer);
} catch (JSONException e) {
} catch (Exception e) {
e.printStackTrace();
}

Expand Down Expand Up @@ -224,9 +224,8 @@ protected void onCreate(Bundle savedInstanceState) {
.setRecordingHint(false)
.setResetTouchFocusDelayInMs(3000)
// .setFocusMode(CameraStreamingSetting.FOCUS_MODE_CONTINUOUS_PICTURE)
.setCameraPrvSizeLevel(CameraStreamingSetting.PREVIEW_SIZE_LEVEL.MEDIUM)
.setCameraPrvSizeLevel(CameraStreamingSetting.PREVIEW_SIZE_LEVEL.SMALL)
.setCameraPrvSizeRatio(CameraStreamingSetting.PREVIEW_SIZE_RATIO.RATIO_16_9);
mIsNeedFB = true;
mMicrophoneStreamingSetting = new MicrophoneStreamingSetting();
mMicrophoneStreamingSetting.setBluetoothSCOEnabled(false);

Expand Down Expand Up @@ -394,7 +393,7 @@ public void onSurfaceDestroyed() {
}

@Override
public int onDrawFrame(int texId, int texWidth, int texHeight) {
public int onDrawFrame(int texId, int texWidth, int texHeight, float[] transformMatrix) {
// newTexId should not equal with texId. texId is from the SurfaceTexture.
// Otherwise, there is no filter effect.
int newTexId = mFBO.drawFrame(texId, texWidth, texHeight);
Expand Down Expand Up @@ -426,6 +425,8 @@ private class EncodingOrientationSwitcher implements Runnable {
@Override
public void run() {
Log.i(TAG, "isEncOrientationPort:" + isEncOrientationPort);
stopStreaming();
mOrientationChanged = !mOrientationChanged;
isEncOrientationPort = !isEncOrientationPort;
mProfile.setEncodingOrientation(isEncOrientationPort ? StreamingProfile.ENCODING_ORIENTATION.PORT : StreamingProfile.ENCODING_ORIENTATION.LAND);
mCameraStreamingManager.setStreamingProfile(mProfile);
Expand Down Expand Up @@ -503,6 +504,10 @@ public void onStateChanged(final int state, Object extra) {
mStatusMsgContent = getString(R.string.string_state_ready);
setShutterButtonEnabled(true);
setShutterButtonPressed(false);
if (mOrientationChanged) {
mOrientationChanged = false;
startStreaming();
}
break;
case CameraStreamingManager.STATE.IOERROR:
mLogContent += "IOERROR\n";
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
<string name="cd_btn_capture">cd_btn_capture</string>
<string name="cd_btn_orientation">cd_btn_orientation</string>
<string name="cd_btn_mute">cd_btn_mute</string>
<string name="cd_btn_fb">cd_btn_fb</string>
<string name="cd_tv_streaming_state_hint">cd_tv_streaming_state_hint</string>
<string name="cd_shutter_button">cd_shutter_button</string>
</resources>
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,19 @@ mCameraStreamingManager.setNativeLoggingEnabled(false);

### 推流 SDK

* 1.6.1 ([Release Notes][30])
- 发布 pldroid-camera-streaming-1.6.1.jar
- 新增 libpldroid_mmprocessing.so
- 更新 libpldroid_streaming_core.so 和 libpldroid_streaming_h264_encoder.so
- 增加水印支持
- 优化软编 codec,提升画质和码控能力
- 兼容特殊的直播设备
- 新增 TransformMatrix 到 SurfaceTextureCallback#onDrawFrame
- 修复 `CameraStreamingManager#pause` 耗时较长
- 修复硬编纯音频无法正常停止推流
- 修复硬编推流过程中特殊步骤导致的概率性 crash
- 更新 Demo 代码

* 1.6.0 ([Release Notes][29])
- 发布 pldroid-camera-streaming-1.6.0.jar
- 更新 libpldroid_streaming_core.so 和 libpldroid_streaming_h264_encoder.so
Expand Down Expand Up @@ -1089,3 +1102,4 @@ mCameraStreamingManager.setNativeLoggingEnabled(false);
[27]: /ReleaseNotes/release-notes-1.5.1.md
[28]: /ReleaseNotes/release-notes-1.5.3.md
[29]: /ReleaseNotes/release-notes-1.6.0.md
[30]: /ReleaseNotes/release-notes-1.6.1.md
25 changes: 25 additions & 0 deletions ReleaseNotes/release-notes-1.6.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# PLDroidCameraStreaming Release Notes for 1.6.1

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

## 记录

### 推流 SDK
- 发布 pldroid-camera-streaming-1.6.1.jar
- 新增 libpldroid_mmprocessing.so
- 更新 libpldroid_streaming_core.so 和 libpldroid_streaming_h264_encoder.so
- 增加水印支持
- 新增 `WatermarkSetting`
- 新增 `WatermarkSetting.WATERMARK_LOCATION`
- 新增 `WatermarkSetting.WATERMARK_SIZE`
- 新增 `prepare(CameraStreamingSetting, MicrophoneStreamingSetting, WatermarkSetting, StreamingProfile)`
- 优化软编 codec,提升画质和码控能力
- 兼容特殊的直播设备
- 新增 TransformMatrix 到 SurfaceTextureCallback#onDrawFrame
- 修复 `CameraStreamingManager#pause` 耗时较长
- 修复硬编纯音频无法正常停止推流
- 修复硬编推流过程中特殊步骤导致的概率性 crash

### Demo
- 更新 Demo 代码
Binary file added releases/arm64-v8a/libpldroid_mmprocessing.so
Binary file not shown.
Binary file modified releases/arm64-v8a/libpldroid_streaming_aac_encoder.so
Binary file not shown.
Binary file modified releases/arm64-v8a/libpldroid_streaming_core.so
Binary file not shown.
Binary file modified releases/arm64-v8a/libpldroid_streaming_h264_encoder.so
Binary file not shown.
Binary file added releases/armeabi-v7a/libpldroid_mmprocessing.so
Binary file not shown.
Binary file modified releases/armeabi-v7a/libpldroid_streaming_aac_encoder.so
Binary file not shown.
Binary file modified releases/armeabi-v7a/libpldroid_streaming_core.so
Binary file not shown.
Binary file modified releases/armeabi-v7a/libpldroid_streaming_h264_encoder.so
Binary file not shown.
Binary file added releases/armeabi/libpldroid_mmprocessing.so
Binary file not shown.
Binary file modified releases/armeabi/libpldroid_streaming_aac_encoder.so
Binary file not shown.
Binary file modified releases/armeabi/libpldroid_streaming_core.so
Binary file not shown.
Binary file modified releases/armeabi/libpldroid_streaming_h264_encoder.so
Binary file not shown.
Binary file removed releases/pldroid-camera-streaming-1.6.0.jar
Binary file not shown.
Binary file added releases/pldroid-camera-streaming-1.6.1.jar
Binary file not shown.
Binary file added releases/x86/libpldroid_mmprocessing.so
Binary file not shown.
Binary file modified releases/x86/libpldroid_streaming_aac_encoder.so
Binary file not shown.
Binary file modified releases/x86/libpldroid_streaming_core.so
Binary file not shown.
Binary file modified releases/x86/libpldroid_streaming_h264_encoder.so
Binary file not shown.

0 comments on commit 75d317a

Please sign in to comment.