Skip to content

Commit

Permalink
增加不支持的尺寸异常抛出
Browse files Browse the repository at this point in the history
  • Loading branch information
mabeijianxi committed Oct 14, 2016
1 parent 10739b6 commit 3874db0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
###使用方法:
######1:添加依赖
```java
compile 'com.mabeijianxi:small-video-record:1.0.5'
compile 'com.mabeijianxi:small-video-record:1.0.6'
```
######2:在manifests里面添加
```java
Expand Down Expand Up @@ -52,6 +52,9 @@ MediaRecorderConfig config = new MediaRecorderConfig.Buidler()
MediaRecorderActivity.goSmallVideoRecorder(this, SendSmallVideoActivity.class.getName(), config);
```
######更新日志:
2016-10-14:
提交1.0.6,修复在不支持的尺寸下无异常抛出。

2016-10-13:
提交小视频1.0.5,修复部分手机录制变形问题。

Expand Down
6 changes: 3 additions & 3 deletions SmallVideoLib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
versionCode 6
versionName "1.0.5"
versionCode 7
versionName "1.0.6"
}

buildTypes {
Expand All @@ -23,7 +23,7 @@ android {
userOrg = 'mabeijianxi'//bintray.com用户名
groupId = 'com.mabeijianxi'//jcenter上的路径
artifactId = 'small-video-record'//项目名称
publishVersion = '1.0.5'//版本号
publishVersion = '1.0.6'//版本号
desc = '利用FFmpeg来小视频录制与压缩处理!'//描述,不重要
website = 'https://github.com/mabeijianxi/small-video-record'//网站,不重要
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,9 @@ protected void prepareCameraParaments() {
for (int i = 0; i < mSupportedPreviewSizes.size(); i++) {
Size size = mSupportedPreviewSizes.get(i);
if (size.height == SMALL_VIDEO_WIDTH) {
if(SMALL_VIDEO_WIDTH==480){
mSupportedPreviewWidth=640;
}else {
if (SMALL_VIDEO_WIDTH == 480) {
mSupportedPreviewWidth = 640;
} else {
mSupportedPreviewWidth = size.width;
}
findWidth = true;
Expand All @@ -549,7 +549,7 @@ protected void prepareCameraParaments() {
if (findWidth) {
mParameters.setPreviewSize(mSupportedPreviewWidth, SMALL_VIDEO_WIDTH);
} else {
new IllegalArgumentException("传入高度不支持或未找到对应宽度");
throw new IllegalArgumentException("传入高度不支持或未找到对应宽度");
}

// 设置输出视频流尺寸,采样率
Expand Down
4 changes: 2 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.mabeijianxi.smallvideo"
minSdkVersion 14
targetSdkVersion 22
versionCode 6
versionName "1.0.5"
versionCode 7
versionName "1.0.6"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ protected void onCreate(Bundle savedInstanceState) {
public void go(View c) {
MediaRecorderConfig config = new MediaRecorderConfig.Buidler()
.doH264Compress(true)
.smallVideoWidth(480)
.smallVideoHeight(360)
.smallVideoWidth(640)
.smallVideoHeight(480)
.recordTimeMax(6 * 1000)
.maxFrameRate(20)
.minFrameRate(8)
Expand Down

0 comments on commit 3874db0

Please sign in to comment.