Commit 34ade1db12a4f57212d6c4781aced0942a39f990

Authored by 王琳
0 parents

新建短视频编辑示例程序

Showing 72 changed files with 9087 additions and 0 deletions
.gitignore 0 → 100644
  1 +++ a/.gitignore
  1 +*.iml
  2 +.gradle
  3 +/local.properties
  4 +/.idea/workspace.xml
  5 +/.idea/libraries
  6 +.DS_Store
  7 +/build
  8 +/captures
  9 +.externalNativeBuild
... ...
.idea/gradle.xml 0 → 100644
  1 +++ a/.idea/gradle.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="GradleSettings">
  4 + <option name="linkedExternalProjectsSettings">
  5 + <GradleProjectSettings>
  6 + <option name="distributionType" value="DEFAULT_WRAPPED" />
  7 + <option name="externalProjectPath" value="$PROJECT_DIR$" />
  8 + <option name="modules">
  9 + <set>
  10 + <option value="$PROJECT_DIR$" />
  11 + <option value="$PROJECT_DIR$/app" />
  12 + </set>
  13 + </option>
  14 + <option name="resolveModulePerSourceSet" value="false" />
  15 + </GradleProjectSettings>
  16 + </option>
  17 + </component>
  18 +</project>
0 19 \ No newline at end of file
... ...
.idea/inspectionProfiles/Project_Default.xml 0 → 100644
  1 +++ a/.idea/inspectionProfiles/Project_Default.xml
  1 +<component name="InspectionProjectProfileManager">
  2 + <profile version="1.0">
  3 + <option name="myName" value="Project Default" />
  4 + <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
  5 + <option name="TOP_LEVEL_CLASS_OPTIONS">
  6 + <value>
  7 + <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
  8 + <option name="REQUIRED_TAGS" value="" />
  9 + </value>
  10 + </option>
  11 + <option name="INNER_CLASS_OPTIONS">
  12 + <value>
  13 + <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
  14 + <option name="REQUIRED_TAGS" value="" />
  15 + </value>
  16 + </option>
  17 + <option name="METHOD_OPTIONS">
  18 + <value>
  19 + <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
  20 + <option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
  21 + </value>
  22 + </option>
  23 + <option name="FIELD_OPTIONS">
  24 + <value>
  25 + <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
  26 + <option name="REQUIRED_TAGS" value="" />
  27 + </value>
  28 + </option>
  29 + <option name="IGNORE_DEPRECATED" value="false" />
  30 + <option name="IGNORE_JAVADOC_PERIOD" value="true" />
  31 + <option name="IGNORE_DUPLICATED_THROWS" value="false" />
  32 + <option name="IGNORE_POINT_TO_ITSELF" value="false" />
  33 + <option name="myAdditionalJavadocTags" value="date" />
  34 + </inspection_tool>
  35 + </profile>
  36 +</component>
0 37 \ No newline at end of file
... ...
.idea/misc.xml 0 → 100644
  1 +++ a/.idea/misc.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="NullableNotNullManager">
  4 + <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
  5 + <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
  6 + <option name="myNullables">
  7 + <value>
  8 + <list size="4">
  9 + <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
  10 + <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
  11 + <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
  12 + <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
  13 + </list>
  14 + </value>
  15 + </option>
  16 + <option name="myNotNulls">
  17 + <value>
  18 + <list size="4">
  19 + <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
  20 + <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
  21 + <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
  22 + <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
  23 + </list>
  24 + </value>
  25 + </option>
  26 + </component>
  27 + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
  28 + <output url="file://$PROJECT_DIR$/build/classes" />
  29 + </component>
  30 + <component name="ProjectType">
  31 + <option name="id" value="Android" />
  32 + </component>
  33 +</project>
0 34 \ No newline at end of file
... ...
.idea/modules.xml 0 → 100644
  1 +++ a/.idea/modules.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="ProjectModuleManager">
  4 + <modules>
  5 + <module fileurl="file://$PROJECT_DIR$/VEUIDemo.iml" filepath="$PROJECT_DIR$/VEUIDemo.iml" />
  6 + <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
  7 + </modules>
  8 + </component>
  9 +</project>
0 10 \ No newline at end of file
... ...
.idea/runConfigurations.xml 0 → 100644
  1 +++ a/.idea/runConfigurations.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="RunConfigurationProducerService">
  4 + <option name="ignoredProducers">
  5 + <set>
  6 + <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
  7 + <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
  8 + <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
  9 + </set>
  10 + </option>
  11 + </component>
  12 +</project>
0 13 \ No newline at end of file
... ...
.idea/vcs.xml 0 → 100644
  1 +++ a/.idea/vcs.xml
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="VcsDirectoryMappings">
  4 + <mapping directory="" vcs="Git" />
  5 + </component>
  6 +</project>
0 7 \ No newline at end of file
... ...
app/.gitignore 0 → 100644
  1 +++ a/app/.gitignore
  1 +/build
... ...
app/build.gradle 0 → 100644
  1 +++ a/app/build.gradle
  1 +apply plugin: 'com.android.application'
  2 +
  3 +android {
  4 + compileSdkVersion 26
  5 + defaultConfig {
  6 + applicationId "com.rd.ve.demo"
  7 + minSdkVersion 15
  8 + targetSdkVersion 26
  9 + versionCode 1
  10 + versionName "1.0"
  11 +
  12 + ndk {
  13 + // 设置支持的SO库架构
  14 + abiFilters 'armeabi-v7a'
  15 + }
  16 + }
  17 + buildTypes {
  18 + release {
  19 + minifyEnabled false
  20 + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  21 + }
  22 + }
  23 +}
  24 +
  25 +dependencies {
  26 + implementation fileTree(dir: 'libs', include: ['*.jar'])
  27 + implementation 'com.android.support:appcompat-v7:26.1.0'
  28 + implementation 'com.android.support.constraint:constraint-layout:1.0.2'
  29 +
  30 + implementation 'com.cnlive:rdVEUISdk:0.0.6'
  31 +
  32 + //短视频SDK内部已经引用下面这些库,在使用时请参考
  33 +// compile 'com.facebook.fresco:fresco:1.3.0'
  34 +// compile 'com.facebook.fresco:webpsupport:1.3.0'
  35 +// compile 'com.squareup.okio:okio:1.13.0'
  36 +// compile 'com.squareup.okhttp3:okhttp:3.8.1'
  37 +// compile 'com.alibaba:fastjson:1.2.9'
  38 +}
... ...
app/proguard-rules.pro 0 → 100644
  1 +++ a/app/proguard-rules.pro
  1 +# Add project specific ProGuard rules here.
  2 +# You can control the set of applied configuration files using the
  3 +# proguardFiles setting in build.gradle.
  4 +#
  5 +# For more details, see
  6 +# http://developer.android.com/guide/developing/tools/proguard.html
  7 +
  8 +# If your project uses WebView with JS, uncomment the following
  9 +# and specify the fully qualified class name to the JavaScript interface
  10 +# class:
  11 +#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  12 +# public *;
  13 +#}
  14 +
  15 +# Uncomment this to preserve the line number information for
  16 +# debugging stack traces.
  17 +#-keepattributes SourceFile,LineNumberTable
  18 +
  19 +# If you keep the line number information, uncomment this to
  20 +# hide the original source file name.
  21 +#-renamesourcefileattribute SourceFile
  22 +
  23 +
  24 +#support.v4/v7
  25 +-keep class android.support.** { *; }
  26 +-keep class android.support.v4.** { *; }
  27 +-keep public class * extends android.support.v4.**
  28 +-keep interface android.support.v4.app.** { *; }
  29 +-keep class android.support.v7.** { *; }
  30 +-keep public class * extends android.support.v7.**
  31 +-keep interface android.support.v7.app.** { *; }
  32 +-dontwarn android.support.**
  33 +-dontwarn com.alibaba.fastjson.**
  34 +
  35 +#fresco
  36 +-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
  37 +-keep @com.facebook.common.internal.DoNotStrip class *
  38 +-keepclassmembers class * {
  39 + @com.facebook.common.internal.DoNotStrip *;
  40 +}
  41 +
  42 +-dontwarn okio.**
  43 +-dontwarn com.squareup.okhttp.**
  44 +-dontwarn okhttp3.**
  45 +-dontwarn javax.annotation.**
  46 +-dontwarn com.android.volley.toolbox.**
  47 +-dontwarn com.facebook.infer.**
  48 +
  49 +-keep class com.faceunity.** {*;}
  50 +-keep class com.spap.** {*;}
  51 +
  52 +
  53 +
  54 +-dontwarn com.cnlive.**
  55 +-keep com.cnlive.**{*;}
  56 +
  57 +#水印
  58 +-keepclassmembers class * extends com.rd.recorder.OSDBuilder{ * ;}
0 59 \ No newline at end of file
... ...
app/src/main/AndroidManifest.xml 0 → 100644
  1 +++ a/app/src/main/AndroidManifest.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3 + package="com.rd.ve.demo">
  4 +
  5 +
  6 + <supports-screens
  7 + android:anyDensity="true"
  8 + android:largeScreens="true"
  9 + android:normalScreens="true"
  10 + android:smallScreens="true">
  11 + </supports-screens>
  12 +
  13 + <uses-sdk
  14 + android:minSdkVersion="16"
  15 + android:targetSdkVersion="23"/>
  16 +
  17 +
  18 +
  19 + <!-- 必要权限开始 -->
  20 + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
  21 + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
  22 + <uses-permission android:name="android.permission.CAMERA"/>
  23 + <uses-permission android:name="android.permission.RECORD_AUDIO"/>
  24 + <uses-permission android:name="android.permission.INTERNET"/>
  25 + <!-- 需要支持后台或休眠后保存输出时,需添加的权限 -->
  26 + <uses-permission android:name="android.permission.WAKE_LOCK"/>
  27 +
  28 + <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
  29 + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  30 + <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
  31 + <uses-permission android:name="android.permission.READ_LOGS"/>
  32 +
  33 + <application
  34 + android:name="com.rd.ve.demo.AppImpl"
  35 + android:allowBackup="true"
  36 + android:configChanges="keyboardHidden"
  37 + android:description="@string/app_name"
  38 + android:hardwareAccelerated="true"
  39 + android:icon="@drawable/ic_launcher"
  40 + android:label="@string/app_name"
  41 + android:largeHeap="true"
  42 + android:theme="@style/Theme.rd.disableSplitTouch">
  43 + <activity
  44 + android:name=".MainActivity"
  45 + android:screenOrientation="portrait"
  46 + android:configChanges="keyboardHidden">
  47 + <intent-filter>
  48 + <action android:name="android.intent.action.MAIN"/>
  49 +
  50 + <category android:name="android.intent.category.LAUNCHER"/>
  51 + </intent-filter>
  52 + </activity>
  53 + <activity
  54 + android:name=".VideoPlayerActivity"
  55 + android:configChanges="keyboardHidden"
  56 + android:screenOrientation="portrait"
  57 + android:theme="@style/Theme.rd.fullscreen">
  58 + </activity>
  59 + <activity
  60 + android:name=".DialogActivity"
  61 + android:configChanges="keyboardHidden"
  62 + android:screenOrientation="portrait"
  63 + android:theme="@style/dialogActivityStyle">
  64 + </activity>
  65 + <activity
  66 + android:name=".AlbumActivity"
  67 + android:configChanges="keyboardHidden"
  68 + android:screenOrientation="portrait">
  69 + </activity>
  70 + </application>
  71 +
  72 +
  73 +</manifest>
0 74 \ No newline at end of file
... ...
app/src/main/assets/demomedia/android.jpg 0 → 100644

66.3 KB

app/src/main/assets/demomedia/demoVideo1.mp4 0 → 100644
No preview for this file type
app/src/main/assets/demomedia/demoVideo2.mp4 0 → 100644
No preview for this file type
app/src/main/assets/demomedia/demoVideo3.mp4 0 → 100644
No preview for this file type
app/src/main/assets/faceu/BeagleDog.mp3 0 → 100644
No preview for this file type
app/src/main/assets/faceu/YellowEar.mp3 0 → 100644
No preview for this file type
app/src/main/assets/faceu/beagledog.png 0 → 100644

130 KB

app/src/main/assets/faceu/yellowear.png 0 → 100644

163 KB

app/src/main/assets/watermark.png 0 → 100644

6.02 KB

app/src/main/java/com/rd/ve/demo/AlbumActivity.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/AlbumActivity.java
  1 +package com.rd.ve.demo;
  2 +
  3 +import android.app.Activity;
  4 +import android.content.Intent;
  5 +import android.database.Cursor;
  6 +import android.net.Uri;
  7 +import android.os.Bundle;
  8 +import android.provider.MediaStore;
  9 +
  10 +import com.cnlive.veuisdk.CNSdkEntry;
  11 +
  12 +import java.util.ArrayList;
  13 +
  14 +/**
  15 + * xpkUISDK演示页
  16 + */
  17 +public class AlbumActivity extends Activity {
  18 +
  19 + private final int REQUESTCODE_FOR_SYSTEM_ALBUM = 1;
  20 +
  21 + @Override
  22 + protected void onCreate(Bundle savedInstanceState) {
  23 + super.onCreate(savedInstanceState);
  24 + // 此activity没有界面,直接调用系统相册
  25 + Intent picture = new Intent(Intent.ACTION_PICK, getIntent().getData());
  26 + startActivityForResult(picture, REQUESTCODE_FOR_SYSTEM_ALBUM);
  27 + }
  28 +
  29 + @Override
  30 + protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  31 + super.onActivityResult(requestCode, resultCode, data);
  32 + if (resultCode == RESULT_OK) {
  33 + if (requestCode == REQUESTCODE_FOR_SYSTEM_ALBUM && data != null) {
  34 + ArrayList<String> arrPath = new ArrayList<String>();
  35 + // 获取系统返回的媒体地址
  36 + Uri selectedImage = data.getData();
  37 + if ("file".equals(selectedImage.getScheme())) {
  38 + arrPath.add(selectedImage.getPath());
  39 + } else {
  40 + String[] filePathColumns = { MediaStore.Images.Media.DATA };
  41 + Cursor c = this.getContentResolver().query(selectedImage,
  42 + filePathColumns, null, null, null);
  43 + c.moveToFirst();
  44 + int columnIndex = c.getColumnIndex(filePathColumns[0]);
  45 + String picturePath = c.getString(columnIndex);
  46 + arrPath.add(picturePath);
  47 + }
  48 + // 将媒体地址列表传到sdk接口
  49 + CNSdkEntry.onCustomizeAlbum(this, arrPath);
  50 + }
  51 + }
  52 + AlbumActivity.this.finish();
  53 + }
  54 +}
... ...
app/src/main/java/com/rd/ve/demo/AppImpl.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/AppImpl.java
  1 +package com.rd.ve.demo;
  2 +
  3 +import android.app.Application;
  4 +
  5 +import com.cnlive.veuisdk.CNSdkEntry;
  6 +
  7 +/**
  8 + * ************************集成步骤 *******************
  9 + * <p>
  10 + * 1. 在官网注册开发者账户
  11 + * <p>
  12 + * 2. 下载SDK和demo代码
  13 + * <p>
  14 + * 3. 创建应用,获取appKey和appSecret,导入SDK
  15 + * <p>
  16 + * *******************************************************
  17 + * <p>
  18 + * RdVEUISdk自定义Application
  19 + */
  20 +public class AppImpl extends Application {
  21 + /**
  22 + * 已获取的AppKey
  23 + */
  24 + public static final String APP_KEY = "6ecb39f1c12f1a35";
  25 + /**
  26 + * 已获取的AppSecret
  27 + */
  28 + public static final String APP_SECRET = "22a44768806a23466dd52ecf954ed6b26sICMKN8iw707KYMWLkJoNaMxb5Xal+afScFJ8/exLzxx1bY5Te7WqZzRD6k4EcUwwJ8a8+AeCO/WSG2qUzso/7u0l758MUsfPzjz7Ih2BY=";
  29 +
  30 + private String mStrCustomPath;
  31 +
  32 + @Override
  33 + public void onCreate() {
  34 + super.onCreate();
  35 + initializeSdk();
  36 + }
  37 +
  38 + /**
  39 + * 初始化SDK
  40 + */
  41 + public void initializeSdk() {
  42 + // 这里确定是否启用日志,在调试阶段可开启该选项,方便定位问题。打包为发行版时,此启用无效
  43 + CNSdkEntry.enableDebugLog(true);
  44 + // 自定义根目录,如果为空则默认为/sdcard/Android/data/com.rd.ve.demo/files/rdve
  45 + mStrCustomPath = getExternalFilesDir("rdve").getAbsolutePath();
  46 + // sdk初始
  47 + CNSdkEntry.initialize(AppImpl.this, mStrCustomPath, APP_KEY, APP_SECRET,
  48 + new com.rd.ve.demo.SdkHandler().getCallBack());
  49 + // 自定义Crash handler,实际项目可不加入
  50 +// MyCrashHandler.getInstance().init(this);
  51 + faceHanlder = new com.rd.ve.demo.FaceHandler(this);
  52 + }
  53 +
  54 + /**
  55 + * 获取自定义根目录
  56 + *
  57 + * @return
  58 + */
  59 + public String getCustomPath() {
  60 + return mStrCustomPath;
  61 + }
  62 +
  63 + @SuppressWarnings("unused")
  64 + private com.rd.ve.demo.FaceHandler faceHanlder;
  65 +
  66 +}
... ...
app/src/main/java/com/rd/ve/demo/CameraWatermarkBuilder.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/CameraWatermarkBuilder.java
  1 +package com.rd.ve.demo;
  2 +
  3 +import android.content.Context;
  4 +import android.graphics.RectF;
  5 +import android.support.v4.content.ContextCompat;
  6 +import android.text.TextUtils;
  7 +import android.text.format.DateFormat;
  8 +import android.view.LayoutInflater;
  9 +import android.view.View;
  10 +import android.widget.TextView;
  11 +
  12 +import com.cnlive.veuisdk.manager.CNVEOSDBuilder;
  13 +
  14 +import java.text.SimpleDateFormat;
  15 +import java.util.Date;
  16 +import java.util.Formatter;
  17 +import java.util.Locale;
  18 +
  19 +public class CameraWatermarkBuilder extends CNVEOSDBuilder {
  20 + private final StringBuilder m_sbFormator = new StringBuilder();
  21 + private final Formatter m_formatter = new Formatter(m_sbFormator,
  22 + Locale.getDefault());
  23 + private StringBuilder m_sbBuilder = null;
  24 + private SimpleDateFormat sdfTime = null;
  25 + private boolean isSquare;
  26 + private int osdEndbgColor;
  27 +
  28 + public CameraWatermarkBuilder(Context context, Boolean isSquare) {
  29 + super(context, isSquare);
  30 + this.isSquare = isSquare;
  31 + osdEndbgColor = ContextCompat.getColor(context, R.color.white);
  32 + // 水印的宽高 相对于屏幕可见区域的宽高
  33 + if (isSquare) {
  34 + setOSDRect(new RectF(0f, 0.7f, 0.8f, 0.99f), null);// 正方形的自定义水印在可视范围的大小
  35 + } else {
  36 + setOSDRect(new RectF(0f, 0.15f, 0.5f, 0.3f), new RectF(0.15f,
  37 + 0.85f, 0.65f, 1.0f));// 长方形 自定义水印在可视范围的大小
  38 + }
  39 + }
  40 +
  41 + @Override
  42 + protected void cleanUp() {
  43 + m_sbBuilder = null;
  44 + tvOSD = null;
  45 + sdfTime = null;
  46 + }
  47 +
  48 + @Override
  49 + protected View getOSDView(Context context) {
  50 + m_sbBuilder = new StringBuilder();
  51 + sdfTime = new SimpleDateFormat("HH:mm:ss S", Locale.getDefault());
  52 + View view = LayoutInflater.from(context).inflate(
  53 + R.layout.camera_watermark_layout, null);
  54 + onRefreshOSDView(view);
  55 + return view;
  56 + }
  57 +
  58 + private String buildOSDString(Date date) {
  59 + m_sbBuilder.setLength(0);
  60 + m_sbBuilder.append(DateFormat.format("yyyy年MM月dd日 ", date)).append(
  61 + sdfTime.format(date));
  62 +
  63 + return m_sbBuilder.toString();
  64 + }
  65 +
  66 + private TextView tvOSD;
  67 +
  68 + @Override
  69 + protected void onRefreshOSDView(View view) {
  70 + if (null == tvOSD) {
  71 + tvOSD = (TextView) view.findViewById(R.id.osdInfo);
  72 + }
  73 + if (TextUtils.isEmpty(str)) {
  74 + if (mState == OSDState.header) {
  75 + tvOSD.setText(buildOSDString(new Date()));
  76 + } else if (mState == OSDState.recording) {
  77 + tvOSD.setText(stringForTime(recorderTime, false));
  78 + } else if (mState == OSDState.end) {
  79 + tvOSD.setText(buildOSDString(new Date()));
  80 + }
  81 + } else {
  82 + if (mState == OSDState.header) {
  83 + tvOSD.setText(str);
  84 + } else if (mState == OSDState.recording) {
  85 + tvOSD.setText(stringForTime(recorderTime, false));
  86 + } else if (mState == OSDState.end) {
  87 + tvOSD.setText(str);
  88 + }
  89 + }
  90 + }
  91 +
  92 + private static String str = "";
  93 +
  94 + public static void setText(String osd) {
  95 + str = osd;
  96 + }
  97 +
  98 + @Override
  99 + public void setOSDState(OSDState state) {
  100 + // TODO Auto-generated method stub
  101 + super.setOSDState(state);
  102 +
  103 + // Log.e("setOSDState", state + ".." + this.toString());
  104 + if (state == OSDState.header) {
  105 + setOSDVisible(View.VISIBLE);
  106 + if (isSquare) {
  107 + setOSDRect(new RectF(0f, 0.7f, 0.8f, 0.99f), null);// 正方形的自定义水印在可视范围的大小
  108 + } else {
  109 + setOSDRect(new RectF(0.2f, 0.3f, 0.8f, 0.6f), new RectF(0.1f,
  110 + 0.1f, 0.9f, 0.9f));// 长方形 自定义水印在可视范围的大小
  111 + }
  112 +
  113 + } else if (state == OSDState.recording) {
  114 + setOSDVisible(View.INVISIBLE);// demo中,录制进度中的水印呗UI界面组件遮挡,所以水印此时间段不显示
  115 + if (isSquare) {
  116 + setOSDRect(new RectF(0f, 0.7f, 0.8f, 0.99f), null);// 正方形的自定义水印在可视范围的大小
  117 + } else {
  118 + setOSDRect(new RectF(0f, 0.9f, 0.5f, 1f), new RectF(0.1f, 0.1f,
  119 + 0.9f, 0.9f));// 长方形 自定义水印在可视范围的大小
  120 + }
  121 + } else if (state == OSDState.end) {
  122 +
  123 + setOSDVisible(View.VISIBLE);
  124 + if (null != tvOSD) {
  125 + tvOSD.setBackgroundColor(osdEndbgColor);
  126 + }
  127 + if (isSquare) {
  128 + setOSDRect(new RectF(0f, 0f, 1f, 1f), null);// 正方形的自定义水印在可视范围的大小
  129 + } else {
  130 + setOSDRect(new RectF(0f, 0f, 1f, 1f), new RectF(0f, 0f, 1f, 1f));// 长方形
  131 + // 自定义水印在可视范围的大小
  132 + }
  133 + }
  134 + }
  135 +
  136 + /**
  137 + * 毫秒数转换为时间格式化字符串 支持是否显示小时
  138 + *
  139 + * @param timeMs
  140 + * @return
  141 + */
  142 + private String stringForTime(long timeMs, boolean existsHours) {
  143 + boolean bNegative = timeMs < 0;// 是否为负数
  144 + if (bNegative) {
  145 + timeMs = -timeMs;
  146 + }
  147 + int totalSeconds = (int) (timeMs / 1000);
  148 +
  149 + int seconds = totalSeconds % 60;
  150 + int minutes = (totalSeconds / 60) % 60;
  151 + int hours = totalSeconds / 3600;
  152 +
  153 + int ms = (int) (timeMs % 1000);
  154 +
  155 + m_sbFormator.setLength(0);
  156 + try {
  157 + if (hours > 0 || existsHours) {
  158 + return m_formatter.format("%s%02d:%02d:%02d",
  159 + bNegative ? "-" : "", hours, minutes, seconds)
  160 + .toString();
  161 + } else {
  162 + return m_formatter.format("%s%02d:%02d.%03d",
  163 + bNegative ? "- " : "", minutes, seconds, ms).toString();
  164 + }
  165 + } catch (Exception ex) {
  166 + return "";
  167 + }
  168 + }
  169 +
  170 +}
... ...
app/src/main/java/com/rd/ve/demo/DialogActivity.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/DialogActivity.java
  1 +package com.rd.ve.demo;
  2 +
  3 +import android.app.Activity;
  4 +import android.os.Bundle;
  5 +import android.view.View;
  6 +
  7 +import com.cnlive.veuisdk.CNSdkEntry;
  8 +
  9 +/**
  10 + * xpkUISDK确认截取方式演示页
  11 + */
  12 +public class DialogActivity extends Activity {
  13 +
  14 + private final int RETURN_TRIM_VIDEO = 0; // 返回截取视频
  15 + private final int RETURN_TRIM_TIME = 1; // 返回截取时间
  16 +
  17 + @Override
  18 + protected void onCreate(Bundle savedInstanceState) {
  19 + super.onCreate(savedInstanceState);
  20 + setContentView(R.layout.activity_dialog);
  21 + }
  22 +
  23 + public void onClick(View v) {
  24 + switch (v.getId()) {
  25 + case R.id.btnTrimVideo:
  26 + CNSdkEntry.videoTrim(this, RETURN_TRIM_VIDEO);
  27 + DialogActivity.this.finish();
  28 + break;
  29 + case R.id.btnTrimVideoTime:
  30 + CNSdkEntry.videoTrim(this, RETURN_TRIM_TIME);
  31 + DialogActivity.this.finish();
  32 + break;
  33 + default:
  34 + break;
  35 + }
  36 + }
  37 +}
... ...
app/src/main/java/com/rd/ve/demo/FaceHandler.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/FaceHandler.java
  1 +package com.rd.ve.demo;
  2 +
  3 +import android.content.Context;
  4 +import android.content.res.AssetManager;
  5 +import android.os.AsyncTask;
  6 +
  7 +import com.cnlive.veuisdk.CNSdkEntry;
  8 +import com.cnlive.veuisdk.CNSdkService;
  9 +import com.cnlive.veuisdk.manager.CNFaceuConfig;
  10 +import com.rd.ve.demo.utils.SDKUtils;
  11 +
  12 +import java.io.File;
  13 +
  14 +/**
  15 + * 导入人脸贴纸资源
  16 + *
  17 + * @author JIAN
  18 + * @date 2017-3-18 上午11:36:37
  19 + */
  20 +public class FaceHandler {
  21 +
  22 + private Context context;
  23 + private String root = null;
  24 +
  25 + private CNFaceuConfig config = null;
  26 +
  27 + // 自定义网络化加载人脸贴纸资源
  28 + private final String URL = "http://dianbook.17rd.com/api/shortvideo/getfaceprop";
  29 +
  30 + public FaceHandler(Context _context) {
  31 + context = _context;
  32 +
  33 + new AsyncTask<Integer, Integer, Integer>() {
  34 + AssetManager asset;
  35 +
  36 + @Override
  37 + protected void onPreExecute() {
  38 + asset = context.getAssets();
  39 + root = context.getExternalCacheDir() + "/faceu/";
  40 + File f = new File(root);
  41 + if (!f.exists()) {
  42 + f.mkdirs();
  43 + }
  44 + }
  45 +
  46 + ;
  47 +
  48 + @Override
  49 + protected Integer doInBackground(Integer... params) {
  50 + config = new CNFaceuConfig();
  51 + // 设置开启美颜时美白的等级 (参数值0.0f-1.0f,开启人脸识别且开启美颜之后生效)
  52 + config.setColor_level(0.48f);
  53 + // 设置开启美颜时磨皮的等级(参数值0.0f-4.0f,开启人脸识别且开启美颜之后生效)
  54 + config.setBlur_level(4.0f);
  55 + // 设置开启美颜时瘦脸的等级 (有效参数值0.0f-2.0f,开启人脸识别且开启美颜之后生效)
  56 + config.setCheek_thinning(0.68f);
  57 + // 设置美颜时大眼的等级(有效参数值0.0f-4.0f,开启人脸识别且开启美颜之后生效)
  58 + config.setEye_enlarging(1.53f);
  59 +
  60 + // 方式一: 加载本地资源
  61 + String dog = root + "BeagleDog.mp3", dogIcon = root
  62 + + "beagledog.png";
  63 + String yellowEar = root + "YellowEar.mp3", YellowEarIcon = root
  64 + + "yellowear.png";
  65 + addItem(asset, dog, "BeagleDog.mp3", dogIcon, "beagledog.png",
  66 + "BeagleDog");
  67 + addItem(asset, yellowEar, "YellowEar.mp3", YellowEarIcon,
  68 + "yellowear.png", "YellowEar");
  69 + // 方式二:加载网络资源,设置网络化的人脸贴纸数据接口
  70 + config.enableNetFaceu(true, URL);
  71 +
  72 + return null;
  73 + }
  74 +
  75 + @Override
  76 + protected void onPostExecute(Integer result) {
  77 + CNSdkService service = CNSdkEntry.getSdkService();
  78 + if (null != service) {
  79 + service.initFaceuConfig(config);
  80 + }
  81 + }
  82 +
  83 + ;
  84 + }.execute();
  85 +
  86 + }
  87 +
  88 + /**
  89 + * 新增
  90 + *
  91 + * @param asset
  92 + * @param path
  93 + * @param assMp3
  94 + * @param Icon
  95 + * @param assIcon
  96 + * @param title
  97 + */
  98 + @SuppressWarnings("unused")
  99 + private void addItem(AssetManager asset, String path, String assMp3,
  100 + String Icon, String assIcon, String title) {
  101 + if (!new File(path).exists()) {
  102 + SDKUtils.assetRes2File(asset, "faceu/" + assMp3, path);
  103 + }
  104 + if (!new File(Icon).exists()) {
  105 + SDKUtils.assetRes2File(asset, "faceu/" + assIcon, Icon);
  106 + }
  107 + config.addFaceu(path, Icon, title);
  108 + }
  109 +
  110 +}
... ...
app/src/main/java/com/rd/ve/demo/MainActivity.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/MainActivity.java
  1 +package com.rd.ve.demo;
  2 +
  3 +import android.Manifest;
  4 +import android.annotation.SuppressLint;
  5 +import android.annotation.TargetApi;
  6 +import android.app.Activity;
  7 +import android.app.AlertDialog;
  8 +import android.app.ProgressDialog;
  9 +import android.content.Context;
  10 +import android.content.DialogInterface;
  11 +import android.content.Intent;
  12 +import android.content.SharedPreferences;
  13 +import android.content.pm.PackageManager;
  14 +import android.graphics.Color;
  15 +import android.graphics.Rect;
  16 +import android.graphics.RectF;
  17 +import android.os.AsyncTask;
  18 +import android.os.Build;
  19 +import android.os.Bundle;
  20 +import android.os.Environment;
  21 +import android.text.TextUtils;
  22 +import android.util.Log;
  23 +import android.util.SparseArray;
  24 +import android.view.LayoutInflater;
  25 +import android.view.View;
  26 +import android.widget.Button;
  27 +import android.widget.ProgressBar;
  28 +import android.widget.TextView;
  29 +import android.widget.Toast;
  30 +
  31 +import com.cnlive.rdcore.CNVirtualVideo;
  32 +import com.cnlive.rdcore.listener.CNExportListener;
  33 +import com.cnlive.rdcore.models.CNTrailer;
  34 +import com.cnlive.rdcore.models.CNVideoConfig;
  35 +import com.cnlive.rdcore.models.CNWatermark;
  36 +import com.cnlive.veuisdk.CNSdkEntry;
  37 +import com.cnlive.veuisdk.CNSdkService;
  38 +import com.cnlive.veuisdk.callback.ICNCompressVideoCallback;
  39 +import com.cnlive.veuisdk.manager.CNCameraConfiguration;
  40 +import com.cnlive.veuisdk.manager.CNCompressConfiguration;
  41 +import com.cnlive.veuisdk.manager.CNEditObject;
  42 +import com.cnlive.veuisdk.manager.CNExportConfiguration;
  43 +import com.cnlive.veuisdk.manager.CNFaceuInfo;
  44 +import com.cnlive.veuisdk.manager.CNTrimConfiguration;
  45 +import com.cnlive.veuisdk.manager.CNUIConfiguration;
  46 +import com.cnlive.veuisdk.manager.CNVEOSDBuilder;
  47 +import com.cnlive.veuisdk.manager.CNVideoMetadataRetriever;
  48 +import com.rd.ve.demo.dialog.AlbumConfigDialog;
  49 +import com.rd.ve.demo.dialog.AudioConfigDialog;
  50 +import com.rd.ve.demo.dialog.CameraConfigDialog;
  51 +import com.rd.ve.demo.dialog.CompressConfigDialog;
  52 +import com.rd.ve.demo.dialog.ConfigData;
  53 +import com.rd.ve.demo.dialog.ConfigDialogListener;
  54 +import com.rd.ve.demo.dialog.EditorUIAndExportConfigDialog;
  55 +import com.rd.ve.demo.dialog.OsdConfigDialog;
  56 +import com.rd.ve.demo.dialog.VideoTrimConfigDialog;
  57 +import com.rd.ve.demo.utils.SDKUtils;
  58 +
  59 +import java.util.ArrayList;
  60 +
  61 +import static com.cnlive.veuisdk.manager.CNCameraConfiguration.SQUARE_SCREEN_CAN_CHANGE;
  62 +
  63 +
  64 +/**
  65 + * xpkUISDK演示页
  66 + */
  67 +@TargetApi(23)
  68 +public class MainActivity extends Activity {
  69 + private final String TAG = "MainActivity";
  70 + private String EDIT_PICTURE_PATH = Environment
  71 + .getExternalStorageDirectory() + "/android.jpg";
  72 + /**
  73 + * 导出的横向16:9视频
  74 + */
  75 + private String EDIT_L_VIDEO_PATH = Environment
  76 + .getExternalStorageDirectory() + "/demoVideo1.mp4";
  77 + /**
  78 + * 瓦罐
  79 + * 测试用1:1方型视频
  80 + */
  81 + private String EDIT_S_VIDEO_PATH = Environment
  82 + .getExternalStorageDirectory() + "/demoVideo2.mp4";
  83 + /**
  84 + * 测试用竖向9:16视频
  85 + */
  86 + private String EDIT_P_VIDEO_PATH = Environment
  87 + .getExternalStorageDirectory() + "/demoVideo3.mp4";
  88 + /**
  89 + * 测试用水印图片
  90 + */
  91 + private String EDIT_WATERMARK_PATH = Environment
  92 + .getExternalStorageDirectory() + "/watermark.png";
  93 +
  94 + /**
  95 + * REQUEST_CODE定义:<br>
  96 + * 录制
  97 + */
  98 + private final int CAMERA_REQUEST_CODE = 100;
  99 + /**
  100 + * REQUEST_CODE定义:<br>
  101 + * 相册
  102 + */
  103 + private final int ALBUM_REQUEST_CODE = 101;
  104 +
  105 + /**
  106 + * 从相册选折要压缩的文件
  107 + */
  108 + private final int ALBUM_COMPRESS_REQUEST_CODE = 1011;
  109 + /**
  110 + * 从相册选折要播放的视频
  111 + */
  112 + private final int ALBUM_PLAYER_REQUEST_CODE = 1012;
  113 +
  114 + /**
  115 + * 防篡改录制演示
  116 + */
  117 + private final int CAMERA_ANTI_CHANGE_REQUEST_CODE = 1013;
  118 +
  119 + /**
  120 + * REQUEST_CODE定义:<br>
  121 + * 视频编辑
  122 + */
  123 + private final int EDIT_REQUEST_CODE = 102;
  124 + /**
  125 + * REQUEST_CODE定义:<br>
  126 + * 读取外置存储
  127 + */
  128 + private static final int REQUEST_CODE_READ_EXTERNAL_STORAGE_PERMISSIONS = 1;
  129 +
  130 + /**
  131 + * REQUEST_CODE定义:<br>
  132 + * 视频截取
  133 + */
  134 + private final int TRIM_REQUEST_CODE = 103;
  135 + /**
  136 + * REQUEST_CODE定义:<br>
  137 + * 视频截取相册选择
  138 + */
  139 + private final int TRIM_ALBUM_REQUEST_CODE = 104;
  140 +
  141 + /**
  142 + * 短视频录制演示request_code
  143 + */
  144 + private final int SHORTVIDEO_CAMERA_REQUEST_CODE = 110;
  145 + /**
  146 + * 短视频录制进入相册演示request_code
  147 + */
  148 + private final int SHORTVIDEO_ALBUM_REQUEST_CODE = 111;
  149 + /**
  150 + * 短视频录制进入相册进入截取演示request_code
  151 + */
  152 + private final int SHORTVIDEO_TRIM_REQUEST_CODE = 112;
  153 +
  154 + /**
  155 + * 画中画
  156 + */
  157 + private final int MIX_VIDEO_REQUEST_CODE = 113;
  158 +
  159 +
  160 + /**
  161 + * 选折导出的文件(仅视频)
  162 + */
  163 + private final int ALBUM_REQUEST_EXPORT_CODE = 114;
  164 +
  165 +
  166 + @Override
  167 + protected void onCreate(Bundle savedInstanceState) {
  168 + super.onCreate(savedInstanceState);
  169 + if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
  170 + finish();
  171 + return;
  172 + }
  173 + setContentView(R.layout.activity_main_layout);
  174 +
  175 + EDIT_PICTURE_PATH = ((AppImpl) getApplication()).getCustomPath() + "/android.jpg";
  176 + EDIT_L_VIDEO_PATH = ((AppImpl) getApplication()).getCustomPath() + "/demoVideo1.mp4";
  177 + EDIT_S_VIDEO_PATH = ((AppImpl) getApplication()).getCustomPath() + "/demoVideo2.mp4";
  178 + EDIT_P_VIDEO_PATH = ((AppImpl) getApplication()).getCustomPath() + "/demoVideo3.mp4";
  179 + EDIT_WATERMARK_PATH = ((AppImpl) getApplication()).getCustomPath() + "/watermark.png";
  180 +
  181 + restoreConfigInstanceState();
  182 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
  183 + && !CNSdkEntry.isInitialized()) {
  184 + if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
  185 + requestPermissions(
  186 + new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
  187 + REQUEST_CODE_READ_EXTERNAL_STORAGE_PERMISSIONS);
  188 + }
  189 + } else {
  190 + exportDemoResource();
  191 + }
  192 + // 初始化秀拍客配置
  193 + initEditorUIAndExportConfig();
  194 + registerAllResultHandlers();
  195 + }
  196 +
  197 + @Override
  198 + protected void onDestroy() {
  199 + super.onDestroy();
  200 + CNSdkEntry.onExitApp(this);
  201 + }
  202 +
  203 + /**
  204 + * 初始标准编辑及导出配置
  205 + */
  206 + private void initEditorUIAndExportConfig() {
  207 + initAndGetConfigData();
  208 + // 视频编辑UI配置
  209 + CNUIConfiguration uiConfig = new CNUIConfiguration()
  210 + // 设置是否使用自定义相册
  211 + .setUseCustomAlbum(configData.useCustomAlbum)
  212 + // 设置向导化
  213 + .setEnableWizard(configData.enableWizard)
  214 + // 设置自动播放
  215 + .setEnableAutoRepeat(configData.enableAutoRepeat)
  216 + // 设置MV和mv网络地址
  217 + .setEnableMV(configData.enableMV, ConfigData.WEB_MV_URL)
  218 + // 配音模式
  219 + .setVoiceLayoutType(configData.voiceLayoutType)
  220 + // 设置秀拍客相册支持格式]
  221 + .setAlbumSupportFormatType(configData.albumSupportFormatType)
  222 + // 设置默认进入界面画面比例
  223 + .setVideoProportion(configData.videoProportionType)
  224 + // 设置滤镜界面风格
  225 + .setFilterLayoutType(configData.filterLayoutType)
  226 + // 设置相册媒体选择数量上限(目前只对相册接口生效)
  227 + .setMediaCountLimit(configData.albumMediaCountLimit)
  228 + // 设置相册是否显示跳转拍摄按钮(目前只对相册接口生效)
  229 + .setEnableAlbumCamera(configData.enableAlbumCamera)
  230 + // 编辑与导出模块显示与隐藏(默认不设置为显示)
  231 + .setEditAndExportModuleVisibility(
  232 + CNUIConfiguration.CNEditAndExportModules.SOUNDTRACK,
  233 + configData.enableSoundTrack)
  234 +
  235 + .setEditAndExportModuleVisibility(CNUIConfiguration.CNEditAndExportModules.DUBBING,
  236 + configData.enableDubbing)
  237 + .setEditAndExportModuleVisibility(CNUIConfiguration.CNEditAndExportModules.FILTER,
  238 + configData.enableFilter)
  239 + .setEditAndExportModuleVisibility(CNUIConfiguration.CNEditAndExportModules.TITLING,
  240 + configData.enableTitling)
  241 + .setEditAndExportModuleVisibility(
  242 + CNUIConfiguration.CNEditAndExportModules.SPECIAL_EFFECTS,
  243 + configData.enableSpecialEffects)
  244 + .setEditAndExportModuleVisibility(
  245 + CNUIConfiguration.CNEditAndExportModules.CLIP_EDITING,
  246 + configData.enableClipEditing)
  247 + // 片段编辑模块显示与隐藏(默认不设置为显示)
  248 + .setClipEditingModuleVisibility(
  249 + CNUIConfiguration.CNClipEditingModules.IMAGE_DURATION_CONTROL,
  250 + configData.enableImageDuration)
  251 + .setClipEditingModuleVisibility(CNUIConfiguration.CNClipEditingModules.EDIT,
  252 + configData.enableEdit)
  253 + .setClipEditingModuleVisibility(CNUIConfiguration.CNClipEditingModules.TRIM,
  254 + configData.enableTrim)
  255 + .setClipEditingModuleVisibility(
  256 + CNUIConfiguration.CNClipEditingModules.VIDEO_SPEED_CONTROL,
  257 + configData.enableVideoSpeed)
  258 + .setClipEditingModuleVisibility(CNUIConfiguration.CNClipEditingModules.SPLIT,
  259 + configData.enableSplit)
  260 + .setClipEditingModuleVisibility(CNUIConfiguration.CNClipEditingModules.COPY,
  261 + configData.enableCopy)
  262 + .setClipEditingModuleVisibility(CNUIConfiguration.CNClipEditingModules.PROPORTION,
  263 + configData.enableProportion)
  264 + .setClipEditingModuleVisibility(CNUIConfiguration.CNClipEditingModules.SORT,
  265 + configData.enableSort)
  266 + .setClipEditingModuleVisibility(CNUIConfiguration.CNClipEditingModules.TEXT,
  267 + configData.enableText)
  268 + .setClipEditingModuleVisibility(CNUIConfiguration.CNClipEditingModules.REVERSE,
  269 + configData.enableReverse)
  270 + .setClipEditingModuleVisibility(CNUIConfiguration.CNClipEditingModules.TRANSITION, true)
  271 +
  272 + // 设置自定义的网络音乐
  273 + .setMusicUrl(ConfigData.MUSIC_URL)
  274 + // 设置云音乐
  275 + .setCloudMusicUrl(ConfigData.CLOUDMUSIC_URL)
  276 + //是否显示本地音乐
  277 + .setEnableLocalMusic(configData.enableLocalMusic)
  278 + // 字幕、特效在mv的上面
  279 + .setEnableTitlingAndSpecialEffectOuter(configData.enableTitlingAndSpecialEffectOuter);
  280 +
  281 + // 导出视频参数配置
  282 + CNExportConfiguration exportConfig = new CNExportConfiguration()
  283 + // 设置保存路径,传null或不设置
  284 + // 将保存至默认路径(即调用SdkEntry.initialize初始时自定义路径)
  285 + .setSavePath(null)
  286 + //设置导出时最大边,不设置时,默认为640
  287 + .setExportVideoMaxWH(640)
  288 + //设置视频导出码率,Mbps为单位,不设置时,默认为4
  289 + .setExportVideoBitRate(4)
  290 + //设置视频导出帧率,,不设置时,默认为30
  291 + .setExportVideoFrameRate(30)
  292 + // 设置片尾图片路径,传null或者不设置 将没有片尾
  293 + .setTrailerPath(configData.videoTrailerPath)
  294 + // 设置片尾时长 单位s 默认2s
  295 + .setTrailerDuration(2)
  296 + // 设置导出视频时长 单位ms 传0或者不设置 将导出完整视频
  297 + .setExportVideoDuration(configData.exportVideoDuration)
  298 + // 设置图片水印路径
  299 + .setWatermarkPath(configData.enableWatermark ? EDIT_WATERMARK_PATH : null)
  300 + // 设置是否使用文字水印(使用文字水印,将不再显示图片水印)
  301 + .setEnableTextWatermark(configData.enableTextWatermark)
  302 + // 设置文字水印内容(开启文字水印才生效)
  303 + .setTextWatermarkContent("watarmark")
  304 + // 设置文字水印大小(开启文字水印才生效)
  305 + .setTextWatermarkSize(10)
  306 + // 设置文字水印颜色(开启文字水印才生效)
  307 + .setTextWatermarkColor(Color.WHITE)
  308 + // 设置文字水印阴影颜色(开启文字水印才生效)
  309 + .setTextWatermarkShadowColor(Color.BLACK)
  310 + // 设置水印位置 (文字或图片水印开启才生效)
  311 + .setWatermarkShowRectF(configData.watermarkShowRectF);
  312 +
  313 + // 获取秀拍客配置服务器
  314 + CNSdkService sdkService = CNSdkEntry.getSdkService();
  315 + if (null != sdkService) {
  316 + // 初始化所有配置
  317 + sdkService.initConfiguration(exportConfig, uiConfig);
  318 + }
  319 + }
  320 +
  321 + /**
  322 + * 选折相册资源
  323 + */
  324 + private void initUIAblumConfig() {
  325 + // 视频编辑UI配置
  326 + CNUIConfiguration uiConfig = new CNUIConfiguration()
  327 + // 设置是否使用自定义相册
  328 + .setUseCustomAlbum(false)
  329 + // 设置秀拍客相册支持格式
  330 + .setAlbumSupportFormatType(CNUIConfiguration.ALBUM_SUPPORT_DEFAULT)
  331 + // 设置滤镜界面风格
  332 + // 设置相册媒体选择数量上限(目前只对相册接口生效)
  333 + .setMediaCountLimit(1)
  334 + // 设置相册是否显示跳转拍摄按钮(目前只对相册接口生效)
  335 + .setEnableAlbumCamera(false);
  336 +
  337 + // 获取秀拍客配置服务器
  338 + CNSdkService sdkService = CNSdkEntry.getSdkService();
  339 + if (null != sdkService) {
  340 + // 初始化所有配置
  341 + sdkService.initConfiguration(null, uiConfig);
  342 + }
  343 + }
  344 +
  345 + /**
  346 + * 初始拍摄配置
  347 + *
  348 + * @param UIType * 设置录制时默认界面:<br>
  349 + * 默认16:9录制:<br>
  350 + * CNCameraConfiguration#WIDE_SCREEN_CAN_CHANGE<br>
  351 + * 默认1:1:<br>
  352 + * CNCameraConfiguration. SQUARE_SCREEN_CAN_CHANGE<br>
  353 + * 仅16:9录制:<br>
  354 + * CNCameraConfiguration.ONLY_WIDE_SCREEN<br>
  355 + * 仅1:1录制:<br>
  356 + * CNCameraConfiguration.ONLY_SQUARE_SCREEN
  357 + */
  358 + private void initCameraConfig(int UIType) {
  359 + CNSdkEntry.getSdkService().initConfiguration(
  360 + new CNCameraConfiguration()
  361 + // 可设置最小录制时长,0代表不限制
  362 + .setVideoMinTime(configData.cameraMinTime)
  363 + // 可设置最大录制时长,0代表不限制
  364 + .setVideoMaxTime(configData.cameraMaxTime)
  365 + // 为true代表多次拍摄,拍摄完成一段之后,将保存至相册并开始下一段拍摄,默认为false单次拍摄,拍摄完成后返回资源地址
  366 + .setUseMultiShoot(configData.useMultiShoot)
  367 + /**
  368 + * 设置录制时默认界面:<br>
  369 + * 默认16:9录制:<br>
  370 + * CNCameraConfiguration. WIDE_SCREEN_CAN_CHANGE<br>
  371 + * 默认1:1:<br>
  372 + * CNCameraConfiguration. SQUARE_SCREEN_CAN_CHANGE<br>
  373 + * 仅16:9录制:<br>
  374 + * CNCameraConfiguration.ONLY_SCREEN_SCREEN 仅1:1录制:<br>
  375 + * CNCameraConfiguration.ONLY_SQUARE_SCREEN
  376 + */
  377 + .setCameraUIType(UIType)
  378 + // 设置拍摄完成后,是否保存至相册(仅单次拍摄方式有效),同时通过onActivityResult及SIMPLE_CAMERA_REQUEST_CODE返回
  379 + .setSaveToAlbum(configData.isSaveToAlbum)
  380 + // 设置录制时是否静音,true代表录制后无声音
  381 + .setAudioMute(false)
  382 + // 设置是否启用人脸贴纸功能
  383 + .setEnableFaceU(configData.isDefaultFace)
  384 + // 设置人脸贴纸鉴权证书
  385 + .setPack(authpack.A())
  386 + // 设置是否默认为后置摄像头
  387 + .setDefaultRearCamera(configData.isDefaultRearCamera)
  388 + // 是否显示相册按钮
  389 + .setEnableAlbum(configData.enableAlbum)
  390 + // 是否使用自定义相册
  391 + .setUseCustomAlbum(configData.useCustomAlbum)
  392 + // 设置隐藏拍摄功能(全部隐藏将强制开启视频拍摄)
  393 + .setHideMV(configData.hideMV)
  394 + .setHidePhoto(configData.hidePhoto)
  395 + .setHideRec(configData.hideRec)
  396 + // 设置mv最小时长
  397 + .setCameraMVMinTime(configData.cameraMVMinTime)
  398 + // 设置mv最大时长
  399 + .setCameraMVMaxTime(configData.cameraMVMaxTime)
  400 + // 开启相机水印时需注册水印
  401 + // CNSdkEntry.registerOSDBuilder(CameraWatermarkBuilder.class);
  402 + // 相机录制水印
  403 + .setEnableWatermark(configData.enableCameraWatermark)
  404 + // 相机水印片头
  405 + .setCameraTrailerTime(CNVEOSDBuilder.CNOSDState.header, 2f)
  406 + // 相机录制结束时片尾水印时长(0-1.0 单位:秒)
  407 + .setCameraTrailerTime(CNVEOSDBuilder.CNOSDState.end,
  408 + configData.cameraWatermarkEnd)
  409 + // 是否启用防篡改录制
  410 + .setEnableAntiChange(configData.enableAntiChange)
  411 + // 启用前置输出时镜像
  412 + .setEnableFrontMirror(configData.enableFrontMirror)
  413 + // 固定录制界面的方向
  414 + .setOrientation(configData.mRecordOrientation)
  415 + // 是否支持录制时播放音乐
  416 + .setEnablePlayMusic(configData.enablePlayMusic)
  417 + // 是否美颜
  418 + .setEnableBeauty(configData.enableBeauty));
  419 + }
  420 +
  421 + /**
  422 + * 防篡改录制的相机配置
  423 + */
  424 + private void initCameraAntiChangeConfig() {
  425 +
  426 + CNCameraConfiguration config = new CNCameraConfiguration()
  427 + // 可设置最小录制时长,0代表不限制
  428 + .setVideoMinTime(configData.cameraMinTime)
  429 + // 可设置最大录制时长,0代表不限制
  430 + .setVideoMaxTime(configData.cameraMaxTime)
  431 + // 为true代表多次拍摄,拍摄完成一段之后,将保存至相册并开始下一段拍摄,默认为false单次拍摄,拍摄完成后返回资源地址
  432 + .setUseMultiShoot(false)
  433 + /*
  434 + * 仅16:9录制:<br> CNCameraConfiguration.ONLY_WIDE_SCREEN
  435 + */
  436 + .setCameraUIType(CNCameraConfiguration.ONLY_WIDE_SCREEN)
  437 + // 设置拍摄完成后,是否保存至相册(仅单次拍摄方式有效),同时通过onActivityResult及SIMPLE_CAMERA_REQUEST_CODE返回
  438 + .setSaveToAlbum(true)
  439 + // 设置录制时是否静音,true代表录制后无声音
  440 + .setAudioMute(false)
  441 + // 设置是否启用人脸贴纸功能
  442 + .setEnableFaceU(configData.isDefaultFace)
  443 + // 设置人脸贴纸鉴权证书
  444 + .setPack(authpack.A())
  445 + // 设置是否默认为后置摄像头
  446 + .setDefaultRearCamera(false)
  447 + // 是否显示相册按钮
  448 + .setEnableAlbum(true)
  449 + // 是否使用自定义相册
  450 + // .useCustomAlbum(configData.useCustomAlbum)
  451 + // 设置隐藏拍摄功能(全部隐藏将强制开启视频拍摄)
  452 + .setHideMV(true)
  453 + .setHidePhoto(true)
  454 + .setHideRec(false)
  455 + // 设置mv最小时长
  456 + .setCameraMVMinTime(configData.cameraMVMinTime)
  457 + // 设置mv最大时长
  458 + .setCameraMVMaxTime(configData.cameraMVMaxTime)
  459 + // 开启相机水印时需注册水印
  460 + // CNSdkEntry.registerOSDBuilder(CameraWatermarkBuilder.class);
  461 + // 相机录制水印
  462 + .setEnableWatermark(true)
  463 + // 相机录制结束时片尾水印时长(0-1.0 单位:秒)
  464 + .setCameraTrailerTime(CNVEOSDBuilder.CNOSDState.header, 2f)
  465 + .setCameraTrailerTime(CNVEOSDBuilder.CNOSDState.end, 1f)
  466 + // 是否启用防篡改录制
  467 + .setEnableAntiChange(true)
  468 + .setEnableFrontMirror(true)
  469 + .setEnableBeauty(true);
  470 +
  471 + CNSdkService sdkService = CNSdkEntry.getSdkService();
  472 + if (null != sdkService) {
  473 + // 初始化所有配置
  474 + sdkService.initConfiguration(config);
  475 + }
  476 + }
  477 +
  478 + /**
  479 + * 短视频录制推荐参数
  480 + */
  481 + private void initCameraShortVideoConfig() {
  482 +
  483 + CNCameraConfiguration cameraConfig = new CNCameraConfiguration()
  484 + // 为true代表多次拍摄,拍摄完成一段之后,将保存至相册并开始下一段拍摄,默认为false单次拍摄,拍摄完成后返回资源地址
  485 + .setUseMultiShoot(false)
  486 + /**
  487 + * 设置录制时默认界面:<br>
  488 + * 默认16:9录制:<br>
  489 + * CNCameraConfiguration. WIDE_SCREEN_CAN_CHANGE<br>
  490 + * 默认1:1:<br>
  491 + * CNCameraConfiguration. SQUARE_SCREEN_CAN_CHANGE<br>
  492 + * 仅1:1录制:<br>
  493 + * CNCameraConfiguration.ONLY_SQUARE_SCREEN
  494 + */
  495 + .setCameraUIType(CNCameraConfiguration.ONLY_SQUARE_SCREEN)
  496 + // 设置拍摄完成后,是否保存至相册(仅单次拍摄方式有效),同时通过onActivityResult及SIMPLE_CAMERA_REQUEST_CODE返回
  497 + .setSaveToAlbum(true)
  498 + // 设置录制时是否静音,true代表录制后无声音
  499 + .setAudioMute(false)
  500 + // 设置是否启用人脸贴纸
  501 + .setEnableFaceU(false)
  502 + // 设置启用人脸贴纸鉴权证书
  503 + .setPack(authpack.A())
  504 + // 设置是否默认为后置摄像头
  505 + .setDefaultRearCamera(false)
  506 + // 是否显示相册按钮
  507 + .setEnableAlbum(true)
  508 + // 是否使用自定义相册
  509 + .setUseCustomAlbum(false)
  510 + // 设置隐藏拍摄功能(全部隐藏将强制开启视频拍摄)
  511 + .setHideMV(false)
  512 + .setHidePhoto(true)
  513 + .setHideRec(true)
  514 + // 设置mv最小时长
  515 + .setCameraMVMinTime(3)
  516 + // 设置mv最大时长
  517 + .setCameraMVMaxTime(15)
  518 + // 强制美颜
  519 + .setEnableBeauty(true);
  520 + // 视频编辑UI配置
  521 + CNUIConfiguration uiConfig = new CNUIConfiguration()
  522 + // 设置是否使用自定义相册
  523 + .setUseCustomAlbum(false)
  524 + // 设置MV和mv网络地址
  525 + .setEnableMV(true, ConfigData.WEB_MV_URL)
  526 + // 设置画面比例为1:1
  527 + .setVideoProportion(CNUIConfiguration.PROPORTION_SQUARE)
  528 + // 相册仅支持视频
  529 + .setAlbumSupportFormatType(CNUIConfiguration.ALBUM_SUPPORT_VIDEO_ONLY)
  530 + // 设置视频选择最大数量
  531 + .setMediaCountLimit(1)
  532 + // 设置隐藏相册中的拍摄按钮
  533 + .setEnableAlbumCamera(false)
  534 + //显示配乐
  535 + .setEditAndExportModuleVisibility(CNUIConfiguration.CNEditAndExportModules.SOUNDTRACK, true)
  536 + //关闭配音
  537 + .setEditAndExportModuleVisibility(CNUIConfiguration.CNEditAndExportModules.DUBBING, false)
  538 + // 隐藏字幕
  539 + .setEditAndExportModuleVisibility(CNUIConfiguration.CNEditAndExportModules.TITLING,
  540 + false)
  541 + // 隐藏片段编辑
  542 + .setEditAndExportModuleVisibility(
  543 + CNUIConfiguration.CNEditAndExportModules.CLIP_EDITING, false)
  544 + // 隐藏特效
  545 + .setEditAndExportModuleVisibility(
  546 + CNUIConfiguration.CNEditAndExportModules.SPECIAL_EFFECTS, false)
  547 + // 启用自动重播
  548 + .setEnableAutoRepeat(true);
  549 +
  550 + CNTrimConfiguration trimConfig = new CNTrimConfiguration()
  551 + //设置实际截取时视频导出最大边,不设置时,默认为640
  552 + .setExportVideoMaxWH(640)
  553 + //设置实际截取时视频导出码率,Mbps为单位,不设置时,默认为4
  554 + .setExportVideoBitRate(4)
  555 + // 设置默认裁剪区域为1:1
  556 + .setDefault1x1CropMode(true)
  557 + // 设置截取返回类型
  558 + .setTrimReturnMode(CNTrimConfiguration.TRIM_RETURN_TIME)
  559 + // 设置截取类型
  560 + .setTrimType(CNTrimConfiguration.TRIM_TYPE_SINGLE_FIXED)
  561 + // 设置是否显示1:1按钮
  562 + .setEnable1x1(false)
  563 + // 设置定长截取时间
  564 + .setTrimDuration(15);
  565 + CNSdkEntry.getSdkService().initConfiguration(null, uiConfig,
  566 + cameraConfig);
  567 + CNSdkEntry.getSdkService().initTrimConfiguration(trimConfig);
  568 + }
  569 +
  570 + /**
  571 + * 初始压缩配置
  572 + */
  573 + private void initCompressConfig() {
  574 + CNSdkService sdkService = CNSdkEntry.getSdkService();
  575 + if (null != sdkService) {
  576 + sdkService
  577 + .initCompressConfiguration(new CNCompressConfiguration()
  578 + // 设置是否使用硬件加速
  579 + .setEnableHWCode(configData.enableHWCode)
  580 + // 设置压缩视频码率
  581 + .setBitRate(configData.compressBitRate)
  582 + // 是否显示水印
  583 + .setEnableWatermark(configData.enableCompressWatermark)
  584 + // 显示水印的位置
  585 + .setWatermarkPosition(
  586 + configData.compressWatermarkShowRect)
  587 + // 设置视频分辨率
  588 + .setVideoSize(configData.compressVideoWidth,
  589 + configData.compressVideoHeight)
  590 + // 设置保存路径
  591 + .setSavePath(
  592 + Environment.getExternalStorageDirectory()
  593 + + "/xpkVideos/"));
  594 + }
  595 + }
  596 +
  597 + /**
  598 + * 初始视频截取配置
  599 + */
  600 + private void initTrimConfig() {
  601 + CNSdkService sdkService = CNSdkEntry.getSdkService();
  602 + if (null != sdkService) {
  603 + sdkService
  604 + .initTrimConfiguration(new CNTrimConfiguration()
  605 + //设置实际截取时视频导出最大边,不设置时,默认为640
  606 + .setExportVideoMaxWH(640)
  607 + //设置实际截取时视频导出码率,Mbps为单位,不设置时,默认为4
  608 + .setExportVideoBitRate(4)
  609 + // 设置默认裁剪区域为1:1
  610 + .setDefault1x1CropMode(
  611 + configData.default1x1CropMode)
  612 + // 设置是否显示1:1裁剪按钮
  613 + .setEnable1x1(configData.enable1x1)
  614 + // 设置截取返回类型
  615 + .setTrimReturnMode(configData.mTrimReturnMode)
  616 + // 设置截取类型
  617 + .setTrimType(configData.mTrimType)
  618 + // 设置两定长截取时间
  619 + .setTrimDuration(configData.trimTime1, configData.trimTime2)
  620 + // 设置单个定长截取时间
  621 + .setTrimDuration(configData.trimSingleFixedDuration));
  622 + }
  623 + }
  624 +
  625 + @SuppressLint("NewApi")
  626 + @Override
  627 + public void onRequestPermissionsResult(int requestCode,
  628 + String[] permissions, int[] grantResults) {
  629 + switch (requestCode) {
  630 + case REQUEST_CODE_READ_EXTERNAL_STORAGE_PERMISSIONS: {
  631 + for (int i = 0; i < permissions.length; i++) {
  632 + if (grantResults[i] == PackageManager.PERMISSION_GRANTED) {
  633 + if (!CNSdkEntry.isInitialized()) {
  634 + ((AppImpl) getApplication()).initializeSdk();
  635 + }
  636 + exportDemoResource();
  637 + } else {
  638 + Toast.makeText(this, "未允许读写存储!", Toast.LENGTH_SHORT).show();
  639 + finish();
  640 + }
  641 + }
  642 + }
  643 + break;
  644 + default: {
  645 + super.onRequestPermissionsResult(requestCode, permissions,
  646 + grantResults);
  647 + }
  648 + }
  649 + }
  650 +
  651 +
  652 + /**
  653 + * 响应点击
  654 + *
  655 + * @param v
  656 + */
  657 + public void onVideo(View v) {
  658 + switch (v.getId()) {
  659 + case R.id.record_square: // 正方形录制视频,编辑录制后的视频,如果有导出时,导出视频的路径
  660 + CNSdkEntry.registerOSDBuilder(CameraWatermarkBuilder.class);
  661 + CameraWatermarkBuilder.setText("");// 可自定义水印显示文本
  662 + initCameraConfig(CNCameraConfiguration.ONLY_SQUARE_SCREEN);
  663 + CNSdkEntry.record(this, CAMERA_REQUEST_CODE);
  664 + break;
  665 + case R.id.record_wide: // 长方形录制视频,编辑录制后的视频,如果有导出时,导出视频的路径
  666 + CNSdkEntry.registerOSDBuilder(CameraWatermarkBuilder.class);
  667 + CameraWatermarkBuilder.setText("");// 可自定义水印显示文本
  668 + initCameraConfig(CNCameraConfiguration.ONLY_WIDE_SCREEN);
  669 + CNSdkEntry.record(this, CAMERA_REQUEST_CODE);
  670 + break;
  671 + case R.id.record: // 正方形,长方形可切换录制视频,编辑录制后的视频,如果有导出时,导出视频的路径
  672 + CNSdkEntry.registerOSDBuilder(CameraWatermarkBuilder.class);
  673 + CameraWatermarkBuilder.setText("");// 可自定义水印显示文本
  674 + initCameraConfig(SQUARE_SCREEN_CAN_CHANGE);
  675 + CNSdkEntry.record(this, CAMERA_REQUEST_CODE);
  676 + break;
  677 + case R.id.recordAntiChange: // 全屏录制,防篡改录制
  678 + CNSdkEntry.registerOSDBuilder(CameraWatermarkBuilder.class);
  679 + String osd = TextUtils.isEmpty(configData.antiChangeText) ? getString(R.string.osd_content)
  680 + : configData.antiChangeText;
  681 + CameraWatermarkBuilder.setText(osd);
  682 + initCameraAntiChangeConfig();
  683 + CNSdkEntry.record(this, CAMERA_ANTI_CHANGE_REQUEST_CODE);
  684 +
  685 +
  686 + break;
  687 +
  688 + case R.id.directEdit: // 传递资源路径,进入视频编辑,返回导出的视频的地址
  689 + initEditorUIAndExportConfig();
  690 + initCameraConfig(SQUARE_SCREEN_CAN_CHANGE);
  691 +// CNSdkEntry.getSdkService().initConfiguration(
  692 +// new CNCameraConfiguration());
  693 + ArrayList<String> list = new ArrayList<String>();
  694 + list.add(EDIT_PICTURE_PATH);
  695 + list.add(EDIT_L_VIDEO_PATH);
  696 + CNSdkEntry.editMedia(MainActivity.this, list, EDIT_REQUEST_CODE);
  697 + break;
  698 + case R.id.selectMediaAndEdit: // 进入sdk媒体资源的选择界面(图片、视频)
  699 + initEditorUIAndExportConfig();
  700 + initCameraConfig(SQUARE_SCREEN_CAN_CHANGE);
  701 + CNSdkEntry.selectMedia(this, EDIT_REQUEST_CODE);
  702 + break;
  703 + case R.id.player: // 播放器
  704 + initUIAblumConfig();
  705 + CNSdkEntry.openAlbum(this, CNUIConfiguration.ALBUM_SUPPORT_VIDEO_ONLY,
  706 + ALBUM_PLAYER_REQUEST_CODE);
  707 + break;
  708 + case R.id.export:
  709 + initEditorUIAndExportConfig();
  710 + CNSdkEntry.getSdkService().initConfiguration(
  711 + new CNCameraConfiguration());
  712 + CNSdkEntry.openAlbum(this, CNUIConfiguration.ALBUM_SUPPORT_VIDEO_ONLY,
  713 + ALBUM_REQUEST_EXPORT_CODE);
  714 + break;
  715 + case R.id.trim_l: // 截取横屏视频
  716 + initTrimConfig();
  717 + CNSdkEntry.trimVideo(this, EDIT_L_VIDEO_PATH, TRIM_REQUEST_CODE);
  718 + break;
  719 + case R.id.trim_p: // 截取竖屏视频
  720 + initTrimConfig();
  721 + CNSdkEntry.trimVideo(this, EDIT_P_VIDEO_PATH, TRIM_REQUEST_CODE);
  722 + break;
  723 + case R.id.trim_s: // 截取正方型视频
  724 + initTrimConfig();
  725 + CNSdkEntry.trimVideo(this, EDIT_S_VIDEO_PATH, TRIM_REQUEST_CODE);
  726 + break;
  727 + case R.id.trim_alum:
  728 + initUIAblumConfig();
  729 + CNSdkEntry.openAlbum(this, CNUIConfiguration.ALBUM_SUPPORT_VIDEO_ONLY,
  730 + TRIM_ALBUM_REQUEST_CODE);
  731 + break;
  732 + case R.id.default_album: // 默认相册(支持图片和视频)
  733 + initEditorUIAndExportConfig();
  734 + CNSdkEntry.getSdkService().initConfiguration(
  735 + new CNCameraConfiguration());
  736 + CNSdkEntry.openAlbum(this, CNUIConfiguration.ALBUM_SUPPORT_DEFAULT,
  737 + ALBUM_REQUEST_CODE);
  738 + break;
  739 + case R.id.only_video: // 相册只显示视频
  740 + initEditorUIAndExportConfig();
  741 + CNSdkEntry.getSdkService().initConfiguration(
  742 + new CNCameraConfiguration());
  743 + CNSdkEntry.openAlbum(this, CNUIConfiguration.ALBUM_SUPPORT_VIDEO_ONLY,
  744 + ALBUM_REQUEST_CODE);
  745 + break;
  746 + case R.id.only_photo: // 相册只显示图片
  747 + initEditorUIAndExportConfig();
  748 + CNSdkEntry.getSdkService().initConfiguration(
  749 + new CNCameraConfiguration());
  750 + CNSdkEntry.openAlbum(this, CNUIConfiguration.ALBUM_SUPPORT_IMAGE_ONLY,
  751 + ALBUM_REQUEST_CODE);
  752 + break;
  753 + case R.id.compress: // 压缩视频
  754 + // 选折要压缩的视频
  755 + initUIAblumConfig();
  756 + CNSdkEntry.openAlbum(this, CNUIConfiguration.ALBUM_SUPPORT_VIDEO_ONLY,
  757 + ALBUM_COMPRESS_REQUEST_CODE);
  758 + break;
  759 + case R.id.ui_config: // ui配置
  760 + if (isConfigDialogShow) {
  761 + return;
  762 + }
  763 + new EditorUIAndExportConfigDialog(this, new ConfigDialogListener() {
  764 +
  765 + @Override
  766 + public void onSaveConfigData(ConfigData configData) {
  767 + initAndGetConfigData().setConfig(configData);
  768 + initEditorUIAndExportConfig();
  769 + initCameraConfig(SQUARE_SCREEN_CAN_CHANGE);
  770 + saveConfigInstanceState();
  771 + }
  772 +
  773 + @Override
  774 + public void onDismiss(DialogInterface dialog) {
  775 + isConfigDialogShow = false;
  776 + }
  777 + }, configData);
  778 + isConfigDialogShow = true;
  779 + break;
  780 + case R.id.camera_config: // 拍摄配置
  781 + if (isConfigDialogShow) {
  782 + return;
  783 + }
  784 + new CameraConfigDialog(this, new ConfigDialogListener() {
  785 +
  786 + @Override
  787 + public void onSaveConfigData(ConfigData configData) {
  788 + initAndGetConfigData().setConfig(configData);
  789 + saveConfigInstanceState();
  790 + }
  791 +
  792 + @Override
  793 + public void onDismiss(DialogInterface dialog) {
  794 + isConfigDialogShow = false;
  795 + }
  796 + }, configData);
  797 + isConfigDialogShow = true;
  798 + break;
  799 + case R.id.trimConfig: // 截取配置
  800 + if (isConfigDialogShow) {
  801 + return;
  802 + }
  803 + new VideoTrimConfigDialog(this, new ConfigDialogListener() {
  804 +
  805 + @Override
  806 + public void onSaveConfigData(ConfigData configData) {
  807 + initAndGetConfigData().setConfig(configData);
  808 + saveConfigInstanceState();
  809 + }
  810 +
  811 + @Override
  812 + public void onDismiss(DialogInterface dialog) {
  813 + isConfigDialogShow = false;
  814 + }
  815 + }, configData);
  816 + isConfigDialogShow = true;
  817 + break;
  818 + case R.id.album_config: // 相册配置
  819 + if (isConfigDialogShow) {
  820 + return;
  821 + }
  822 + new AlbumConfigDialog(this, new ConfigDialogListener() {
  823 +
  824 + @Override
  825 + public void onSaveConfigData(ConfigData configData) {
  826 + initAndGetConfigData().setConfig(configData);
  827 + saveConfigInstanceState();
  828 + }
  829 +
  830 + @Override
  831 + public void onDismiss(DialogInterface dialog) {
  832 + isConfigDialogShow = false;
  833 + }
  834 + }, configData);
  835 + isConfigDialogShow = true;
  836 + break;
  837 + case R.id.compress_config: // 压缩配置
  838 + if (isConfigDialogShow) {
  839 + return;
  840 + }
  841 + new CompressConfigDialog(this, new ConfigDialogListener() {
  842 +
  843 + @Override
  844 + public void onSaveConfigData(ConfigData configData) {
  845 + initAndGetConfigData().setConfig(configData);
  846 + initCompressConfig();
  847 + saveConfigInstanceState();
  848 + }
  849 +
  850 + @Override
  851 + public void onDismiss(DialogInterface dialog) {
  852 + isConfigDialogShow = false;
  853 + }
  854 + }, configData);
  855 + isConfigDialogShow = true;
  856 + break;
  857 +
  858 + case R.id.shortVideoEdit:// 15秒短视频
  859 + initCameraShortVideoConfig();
  860 + CNSdkEntry.record(this, SHORTVIDEO_CAMERA_REQUEST_CODE);
  861 + break;
  862 + case R.id.mixVideoEdit:
  863 + registerActivityResultHandler(MIX_VIDEO_REQUEST_CODE, mixVideoResultHandler);
  864 + CNSdkEntry.mixVideo(this, MIX_VIDEO_REQUEST_CODE);
  865 +//
  866 + break;
  867 + case R.id.reset_config:
  868 + resetConfigInstanceState();
  869 + break;
  870 + case R.id.AntiChange_config:
  871 + if (isConfigDialogShow) {
  872 + return;
  873 + }
  874 + new OsdConfigDialog(this, new ConfigDialogListener() {
  875 +
  876 + @Override
  877 + public void onSaveConfigData(ConfigData configData) {
  878 + MainActivity.this.configData.antiChangeText = configData.antiChangeText;
  879 + initCameraAntiChangeConfig();
  880 + saveConfigInstanceState();
  881 + }
  882 +
  883 + @Override
  884 + public void onDismiss(DialogInterface dialog) {
  885 + isConfigDialogShow = false;
  886 + }
  887 + }, configData);
  888 + isConfigDialogShow = true;
  889 + break;
  890 + case R.id.audio_config:
  891 + if (isConfigDialogShow) {
  892 + return;
  893 + }
  894 + new AudioConfigDialog(this, new ConfigDialogListener() {
  895 +
  896 + @Override
  897 + public void onSaveConfigData(ConfigData configData) {
  898 +
  899 + }
  900 +
  901 + @Override
  902 + public void onDismiss(DialogInterface dialog) {
  903 + isConfigDialogShow = false;
  904 + }
  905 + });
  906 + isConfigDialogShow = true;
  907 + break;
  908 + default:
  909 + break;
  910 + }
  911 + }
  912 +
  913 + /**
  914 + * TODO:registerAllResultHandlers
  915 + */
  916 + private void registerAllResultHandlers() {
  917 + registerActivityResultHandler(CAMERA_REQUEST_CODE,
  918 + cameraResultHandler);
  919 + registerActivityResultHandler(CAMERA_ANTI_CHANGE_REQUEST_CODE,
  920 + cameraAntiChangeResultHandler);
  921 +
  922 + registerActivityResultHandler(ALBUM_REQUEST_CODE,
  923 + albumResultHandler);
  924 + registerActivityResultHandler(ALBUM_COMPRESS_REQUEST_CODE,
  925 + albumCompressResultHandler);
  926 +
  927 + registerActivityResultHandler(EDIT_REQUEST_CODE, editResultHandler);
  928 + registerActivityResultHandler(ALBUM_PLAYER_REQUEST_CODE,
  929 + albumPlayerResultHandler);
  930 + registerActivityResultHandler(TRIM_REQUEST_CODE, trimResultHandler);
  931 + registerActivityResultHandler(TRIM_ALBUM_REQUEST_CODE, trimAlbumResultHandler);
  932 +
  933 +
  934 + registerActivityResultHandler(SHORTVIDEO_CAMERA_REQUEST_CODE,
  935 + shortvideoCameraResultHandler);
  936 + registerActivityResultHandler(SHORTVIDEO_ALBUM_REQUEST_CODE,
  937 + shortvideoAlbumResultHandler);
  938 + registerActivityResultHandler(SHORTVIDEO_TRIM_REQUEST_CODE,
  939 + shortvideoTrimResultHandler);
  940 + registerActivityResultHandler(ALBUM_REQUEST_EXPORT_CODE, albumExportResultHandler);
  941 +
  942 + }
  943 +
  944 + private ActivityResultHandler cameraResultHandler = new ActivityResultHandler() {
  945 +
  946 + @Override
  947 + public void onActivityResult(Context context, int resultCode,
  948 + Intent data) {
  949 + if (resultCode == CNSdkEntry.RESULT_CAMERA_TO_ALBUM) {
  950 + // 点击拍摄的相册按钮,将返回在此,并在这里做进入相册界面操作
  951 + CNSdkEntry.openAlbum(context,
  952 + CNUIConfiguration.ALBUM_SUPPORT_DEFAULT,
  953 + ALBUM_REQUEST_CODE);
  954 + } else if (resultCode == RESULT_OK) {
  955 + // 美颜参数回调
  956 + CNFaceuInfo info = data
  957 + .getParcelableExtra(CNSdkEntry.INTENT_KEY_FACEU);
  958 + if (null != info) {
  959 + Log.e("faceu美颜参数", info.toString());
  960 + }
  961 + // 拍摄后返回的媒体路径
  962 + ArrayList<String> arrMediaListPath = new ArrayList<String>();
  963 + String videoPath = data
  964 + .getStringExtra(CNSdkEntry.INTENT_KEY_VIDEO_PATH);
  965 + String picPath = data
  966 + .getStringExtra(CNSdkEntry.INTENT_KEY_PICTURE_PATH);
  967 + arrMediaListPath.add(videoPath);
  968 + arrMediaListPath.add(picPath);
  969 + String logInfo = String.format("Video path:%s,Picture path:%s",
  970 + videoPath, picPath);
  971 + Log.d(TAG, logInfo);
  972 +
  973 +
  974 + if (configData.albumSupportFormatType == CNUIConfiguration.ALBUM_SUPPORT_IMAGE_ONLY) {
  975 +
  976 + if (videoPath != null) {
  977 + CNSdkEntry.selectMedia(context);
  978 + return;
  979 + }
  980 + } else if (configData.albumSupportFormatType == CNUIConfiguration.ALBUM_SUPPORT_VIDEO_ONLY) {
  981 + if (picPath != null) {
  982 + CNSdkEntry.selectMedia(context);
  983 + return;
  984 + }
  985 + }
  986 +
  987 + if (data.getBooleanExtra(CNSdkEntry.INTENT_KEY_USE_MV_EDIT, false)) {
  988 + Log.e(TAG, "onActivityResult: mv");
  989 + initCameraShortVideoConfig();
  990 + } else {
  991 + Log.e(TAG, "onActivityResult: false");
  992 + initEditorUIAndExportConfig();
  993 + }
  994 + CNSdkEntry.editMedia(context, arrMediaListPath);
  995 + }
  996 + }
  997 + };
  998 +
  999 +
  1000 + private ActivityResultHandler cameraAntiChangeResultHandler = new ActivityResultHandler() {
  1001 +
  1002 + @Override
  1003 + public void onActivityResult(Context context, int resultCode,
  1004 + Intent data) {
  1005 + if (resultCode == RESULT_OK) {
  1006 + String logInfo = String.format("Video path:%s,Picture path:%s",
  1007 + data.getStringExtra(CNSdkEntry.INTENT_KEY_VIDEO_PATH),
  1008 + data.getStringExtra(CNSdkEntry.INTENT_KEY_PICTURE_PATH));
  1009 + Log.d(TAG, logInfo);
  1010 + SDKUtils.onPlayVideo(context, data.getStringExtra(CNSdkEntry.INTENT_KEY_VIDEO_PATH));
  1011 + }
  1012 + }
  1013 + };
  1014 + private ActivityResultHandler mixVideoResultHandler = new ActivityResultHandler() {
  1015 +
  1016 + @Override
  1017 + public void onActivityResult(Context context, int resultCode,
  1018 + Intent data) {
  1019 + if (resultCode == RESULT_OK) {
  1020 + String logInfo = String.format("mixVideoResultHandler Video path:%s,Picture path:%s",
  1021 + data.getStringExtra(CNSdkEntry.INTENT_KEY_VIDEO_PATH),
  1022 + data.getStringExtra(CNSdkEntry.INTENT_KEY_PICTURE_PATH));
  1023 + Log.d(TAG, logInfo);
  1024 +// onPlayVideo(data.getStringExtra(CNSdkEntry.INTENT_KEY_VIDEO_PATH));
  1025 +
  1026 + initEditorUIAndExportConfig();
  1027 + initCameraConfig(SQUARE_SCREEN_CAN_CHANGE);
  1028 + ArrayList<String> list = new ArrayList<String>();
  1029 + list.add(data.getStringExtra(CNSdkEntry.INTENT_KEY_VIDEO_PATH));
  1030 + CNSdkEntry.editMedia(MainActivity.this, list, EDIT_REQUEST_CODE);
  1031 +
  1032 + }
  1033 + }
  1034 + };
  1035 +
  1036 + private ActivityResultHandler albumResultHandler = new ActivityResultHandler() {
  1037 +
  1038 + @Override
  1039 + public void onActivityResult(Context context, int resultCode,
  1040 + Intent data) {
  1041 + if (resultCode == CNSdkEntry.RESULT_ALBUM_TO_CAMERA) {
  1042 + // 点击相册的拍摄按钮,将返回在此,并在这里做进入拍摄界面操作
  1043 + CNSdkEntry.record(context, CAMERA_REQUEST_CODE);
  1044 + } else if (resultCode == RESULT_OK) {
  1045 + // 返回选择的图片视频地址list
  1046 + ArrayList<String> arrMediaListPath = data
  1047 + .getStringArrayListExtra(CNSdkEntry.ALBUM_RESULT);
  1048 + String logInfo = "";
  1049 + for (String path : arrMediaListPath) {
  1050 + Log.d(TAG, path);
  1051 + logInfo += path + "\n";
  1052 + }
  1053 + Toast.makeText(context, logInfo, Toast.LENGTH_LONG).show();
  1054 + }
  1055 + }
  1056 + };
  1057 + /**
  1058 + * 要导出的视频
  1059 + */
  1060 + private ActivityResultHandler albumExportResultHandler = new ActivityResultHandler() {
  1061 +
  1062 + @Override
  1063 + public void onActivityResult(Context context, int resultCode,
  1064 + Intent data) {
  1065 + if (resultCode == RESULT_OK) {
  1066 + // 返回选择的图片视频地址list
  1067 + ArrayList<String> arrMediaListPath = data
  1068 + .getStringArrayListExtra(CNSdkEntry.ALBUM_RESULT);
  1069 +
  1070 + for (String path : arrMediaListPath) {
  1071 + CNVideoConfig videoConfig = new CNVideoConfig();
  1072 + float durationS = CNVirtualVideo.getMediaInfo(path, videoConfig, true);
  1073 + Log.d(TAG, path + "," + durationS + "," + videoConfig);
  1074 + }
  1075 +
  1076 + CNVideoConfig videoConfig = new CNVideoConfig();
  1077 + videoConfig.setVideoEncodingBitRate(4000 * 1000);
  1078 +
  1079 + int numChannel = AudioConfigDialog.audioNumChannel;
  1080 + if (numChannel == 0) {
  1081 + numChannel = videoConfig.getAudioNumChannels();
  1082 + }
  1083 + int sampleRate = AudioConfigDialog.audioSampleRate;
  1084 + if (sampleRate == 0) {
  1085 + sampleRate = videoConfig.getAudioSampleRate();
  1086 + }
  1087 + int audioBitRate = AudioConfigDialog.audioBitRate;
  1088 + if (audioBitRate == 0) {
  1089 + audioBitRate = videoConfig.getAudioBitrate();
  1090 + }
  1091 + videoConfig.setAudioEncodingParameters(numChannel, sampleRate, audioBitRate);
  1092 +
  1093 + //.水印,左下角
  1094 + CNWatermark watermark = new CNWatermark(EDIT_WATERMARK_PATH);
  1095 + watermark.setShowRect(new RectF(0, 1f, 1f, 1.0f));
  1096 + //片尾
  1097 + CNTrailer trailer = new CNTrailer(SDKUtils.createVideoTrailerImage(MainActivity.this, "秀友", 480, 50, 50), 2f, 0.5f);
  1098 +
  1099 + String exportPath = Environment.getExternalStorageDirectory() + "/export.mp4";
  1100 + ExportVideoLisenter mExportListener = new ExportVideoLisenter(exportPath);
  1101 + CNSdkEntry.exportVideo(MainActivity.this, videoConfig, arrMediaListPath, exportPath, watermark, trailer, mExportListener);
  1102 + }
  1103 + }
  1104 + };
  1105 +
  1106 + /**
  1107 + * 导出视频的回调演示
  1108 + */
  1109 + private class ExportVideoLisenter implements CNExportListener {
  1110 + private String mPath;
  1111 + private AlertDialog mDialog;
  1112 + private ProgressBar mProgressBar;
  1113 + private Button mBtnCancel;
  1114 + private TextView mTvTitle;
  1115 +
  1116 + public ExportVideoLisenter(String videoPath) {
  1117 + mPath = videoPath;
  1118 + }
  1119 +
  1120 + @Override
  1121 + public void onExportStart() {
  1122 + View v = LayoutInflater.from(MainActivity.this).inflate(
  1123 + R.layout.progress_view, null);
  1124 + mTvTitle = (TextView) v.findViewById(R.id.tvTitle);
  1125 + mTvTitle.setText("正在导出...");
  1126 + mProgressBar = (ProgressBar) v.findViewById(R.id.pbCompress);
  1127 + mBtnCancel = (Button) v.findViewById(R.id.btnCancelCompress);
  1128 + mBtnCancel.setOnClickListener(new View.OnClickListener() {
  1129 + @Override
  1130 + public void onClick(View view) {
  1131 + CNSdkEntry.cancelExport();
  1132 + }
  1133 + });
  1134 + mDialog = new AlertDialog.Builder(MainActivity.this).setView(v)
  1135 + .show();
  1136 + mDialog.setCanceledOnTouchOutside(false);
  1137 + }
  1138 +
  1139 + /**
  1140 + * 导出进度回调
  1141 + *
  1142 + * @param progress 当前进度
  1143 + * @param max 最大进度
  1144 + * @return 返回是否继续执行,false为终止导出
  1145 + */
  1146 + @Override
  1147 + public boolean onExporting(int progress, int max) {
  1148 + if (mProgressBar != null) {
  1149 + mProgressBar.setMax(max);
  1150 + mProgressBar.setProgress(progress);
  1151 + }
  1152 + return true;
  1153 + }
  1154 +
  1155 + @Override
  1156 + public void onExportEnd(int result) {
  1157 + mDialog.dismiss();
  1158 + if (result >= CNVirtualVideo.RESULT_SUCCESS) {
  1159 + SDKUtils.onPlayVideo(MainActivity.this, mPath);
  1160 + } else if (result != CNVirtualVideo.RESULT_SAVE_CANCEL) {
  1161 + Log.e(TAG, "onExportEnd: " + result);
  1162 + Toast.makeText(MainActivity.this, "导出失败" + result, Toast.LENGTH_LONG).show();
  1163 + }
  1164 + }
  1165 + }
  1166 +
  1167 + private ActivityResultHandler editResultHandler = new ActivityResultHandler() {
  1168 +
  1169 + @Override
  1170 + public void onActivityResult(Context context, int resultCode,
  1171 + Intent data) {
  1172 + if (resultCode == RESULT_OK && null != data) {
  1173 + String mediaPath = data.getStringExtra(CNSdkEntry.EDIT_RESULT);
  1174 + if (mediaPath != null) {
  1175 + Log.d(TAG, mediaPath);
  1176 + Toast.makeText(context, mediaPath, Toast.LENGTH_LONG)
  1177 + .show();
  1178 + }
  1179 + }
  1180 + }
  1181 + };
  1182 +
  1183 + private ActivityResultHandler trimResultHandler = new ActivityResultHandler() {
  1184 +
  1185 + @Override
  1186 + public void onActivityResult(Context context, int resultCode,
  1187 + Intent data) {
  1188 + if (resultCode == RESULT_OK) {
  1189 + float startTime = data.getFloatExtra(CNSdkEntry.TRIM_START_TIME, 0f);
  1190 + float endTime = data.getFloatExtra(CNSdkEntry.TRIM_END_TIME, 0);
  1191 + String path = data.getStringExtra(CNSdkEntry.TRIM_MEDIA_PATH);
  1192 + Rect rect = data.getParcelableExtra(CNSdkEntry.TRIM_CROP_RECT);
  1193 + String logInfo = "截取开始时间:" + startTime + "s" + ",结束时间:"
  1194 + + endTime + "s\n裁剪区域:" + rect + "...视频:" + path;
  1195 + Log.d(TAG, logInfo);
  1196 + Toast.makeText(context, logInfo, Toast.LENGTH_LONG).show();
  1197 + }
  1198 + }
  1199 + };
  1200 +
  1201 + private ActivityResultHandler trimAlbumResultHandler = new ActivityResultHandler() {
  1202 +
  1203 + @Override
  1204 + public void onActivityResult(Context context, int resultCode,
  1205 + Intent data) {
  1206 + if (resultCode == RESULT_OK) {
  1207 + ArrayList<String> arrCameraMediaListPath = data
  1208 + .getStringArrayListExtra(CNSdkEntry.ALBUM_RESULT);
  1209 + if (arrCameraMediaListPath != null
  1210 + && arrCameraMediaListPath.get(0) != null) {
  1211 + String path = arrCameraMediaListPath.get(0);
  1212 + initTrimConfig();
  1213 + CNSdkEntry.trimVideo(context, path, TRIM_REQUEST_CODE);
  1214 + }
  1215 + }
  1216 + }
  1217 + };
  1218 +
  1219 +
  1220 + private ActivityResultHandler shortvideoCameraResultHandler = new ActivityResultHandler() {
  1221 +
  1222 + @Override
  1223 + public void onActivityResult(Context context, int resultCode,
  1224 + Intent data) {
  1225 + if (resultCode == CNSdkEntry.RESULT_CAMERA_TO_ALBUM) {
  1226 + // TODO: 按下拍摄的相册按钮,在此进入相册
  1227 + CNSdkEntry.openAlbum(context,
  1228 + CNUIConfiguration.ALBUM_SUPPORT_VIDEO_ONLY,
  1229 + SHORTVIDEO_ALBUM_REQUEST_CODE);
  1230 + } else if (resultCode == RESULT_OK) {
  1231 + // TODO: 拍摄完成,在此进入编辑界面
  1232 + CNFaceuInfo info = data
  1233 + .getParcelableExtra(CNSdkEntry.INTENT_KEY_FACEU);
  1234 + if (null != info) {
  1235 + Log.e("faceu美颜参数", info.toString());
  1236 + }
  1237 +
  1238 + ArrayList<String> arrMediaListPath = new ArrayList<String>();
  1239 + arrMediaListPath.add(data
  1240 + .getStringExtra(CNSdkEntry.INTENT_KEY_VIDEO_PATH));
  1241 + CNSdkEntry.editMedia(context, arrMediaListPath);
  1242 + }
  1243 + }
  1244 + };
  1245 +
  1246 + private ActivityResultHandler shortvideoAlbumResultHandler = new ActivityResultHandler() {
  1247 +
  1248 + @Override
  1249 + public void onActivityResult(Context context, int resultCode,
  1250 + Intent data) {
  1251 + if (resultCode == CNSdkEntry.RESULT_ALBUM_TO_CAMERA) {
  1252 + // TODO: 按下相册的拍摄按钮,在此进入拍摄界面
  1253 + CNSdkEntry.record(context, SHORTVIDEO_CAMERA_REQUEST_CODE);
  1254 + } else if (resultCode == RESULT_OK) {
  1255 + // TODO: 选择媒体结束后,在此进入截取界面
  1256 + ArrayList<String> arrCameraMediaListPath = data
  1257 + .getStringArrayListExtra(CNSdkEntry.ALBUM_RESULT);
  1258 + if (arrCameraMediaListPath != null) {
  1259 + if (arrCameraMediaListPath.get(0) != null) {
  1260 + String path = arrCameraMediaListPath.get(0);
  1261 + // 获取视频信息
  1262 + CNVideoMetadataRetriever vmr = new CNVideoMetadataRetriever();
  1263 + vmr.setDataSource(path);
  1264 + float duration = Float
  1265 + .valueOf(vmr
  1266 + .extractMetadata(CNVideoMetadataRetriever.METADATA_KEY_VIDEO_DURATION));
  1267 + int videoHeight = Integer
  1268 + .valueOf(vmr
  1269 + .extractMetadata(CNVideoMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT));
  1270 + int videoWidth = Integer
  1271 + .valueOf(vmr
  1272 + .extractMetadata(CNVideoMetadataRetriever.METADATA_KEY_VIDEO_WIDHT));
  1273 +
  1274 + if (duration < 15 && videoHeight == videoWidth) {
  1275 + // TODO: 视频小于15秒且为正方形视频,将跳过截取,进入编辑界面
  1276 + CNSdkEntry.editMedia(MainActivity.this,
  1277 + arrCameraMediaListPath,
  1278 + EDIT_REQUEST_CODE);
  1279 + return;
  1280 + }
  1281 + CNSdkEntry.trimVideo(MainActivity.this,
  1282 + arrCameraMediaListPath.get(0),
  1283 + SHORTVIDEO_TRIM_REQUEST_CODE);
  1284 + }
  1285 + }
  1286 + }
  1287 + }
  1288 + };
  1289 +
  1290 + private ActivityResultHandler shortvideoTrimResultHandler = new ActivityResultHandler() {
  1291 +
  1292 + @Override
  1293 + public void onActivityResult(Context context, int resultCode,
  1294 + Intent data) {
  1295 + if (resultCode == RESULT_OK) {
  1296 + // TODO: 截取完成,在此进入编辑界面
  1297 + CNEditObject eo = new CNEditObject(
  1298 + data.getStringExtra(CNSdkEntry.TRIM_MEDIA_PATH));
  1299 + Rect clip = data.getParcelableExtra(CNSdkEntry.TRIM_CROP_RECT);
  1300 + if (clip != null) {
  1301 + eo.setCropRect(new RectF(clip));
  1302 + }
  1303 + eo.setStartTime(data.getFloatExtra(CNSdkEntry.TRIM_START_TIME, 0f));
  1304 + eo.setEndTime(data.getFloatExtra(CNSdkEntry.TRIM_END_TIME, 0f));
  1305 + CNSdkEntry.editMedia(context, eo, EDIT_REQUEST_CODE);
  1306 + }
  1307 + }
  1308 + };
  1309 +
  1310 + private ActivityResultHandler albumPlayerResultHandler = new ActivityResultHandler() {
  1311 +
  1312 + @Override
  1313 + public void onActivityResult(Context context, int resultCode,
  1314 + Intent data) {
  1315 + if (resultCode == RESULT_OK) {
  1316 + // 返回选择的视频地址list
  1317 + ArrayList<String> arrMediaListPath = data
  1318 + .getStringArrayListExtra(CNSdkEntry.ALBUM_RESULT);
  1319 + if (arrMediaListPath.size() > 0) {
  1320 + if (!TextUtils.isEmpty(arrMediaListPath.get(0))) {
  1321 + SDKUtils.onPlayVideo(context, arrMediaListPath.get(0));
  1322 + }
  1323 + }
  1324 + }
  1325 + }
  1326 + };
  1327 +
  1328 + /**
  1329 + * 选择要压缩的视频资源
  1330 + */
  1331 + private ActivityResultHandler albumCompressResultHandler = new ActivityResultHandler() {
  1332 +
  1333 + @Override
  1334 + public void onActivityResult(Context context, int resultCode,
  1335 + Intent data) {
  1336 + if (resultCode == RESULT_OK) {
  1337 + // 返回选择的图片视频地址list
  1338 + ArrayList<String> arrMediaListPath = data
  1339 + .getStringArrayListExtra(CNSdkEntry.ALBUM_RESULT);
  1340 + if (arrMediaListPath.size() > 0) {
  1341 + if (!TextUtils.isEmpty(arrMediaListPath.get(0))) {
  1342 + CNSdkEntry.onCompressVideo(context,
  1343 + arrMediaListPath.get(0), iCompressVideoCallback);
  1344 + }
  1345 + }
  1346 + }
  1347 + }
  1348 + };
  1349 +
  1350 + /**
  1351 + * 压缩视频回调函数
  1352 + */
  1353 + private ICNCompressVideoCallback iCompressVideoCallback = new ICNCompressVideoCallback() {
  1354 + private AlertDialog dialog;
  1355 + private ProgressBar progressBar;
  1356 + private Button btnCancel;
  1357 +
  1358 + @Override
  1359 + public void onCompressStart() {
  1360 + View v = LayoutInflater.from(MainActivity.this).inflate(
  1361 + R.layout.progress_view, null);
  1362 + progressBar = (ProgressBar) v.findViewById(R.id.pbCompress);
  1363 + btnCancel = (Button) v.findViewById(R.id.btnCancelCompress);
  1364 + btnCancel.setOnClickListener(new View.OnClickListener() {
  1365 + @Override
  1366 + public void onClick(View view) {
  1367 + CNSdkEntry.cancelCompressVideo();
  1368 + }
  1369 + });
  1370 + dialog = new AlertDialog.Builder(MainActivity.this).setView(v)
  1371 + .show();
  1372 + dialog.setCanceledOnTouchOutside(false);
  1373 + }
  1374 +
  1375 + @Override
  1376 + public void onProgress(int progress, int max) {
  1377 + if (progressBar != null) {
  1378 + progressBar.setMax(max);
  1379 + progressBar.setProgress(progress);
  1380 + }
  1381 + }
  1382 +
  1383 + @Override
  1384 + public void onCompressError(String errorLog) {
  1385 + Log.e(TAG, errorLog);
  1386 + if (dialog != null) {
  1387 + dialog.dismiss();
  1388 + dialog = null;
  1389 + }
  1390 + }
  1391 +
  1392 + @Override
  1393 + public void onCompressComplete(String path) {
  1394 + SDKUtils.onPlayVideo(MainActivity.this, path);
  1395 + if (dialog != null) {
  1396 + dialog.dismiss();
  1397 + dialog = null;
  1398 + }
  1399 + }
  1400 + };
  1401 +
  1402 + // 防止多次弹出对话框
  1403 + private boolean isConfigDialogShow;
  1404 + private ConfigData configData;
  1405 +
  1406 + /**
  1407 + * 初始化并返回配置
  1408 + */
  1409 + private ConfigData initAndGetConfigData() {
  1410 + if (configData == null) {
  1411 + configData = new ConfigData();
  1412 + }
  1413 + return configData;
  1414 + }
  1415 +
  1416 + /**
  1417 + * 导出测试资源
  1418 + */
  1419 + private void exportDemoResource() {
  1420 +
  1421 + if (!SDKUtils.isValidFile(EDIT_PICTURE_PATH)
  1422 + || !SDKUtils.isValidFile(EDIT_L_VIDEO_PATH)
  1423 + || !SDKUtils.isValidFile(EDIT_S_VIDEO_PATH)
  1424 + || !SDKUtils.isValidFile(EDIT_P_VIDEO_PATH)
  1425 + || !SDKUtils.isValidFile(EDIT_WATERMARK_PATH)) {
  1426 + new AsyncTask<Integer, Integer, Integer>() {
  1427 + private ProgressDialog m_dlgProgress;
  1428 +
  1429 +
  1430 + @Override
  1431 + protected void onPreExecute() {
  1432 + m_dlgProgress = ProgressDialog.show(MainActivity.this,
  1433 + null, "导出测试资源...");
  1434 + }
  1435 +
  1436 + @Override
  1437 + protected Integer doInBackground(Integer... params) {
  1438 + SDKUtils.assetRes2File(getAssets(), "demomedia/android.jpg", EDIT_PICTURE_PATH);
  1439 + SDKUtils.assetRes2File(getAssets(), "demomedia/demoVideo1.mp4", EDIT_L_VIDEO_PATH);
  1440 + SDKUtils.assetRes2File(getAssets(), "demomedia/demoVideo2.mp4", EDIT_S_VIDEO_PATH);
  1441 + SDKUtils.assetRes2File(getAssets(), "demomedia/demoVideo3.mp4", EDIT_P_VIDEO_PATH);
  1442 + SDKUtils.assetRes2File(getAssets(), "watermark.png", EDIT_WATERMARK_PATH);
  1443 + return null;
  1444 + }
  1445 +
  1446 + @Override
  1447 + protected void onPostExecute(Integer result) {
  1448 + m_dlgProgress.dismiss();
  1449 + m_dlgProgress = null;
  1450 + }
  1451 + }.execute();
  1452 + }
  1453 + }
  1454 +
  1455 + /**
  1456 + * 重置持续化保存的配置
  1457 + */
  1458 + private void resetConfigInstanceState() {
  1459 + configData = null;
  1460 + Toast.makeText(this,
  1461 + "所有设置重置" + (saveConfigInstanceState() ? "成功!" : "失败!"),
  1462 + Toast.LENGTH_SHORT).show();
  1463 + }
  1464 +
  1465 + /**
  1466 + * 持续化保存配置
  1467 + */
  1468 + private boolean saveConfigInstanceState() {
  1469 + SharedPreferences sharedPreferences = getSharedPreferences("demo",
  1470 + Context.MODE_PRIVATE);
  1471 + return CNSdkService.saveObject(sharedPreferences, "CONFIG_DATA",
  1472 + initAndGetConfigData());
  1473 + }
  1474 +
  1475 + /**
  1476 + * 还原持续久化保存的配置
  1477 + */
  1478 + private void restoreConfigInstanceState() {
  1479 + SharedPreferences sharedPreferences = getSharedPreferences("demo",
  1480 + Context.MODE_PRIVATE);
  1481 + configData = CNSdkService.restoreObject(sharedPreferences,
  1482 + "CONFIG_DATA", initAndGetConfigData());
  1483 + }
  1484 +
  1485 + private SparseArray<ActivityResultHandler> registeredActivityResultHandlers;
  1486 +
  1487 + /**
  1488 + * 注册响应activity result
  1489 + *
  1490 + * @param requestCode
  1491 + * @param handler
  1492 + */
  1493 + private void registerActivityResultHandler(int requestCode,
  1494 + ActivityResultHandler handler) {
  1495 + if (null == registeredActivityResultHandlers) {
  1496 + registeredActivityResultHandlers = new SparseArray<ActivityResultHandler>();
  1497 + }
  1498 + registeredActivityResultHandlers.put(requestCode, handler);
  1499 + }
  1500 +
  1501 + private interface ActivityResultHandler {
  1502 + /**
  1503 + * 响应
  1504 + *
  1505 + * @param context
  1506 + * @param resultCode The integer result code returned by the child activity
  1507 + * through its setResult().
  1508 + * @param data An Intent, which can return result data to the caller
  1509 + * (various data can be attached to Intent "extras").
  1510 + */
  1511 + void onActivityResult(Context context, int resultCode, Intent data);
  1512 + }
  1513 +
  1514 + @Override
  1515 + protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  1516 + if (null != registeredActivityResultHandlers) {
  1517 + ActivityResultHandler handler = registeredActivityResultHandlers
  1518 + .get(requestCode);
  1519 + if (null != handler) {
  1520 + handler.onActivityResult(this, resultCode, data);
  1521 + }
  1522 + }
  1523 + }
  1524 +}
... ...
app/src/main/java/com/rd/ve/demo/SdkHandler.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/SdkHandler.java
  1 +package com.rd.ve.demo;
  2 +
  3 +import android.content.ContentValues;
  4 +import android.content.Context;
  5 +import android.content.Intent;
  6 +import android.media.MediaMetadataRetriever;
  7 +import android.provider.MediaStore.Video;
  8 +import android.text.TextUtils;
  9 +import android.util.Log;
  10 +
  11 +import com.cnlive.veuisdk.CNSdkEntry;
  12 +import com.cnlive.veuisdk.callback.ICNSdkCallBack;
  13 +import com.rd.ve.demo.utils.SDKUtils;
  14 +
  15 +/**
  16 + * SDK回调演示用handler
  17 + */
  18 +public class SdkHandler {
  19 + private String TAG;
  20 +
  21 + public SdkHandler() {
  22 +
  23 + TAG = "SdkHandler";
  24 + }
  25 +
  26 + public ICNSdkCallBack getCallBack() {
  27 + return isdk;
  28 + }
  29 +
  30 + /**
  31 + * 响应视频导出<br>
  32 + * 1.读取视频信息并写入系统相册<br>
  33 + * 2.播放该视频
  34 + *
  35 + * @param context 应用上下文
  36 + * @param videoPath 视频路径
  37 + */
  38 + private void onVideoExport(Context context, String videoPath) {
  39 + if (!TextUtils.isEmpty(videoPath)) {
  40 + // 读取导出视频的媒体信息,如宽度,持续时间等
  41 + MediaMetadataRetriever retriever = new MediaMetadataRetriever();
  42 + try {
  43 + retriever.setDataSource(videoPath);
  44 + int nVideoWidth = Integer
  45 + .parseInt(retriever
  46 + .extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH));
  47 + int nVideoHeight = Integer
  48 + .parseInt(retriever
  49 + .extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT));
  50 + int duration = Integer
  51 + .parseInt(retriever
  52 + .extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION));
  53 + // 写入系统相册
  54 + insertToGalleryr(context, videoPath, duration, nVideoWidth,
  55 + nVideoHeight);
  56 + } catch (Exception ex) {
  57 + } finally {
  58 + retriever.release();
  59 + }
  60 + // 播放该视频
  61 + SDKUtils.onPlayVideo(context, videoPath);
  62 + } else {
  63 + Log.d(TAG, "获取视频地址失败");
  64 + }
  65 + }
  66 +
  67 + private ICNSdkCallBack isdk = new ICNSdkCallBack() {
  68 +
  69 + /**
  70 + * 目标视频的路径
  71 + *
  72 + * @param context
  73 + * 应用上下文
  74 + * @param exportType
  75 + * 回调类型 来自简单录制 {@link CNSdkEntry#CAMERA_EXPORT}<br>
  76 + * 来自录制编辑{@link CNSdkEntry#CAMERA_EDIT_EXPORT}<br>
  77 + * 来自编辑导出{@link CNSdkEntry#EDIT_EXPORT}<br>
  78 + * 来自普通截取视频导出{@link CNSdkEntry#TRIMVIDEO_EXPORT}<br>
  79 + * 来自定长截取视频导出{@link CNSdkEntry#TRIMVIDEO_DURATION_EXPORT}<br>
  80 + * @param videoPath
  81 + */
  82 + @Override
  83 + public void onGetVideoPath(Context context, int exportType,
  84 + String videoPath) {
  85 +
  86 + if (exportType == CNSdkEntry.EDIT_EXPORT) {
  87 + Log.i(TAG, "getvideoPath 普通编辑");
  88 + } else if (exportType == CNSdkEntry.CAMERA_EXPORT) {
  89 + Log.i(TAG, "getvideoPath 简单录制");
  90 + } else if (exportType == CNSdkEntry.CAMERA_EDIT_EXPORT) {
  91 + Log.i(TAG, "getvideoPath 录制并编辑");
  92 + } else if (exportType == CNSdkEntry.TRIMVIDEO_EXPORT) {
  93 + Log.i(TAG, "getvideoPath 普通截取");
  94 + } else if (exportType == CNSdkEntry.TRIMVIDEO_DURATION_EXPORT) {
  95 + Log.i(TAG, "getvideoPath 定长截取" + videoPath);
  96 + } else {
  97 + Log.e(TAG, "getvideoPath 未知");
  98 + }
  99 +
  100 + onVideoExport(context, videoPath);
  101 + }
  102 +
  103 + /**
  104 + * 响应截取视频时间
  105 + *
  106 + * @param context
  107 + * 应用上下文
  108 + * @param exportType
  109 + * 回调类型 来自普通截取视频的时间导出{@link CNSdkEntry#TRIMVIDEO_EXPORT}<br>
  110 + * 来自定长截取视频的时间导出{@link CNSdkEntry#TRIMVIDEO_DURATION_EXPORT}<br>
  111 + * @param startTime
  112 + * 开始时间 单位:秒
  113 + * @param endTime
  114 + * 结束时间 单位:秒
  115 + */
  116 + @Override
  117 + public void onGetVideoTrimTime(Context context, int exportType,
  118 + float startTime, float endTime) {
  119 + Log.e(TAG, "onGetVideoTrimTime: " + exportType + "...>" + startTime + "<>" + endTime);
  120 + if (exportType == CNSdkEntry.TRIMVIDEO_EXPORT) {
  121 + Log.i(TAG, "onGetVideoTrimTime 普通截取");
  122 + } else if (exportType == CNSdkEntry.TRIMVIDEO_DURATION_EXPORT) {
  123 + Log.i(TAG, "onGetVideoTrimTime 定长截取");
  124 + } else {
  125 + Log.e(TAG, "onGetVideoTrimTime 未知");
  126 + }
  127 + }
  128 +
  129 + /**
  130 + * 响应确认截取按钮
  131 + *
  132 + * @param context
  133 + * 应用上下文
  134 + * @param exportType
  135 + * 来自普通截取的确认 {@link CNSdkEntry#TRIMVIDEO_EXPORT}<br>
  136 + * 来自定长截取的确认 {@link CNSdkEntry#TRIMVIDEO_DURATION_EXPORT}<br>
  137 + */
  138 + @Override
  139 + public void onGetVideoTrim(Context context, int exportType) {
  140 + if (exportType == CNSdkEntry.TRIMVIDEO_EXPORT) {
  141 + Log.i(TAG, "onGetVideoTrimTime 普通截取的确认按钮");
  142 + } else if (exportType == CNSdkEntry.TRIMVIDEO_DURATION_EXPORT) {
  143 + Log.i(TAG, "onGetVideoTrimTime 定长截取的确认按钮");
  144 + } else {
  145 + Log.e(TAG, "onGetVideoTrimTime 未知");
  146 + }
  147 + Intent intent = new Intent(context, DialogActivity.class);
  148 + context.startActivity(intent);
  149 + }
  150 +
  151 + /**
  152 + * 响应进入相册(只显示照片、图片)
  153 + *
  154 + * @param context
  155 + * 应用上下文
  156 + */
  157 + @Override
  158 + public void onGetPhoto(Context context) {
  159 + // 自定义相册调用位置
  160 + Intent intent = new Intent(context, AlbumActivity.class);
  161 + intent.setData(android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
  162 + context.startActivity(intent);
  163 + }
  164 +
  165 + /**
  166 + * 响应进入相册(只显示视频)
  167 + *
  168 + * @param context
  169 + * 应用上下文
  170 + */
  171 + @Override
  172 + public void onGetVideo(Context context) {
  173 + // 自定义视频集调用位置
  174 + Intent intent = new Intent(context, AlbumActivity.class);
  175 + intent.setData(android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI);
  176 + context.startActivity(intent);
  177 + }
  178 +
  179 + };
  180 +
  181 + /**
  182 + * 将视频信息存入相册数据库
  183 + *
  184 + * @param path 视频路径
  185 + * @param duration 视频持续时间
  186 + * @param width 视频宽度
  187 + * @param height 视频高度
  188 + */
  189 + private void insertToGalleryr(Context context, String path, int duration,
  190 + int width, int height) {
  191 + ContentValues videoValues = new ContentValues();
  192 + videoValues.put(Video.Media.TITLE, "未定义");
  193 + videoValues.put(Video.Media.MIME_TYPE, "video/mp4");
  194 + videoValues.put(Video.Media.DATA, path);
  195 + videoValues.put(Video.Media.ARTIST,
  196 + context.getString(R.string.app_name));
  197 + videoValues.put(Video.Media.DATE_TAKEN,
  198 + String.valueOf(System.currentTimeMillis()));
  199 + videoValues.put(Video.Media.DESCRIPTION,
  200 + context.getString(R.string.app_name));
  201 + videoValues.put(Video.Media.DURATION, duration);
  202 + videoValues.put(Video.Media.WIDTH, width);
  203 + videoValues.put(Video.Media.HEIGHT, height);
  204 + context.getContentResolver().insert(Video.Media.EXTERNAL_CONTENT_URI,
  205 + videoValues);
  206 +
  207 + }
  208 +
  209 +}
... ...
app/src/main/java/com/rd/ve/demo/VideoPlayerActivity.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/VideoPlayerActivity.java
  1 +package com.rd.ve.demo;
  2 +
  3 +import android.app.Activity;
  4 +import android.app.ProgressDialog;
  5 +import android.os.Bundle;
  6 +import android.util.Log;
  7 +import android.view.Gravity;
  8 +import android.view.View;
  9 +import android.view.View.OnClickListener;
  10 +import android.view.animation.Animation;
  11 +import android.view.animation.AnimationUtils;
  12 +import android.widget.FrameLayout;
  13 +import android.widget.FrameLayout.LayoutParams;
  14 +import android.widget.ImageView;
  15 +import android.widget.SeekBar;
  16 +import android.widget.SeekBar.OnSeekBarChangeListener;
  17 +import android.widget.TextView;
  18 +import android.widget.Toast;
  19 +
  20 +import com.cnlive.veuisdk.CNVideoView;
  21 +import com.cnlive.veuisdk.manager.CNVideoMetadataRetriever;
  22 +
  23 +import java.util.Formatter;
  24 +import java.util.Locale;
  25 +
  26 +/**
  27 + * 播放界面
  28 + */
  29 +public class VideoPlayerActivity extends Activity {
  30 + private String TAG = "VideoPlayerActivity";
  31 + public static final String ACTION_PATH = "视频路径";
  32 + private TextView mVideoCurrentPos, mVideoDuration;
  33 + private SeekBar mPlayControl;
  34 + private ImageView mVideoPlayerState;
  35 + private CNVideoView mVideoView;
  36 + private ProgressDialog mLoadingDialog;
  37 + private FrameLayout mVideoViewParent;
  38 + private String mSupportAntiChange;
  39 + private float mLastPlayerPosition = -1;
  40 + private boolean mLastPlaying = true;
  41 +
  42 + @Override
  43 + protected void onCreate(Bundle savedInstanceState) {
  44 + super.onCreate(savedInstanceState);
  45 + TAG = this.toString();
  46 + setContentView(R.layout.activity_video_player);
  47 + String path = getIntent().getStringExtra(ACTION_PATH);
  48 +
  49 + // 检索视频信息
  50 + CNVideoMetadataRetriever vmr = new CNVideoMetadataRetriever();
  51 + vmr.setDataSource(path);
  52 +
  53 + // 读取视频信息
  54 + Log.i(TAG,
  55 + "video duration:"
  56 + + vmr.extractMetadata(CNVideoMetadataRetriever.METADATA_KEY_VIDEO_DURATION));
  57 + mSupportAntiChange = vmr
  58 + .extractMetadata(CNVideoMetadataRetriever.METADATA_KEY_IS_SUPPORT_ANTI_CHANGE);
  59 + Log.i(TAG, "is support anti-change:" + mSupportAntiChange);
  60 + Log.i(TAG,
  61 + "video bit rate:"
  62 + + vmr.extractMetadata(CNVideoMetadataRetriever.METADATA_KEY_VIDEO_BIT_RATE));
  63 + Log.i(TAG,
  64 + "video width:"
  65 + + vmr.extractMetadata(CNVideoMetadataRetriever.METADATA_KEY_VIDEO_WIDHT));
  66 + Log.i(TAG,
  67 + "video height:"
  68 + + vmr.extractMetadata(CNVideoMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT));
  69 + Log.i(TAG,
  70 + "video frame rate:"
  71 + + vmr.extractMetadata(CNVideoMetadataRetriever.METADATA_KEY_VIDEO_FRAME_RATE));
  72 +
  73 + mVideoView = (CNVideoView) findViewById(R.id.svpriview);
  74 + mVideoView.setPlayerListener(playerListener);
  75 + mVideoView.setVideoPath(path);
  76 + mVideoPlayerState = (ImageView) findViewById(R.id.ivPlayerState);
  77 + mVideoViewParent = (FrameLayout) findViewById(R.id.videoParentGroup);
  78 + mVideoPlayerState.setOnClickListener(new OnClickListener() {
  79 +
  80 + @Override
  81 + public void onClick(View v) {
  82 + if (mVideoView.isPlaying()) {
  83 + pauseVideo();
  84 + } else {
  85 + playVideo();
  86 + }
  87 + }
  88 + });
  89 +
  90 + mVideoView.setOnClickListener(new OnClickListener() {
  91 +
  92 + @Override
  93 + public void onClick(View v) {
  94 + if (mVideoView.isPlaying()) {
  95 + pauseVideo();
  96 + } else {
  97 + playVideo();
  98 + }
  99 + }
  100 + });
  101 +
  102 + mVideoCurrentPos = (TextView) findViewById(R.id.tvEditorCurrentPos);
  103 + mVideoDuration = (TextView) findViewById(R.id.tvEditorDuration);
  104 +
  105 + findViewById(R.id.left).setOnClickListener(new OnClickListener() {
  106 +
  107 + @Override
  108 + public void onClick(View v) {
  109 + onBackPressed();
  110 + }
  111 + });
  112 +
  113 + mPlayControl = (SeekBar) findViewById(R.id.sbEditor);
  114 + mPlayControl.setOnSeekBarChangeListener(onSeekbarlistener);
  115 + mPlayControl.setMax(100);
  116 + mLoadingDialog = ProgressDialog.show(this, null, "正在加载视频...");
  117 + }
  118 +
  119 + private void prepare() {
  120 + mVideoCurrentPos.setText(getTimeString(0));
  121 + mVideoDuration.setText(getTimeString((int) (mVideoView.getDuration() * 1000)));
  122 + mPlayControl.setMax((int) (mVideoView.getDuration() * 1000));
  123 + }
  124 +
  125 + private String getTimeString(int progress) {
  126 + return stringForTime(progress, false);
  127 + }
  128 +
  129 + private void onComplete() {
  130 + mPlayControl.setProgress(0);
  131 + mVideoPlayerState.setImageResource(R.drawable.btn_play);
  132 + mVideoPlayerState.setVisibility(View.VISIBLE);
  133 + mVideoCurrentPos.setText(getTimeString(0));
  134 + }
  135 +
  136 + @Override
  137 + protected void onPause() {
  138 + mLastPlayerPosition = mVideoView.getCurrentPosition();
  139 + mLastPlaying = mVideoView.isPlaying();
  140 + mVideoView.stop();
  141 + super.onPause();
  142 + }
  143 +
  144 + @Override
  145 + protected void onResume() {
  146 + if (mLastPlaying) {
  147 + playVideo();
  148 + } else {
  149 + pauseVideo();
  150 + }
  151 + mVideoView.seekTo(mLastPlayerPosition);
  152 + super.onResume();
  153 + }
  154 +
  155 + @Override
  156 + protected void onDestroy() {
  157 + mVideoView.cleanUp();
  158 + super.onDestroy();
  159 + }
  160 +
  161 +
  162 + private OnSeekBarChangeListener onSeekbarlistener = new OnSeekBarChangeListener() {
  163 + private boolean m_bIsPlayingOnSeek; // Seek时是否播放中...
  164 +
  165 + @Override
  166 + public void onProgressChanged(SeekBar seekBar, int progress,
  167 + boolean fromUser) {
  168 + if (fromUser) {
  169 + mVideoCurrentPos.setText(getTimeString(progress));
  170 + mVideoView.seekTo(progress / 1000.0f);
  171 + }
  172 + }
  173 +
  174 + @Override
  175 + public void onStartTrackingTouch(SeekBar seekBar) {
  176 + if (mVideoView.isPlaying()) {
  177 + pauseVideo();
  178 + m_bIsPlayingOnSeek = true;
  179 + } else {
  180 + m_bIsPlayingOnSeek = false;
  181 + }
  182 + }
  183 +
  184 + @Override
  185 + public void onStopTrackingTouch(SeekBar seekBar) {
  186 + if (m_bIsPlayingOnSeek) {
  187 + playVideo();
  188 + }
  189 + }
  190 + };
  191 +
  192 + private void playVideo() {
  193 + mVideoView.start();
  194 + mVideoPlayerState.setImageResource(R.drawable.btn_pause);
  195 + Animation an = AnimationUtils.loadAnimation(getApplicationContext(),
  196 + android.R.anim.fade_out);
  197 + mVideoPlayerState.setAnimation(an);
  198 + mVideoPlayerState.setVisibility(View.INVISIBLE);
  199 + }
  200 +
  201 + private void pauseVideo() {
  202 + if (mVideoView.isPlaying()) {
  203 + mVideoView.pause();
  204 + }
  205 + mVideoPlayerState.setImageResource(R.drawable.btn_play);
  206 + mVideoPlayerState.setVisibility(View.VISIBLE);
  207 + }
  208 +
  209 + private CNVideoView.CNPlayerListener playerListener = new CNVideoView.CNPlayerListener() {
  210 +
  211 + @Override
  212 + public void onPlayerPrepare(CNVideoView mediaPlayerControl) {
  213 + prepare();
  214 + mLoadingDialog.dismiss();
  215 + if ("yes".equals(mSupportAntiChange)) {
  216 + final TextView tv = new TextView(getApplicationContext());
  217 + tv.setText(R.string.video_isAntiChang);
  218 + final FrameLayout.LayoutParams lp = new LayoutParams(
  219 + FrameLayout.LayoutParams.WRAP_CONTENT,
  220 + FrameLayout.LayoutParams.WRAP_CONTENT);
  221 + lp.gravity = Gravity.LEFT | Gravity.BOTTOM;
  222 + runOnUiThread(new Runnable() {
  223 + @Override
  224 + public void run() {
  225 + mVideoViewParent.addView(tv, lp);
  226 + }
  227 + });
  228 +
  229 + }
  230 + }
  231 +
  232 + @Override
  233 + public boolean onPlayerError(CNVideoView mediaPlayerControl,
  234 + int what, int extra) {
  235 + mLoadingDialog.dismiss();
  236 + Toast.makeText(VideoPlayerActivity.this,
  237 + getString(android.R.string.VideoView_error_text_unknown),
  238 + Toast.LENGTH_SHORT).show();
  239 + return false;
  240 + }
  241 +
  242 + @Override
  243 + public void onPlayerCompletion(CNVideoView mediaPlayerControl) {
  244 + onComplete();
  245 + }
  246 +
  247 + @Override
  248 + public void onGetCurrentPosition(CNVideoView mediaPlayerControl,
  249 + float position) {
  250 + mPlayControl.setProgress((int) (position * 1000));
  251 + mVideoCurrentPos.setText(getTimeString((int) (position * 1000)));
  252 + }
  253 + };
  254 +
  255 + private final StringBuilder m_sbFormator = new StringBuilder();
  256 + private final Formatter m_formatter = new Formatter(m_sbFormator,
  257 + Locale.getDefault());
  258 +
  259 + /**
  260 + * 毫秒数转换为时间格式化字符串 支持是否显示小时
  261 + *
  262 + * @param timeMs
  263 + * @return
  264 + */
  265 + private String stringForTime(long timeMs, boolean existsHours) {
  266 + boolean bNegative = timeMs < 0;// 是否为负数
  267 + if (bNegative) {
  268 + timeMs = -timeMs;
  269 + }
  270 + int totalSeconds = (int) (timeMs / 1000);
  271 +
  272 + int seconds = totalSeconds % 60;
  273 + int minutes = (totalSeconds / 60) % 60;
  274 + int hours = totalSeconds / 3600;
  275 +
  276 + m_sbFormator.setLength(0);
  277 + try {
  278 + if (hours > 0 || existsHours) {
  279 + return m_formatter.format("%s%02d:%02d:%02d",
  280 + bNegative ? "-" : "", hours, minutes, seconds)
  281 + .toString();
  282 + } else {
  283 + return m_formatter.format("%s%02d:%02d", bNegative ? "- " : "",
  284 + minutes, seconds).toString();
  285 + }
  286 + } catch (Exception ex) {
  287 + return "";
  288 + }
  289 + }
  290 +}
... ...
app/src/main/java/com/rd/ve/demo/authpack.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/authpack.java
  1 +package com.rd.ve.demo;
  2 +
  3 +import java.security.MessageDigest;
  4 +
  5 +public class authpack {
  6 + public static int sha1_32(byte[] buf){int ret=0;try{byte[] digest= MessageDigest.getInstance("SHA1").digest(buf);return ((int)(digest[0]&0xff)<<24)+((int)(digest[1]&0xff)<<16)+((int)(digest[2]&0xff)<<8)+((int)(digest[3]&0xff)<<0);}catch(Exception e){}return ret;}
  7 + public static byte[] A(){
  8 + byte[] buf=new byte[1128];
  9 + int i=0;
  10 + for(i=50;i<63;i++){ buf[0]=(byte)i; if(sha1_32(buf)==1026489091){break;} }
  11 + for(i=77;i<96;i++){ buf[1]=(byte)i; if(sha1_32(buf)==-42685041){break;} }
  12 + for(i=19;i<33;i++){ buf[2]=(byte)i; if(sha1_32(buf)==1087251408){break;} }
  13 + for(i=-48;i<-33;i++){ buf[3]=(byte)i; if(sha1_32(buf)==671492657){break;} }
  14 + for(i=-96;i<-87;i++){ buf[4]=(byte)i; if(sha1_32(buf)==141994054){break;} }
  15 + for(i=-61;i<-39;i++){ buf[5]=(byte)i; if(sha1_32(buf)==-1548468132){break;} }
  16 + for(i=-27;i<-4;i++){ buf[6]=(byte)i; if(sha1_32(buf)==-879384635){break;} }
  17 + for(i=-122;i<-108;i++){ buf[7]=(byte)i; if(sha1_32(buf)==-204933618){break;} }
  18 + for(i=94;i<104;i++){ buf[8]=(byte)i; if(sha1_32(buf)==1862609372){break;} }
  19 + for(i=66;i<77;i++){ buf[9]=(byte)i; if(sha1_32(buf)==1968234787){break;} }
  20 + for(i=67;i<80;i++){ buf[10]=(byte)i; if(sha1_32(buf)==2081191704){break;} }
  21 + for(i=95;i<114;i++){ buf[11]=(byte)i; if(sha1_32(buf)==745582537){break;} }
  22 + for(i=-1;i<24;i++){ buf[12]=(byte)i; if(sha1_32(buf)==1320021058){break;} }
  23 + for(i=67;i<76;i++){ buf[13]=(byte)i; if(sha1_32(buf)==-1459665566){break;} }
  24 + for(i=105;i<118;i++){ buf[14]=(byte)i; if(sha1_32(buf)==-1494800565){break;} }
  25 + for(i=50;i<57;i++){ buf[15]=(byte)i; if(sha1_32(buf)==950232133){break;} }
  26 + for(i=-95;i<-83;i++){ buf[16]=(byte)i; if(sha1_32(buf)==1494665726){break;} }
  27 + for(i=-128;i<-115;i++){ buf[17]=(byte)i; if(sha1_32(buf)==-375458179){break;} }
  28 + for(i=-13;i<4;i++){ buf[18]=(byte)i; if(sha1_32(buf)==-485189447){break;} }
  29 + for(i=66;i<88;i++){ buf[19]=(byte)i; if(sha1_32(buf)==-864119659){break;} }
  30 + for(i=-64;i<-54;i++){ buf[20]=(byte)i; if(sha1_32(buf)==1948907159){break;} }
  31 + for(i=-128;i<-110;i++){ buf[21]=(byte)i; if(sha1_32(buf)==260775010){break;} }
  32 + for(i=-85;i<-66;i++){ buf[22]=(byte)i; if(sha1_32(buf)==-101983059){break;} }
  33 + for(i=-101;i<-100;i++){ buf[23]=(byte)i; if(sha1_32(buf)==819800102){break;} }
  34 + for(i=-110;i<-96;i++){ buf[24]=(byte)i; if(sha1_32(buf)==286617426){break;} }
  35 + for(i=-53;i<-33;i++){ buf[25]=(byte)i; if(sha1_32(buf)==106045753){break;} }
  36 + for(i=79;i<86;i++){ buf[26]=(byte)i; if(sha1_32(buf)==-148890993){break;} }
  37 + for(i=90;i<103;i++){ buf[27]=(byte)i; if(sha1_32(buf)==1149428317){break;} }
  38 + for(i=-28;i<-20;i++){ buf[28]=(byte)i; if(sha1_32(buf)==-1589520921){break;} }
  39 + for(i=-72;i<-48;i++){ buf[29]=(byte)i; if(sha1_32(buf)==255572270){break;} }
  40 + for(i=-64;i<-42;i++){ buf[30]=(byte)i; if(sha1_32(buf)==-972909422){break;} }
  41 + for(i=72;i<97;i++){ buf[31]=(byte)i; if(sha1_32(buf)==2092556752){break;} }
  42 + for(i=-111;i<-99;i++){ buf[32]=(byte)i; if(sha1_32(buf)==-1149217718){break;} }
  43 + for(i=9;i<34;i++){ buf[33]=(byte)i; if(sha1_32(buf)==280342400){break;} }
  44 + for(i=44;i<57;i++){ buf[34]=(byte)i; if(sha1_32(buf)==-1356362184){break;} }
  45 + for(i=120;i<123;i++){ buf[35]=(byte)i; if(sha1_32(buf)==-1199647633){break;} }
  46 + for(i=60;i<70;i++){ buf[36]=(byte)i; if(sha1_32(buf)==1724382504){break;} }
  47 + for(i=77;i<96;i++){ buf[37]=(byte)i; if(sha1_32(buf)==-268862044){break;} }
  48 + for(i=-59;i<-45;i++){ buf[38]=(byte)i; if(sha1_32(buf)==-406065914){break;} }
  49 + for(i=49;i<77;i++){ buf[39]=(byte)i; if(sha1_32(buf)==999130352){break;} }
  50 + for(i=-75;i<-60;i++){ buf[40]=(byte)i; if(sha1_32(buf)==127919875){break;} }
  51 + for(i=-71;i<-46;i++){ buf[41]=(byte)i; if(sha1_32(buf)==-709598217){break;} }
  52 + for(i=-16;i<1;i++){ buf[42]=(byte)i; if(sha1_32(buf)==-463911876){break;} }
  53 + for(i=21;i<46;i++){ buf[43]=(byte)i; if(sha1_32(buf)==1759863532){break;} }
  54 + for(i=-33;i<-16;i++){ buf[44]=(byte)i; if(sha1_32(buf)==-465868074){break;} }
  55 + for(i=8;i<27;i++){ buf[45]=(byte)i; if(sha1_32(buf)==-1291720276){break;} }
  56 + for(i=-45;i<-37;i++){ buf[46]=(byte)i; if(sha1_32(buf)==-1550003114){break;} }
  57 + for(i=90;i<104;i++){ buf[47]=(byte)i; if(sha1_32(buf)==-1096594607){break;} }
  58 + for(i=52;i<68;i++){ buf[48]=(byte)i; if(sha1_32(buf)==1224418497){break;} }
  59 + for(i=12;i<27;i++){ buf[49]=(byte)i; if(sha1_32(buf)==946006067){break;} }
  60 + for(i=52;i<82;i++){ buf[50]=(byte)i; if(sha1_32(buf)==2036710747){break;} }
  61 + for(i=15;i<35;i++){ buf[51]=(byte)i; if(sha1_32(buf)==-1930590580){break;} }
  62 + for(i=-73;i<-67;i++){ buf[52]=(byte)i; if(sha1_32(buf)==964995236){break;} }
  63 + for(i=72;i<90;i++){ buf[53]=(byte)i; if(sha1_32(buf)==-1140345529){break;} }
  64 + for(i=-34;i<-22;i++){ buf[54]=(byte)i; if(sha1_32(buf)==-230038311){break;} }
  65 + for(i=53;i<66;i++){ buf[55]=(byte)i; if(sha1_32(buf)==63152070){break;} }
  66 + for(i=-7;i<10;i++){ buf[56]=(byte)i; if(sha1_32(buf)==-1422787405){break;} }
  67 + for(i=-128;i<-112;i++){ buf[57]=(byte)i; if(sha1_32(buf)==-467281662){break;} }
  68 + for(i=29;i<40;i++){ buf[58]=(byte)i; if(sha1_32(buf)==-596886805){break;} }
  69 + for(i=-55;i<-38;i++){ buf[59]=(byte)i; if(sha1_32(buf)==-1591146865){break;} }
  70 + for(i=-8;i<21;i++){ buf[60]=(byte)i; if(sha1_32(buf)==-595684101){break;} }
  71 + for(i=-112;i<-100;i++){ buf[61]=(byte)i; if(sha1_32(buf)==-1897017796){break;} }
  72 + for(i=-6;i<-4;i++){ buf[62]=(byte)i; if(sha1_32(buf)==-1649794498){break;} }
  73 + for(i=-81;i<-74;i++){ buf[63]=(byte)i; if(sha1_32(buf)==1074577672){break;} }
  74 + for(i=32;i<57;i++){ buf[64]=(byte)i; if(sha1_32(buf)==-2113574272){break;} }
  75 + for(i=-67;i<-61;i++){ buf[65]=(byte)i; if(sha1_32(buf)==-2004044780){break;} }
  76 + for(i=79;i<87;i++){ buf[66]=(byte)i; if(sha1_32(buf)==-1144444353){break;} }
  77 + for(i=-127;i<-117;i++){ buf[67]=(byte)i; if(sha1_32(buf)==-1370771997){break;} }
  78 + for(i=-93;i<-82;i++){ buf[68]=(byte)i; if(sha1_32(buf)==876595586){break;} }
  79 + for(i=-126;i<-103;i++){ buf[69]=(byte)i; if(sha1_32(buf)==1254904090){break;} }
  80 + for(i=45;i<62;i++){ buf[70]=(byte)i; if(sha1_32(buf)==1198590385){break;} }
  81 + for(i=-6;i<6;i++){ buf[71]=(byte)i; if(sha1_32(buf)==2071679952){break;} }
  82 + for(i=-32;i<-10;i++){ buf[72]=(byte)i; if(sha1_32(buf)==-1695262911){break;} }
  83 + for(i=81;i<93;i++){ buf[73]=(byte)i; if(sha1_32(buf)==-764759758){break;} }
  84 + for(i=51;i<65;i++){ buf[74]=(byte)i; if(sha1_32(buf)==2021787843){break;} }
  85 + for(i=-87;i<-78;i++){ buf[75]=(byte)i; if(sha1_32(buf)==698251122){break;} }
  86 + for(i=73;i<91;i++){ buf[76]=(byte)i; if(sha1_32(buf)==-1245394124){break;} }
  87 + for(i=32;i<50;i++){ buf[77]=(byte)i; if(sha1_32(buf)==527837046){break;} }
  88 + for(i=37;i<48;i++){ buf[78]=(byte)i; if(sha1_32(buf)==1815850386){break;} }
  89 + for(i=-70;i<-48;i++){ buf[79]=(byte)i; if(sha1_32(buf)==1890345234){break;} }
  90 + for(i=12;i<31;i++){ buf[80]=(byte)i; if(sha1_32(buf)==-1960039746){break;} }
  91 + for(i=-13;i<-2;i++){ buf[81]=(byte)i; if(sha1_32(buf)==1239352730){break;} }
  92 + for(i=-77;i<-68;i++){ buf[82]=(byte)i; if(sha1_32(buf)==-1458772965){break;} }
  93 + for(i=4;i<23;i++){ buf[83]=(byte)i; if(sha1_32(buf)==-925152497){break;} }
  94 + for(i=-128;i<-117;i++){ buf[84]=(byte)i; if(sha1_32(buf)==-689682024){break;} }
  95 + for(i=-18;i<-2;i++){ buf[85]=(byte)i; if(sha1_32(buf)==1278327521){break;} }
  96 + for(i=-46;i<-23;i++){ buf[86]=(byte)i; if(sha1_32(buf)==281412100){break;} }
  97 + for(i=-86;i<-58;i++){ buf[87]=(byte)i; if(sha1_32(buf)==1728146008){break;} }
  98 + for(i=-122;i<-101;i++){ buf[88]=(byte)i; if(sha1_32(buf)==820657961){break;} }
  99 + for(i=-11;i<9;i++){ buf[89]=(byte)i; if(sha1_32(buf)==1504869357){break;} }
  100 + for(i=79;i<98;i++){ buf[90]=(byte)i; if(sha1_32(buf)==2056192439){break;} }
  101 + for(i=-105;i<-79;i++){ buf[91]=(byte)i; if(sha1_32(buf)==280031110){break;} }
  102 + for(i=107;i<111;i++){ buf[92]=(byte)i; if(sha1_32(buf)==-1372749050){break;} }
  103 + for(i=-28;i<-12;i++){ buf[93]=(byte)i; if(sha1_32(buf)==-71149010){break;} }
  104 + for(i=4;i<13;i++){ buf[94]=(byte)i; if(sha1_32(buf)==-439218140){break;} }
  105 + for(i=-84;i<-70;i++){ buf[95]=(byte)i; if(sha1_32(buf)==56184702){break;} }
  106 + for(i=68;i<83;i++){ buf[96]=(byte)i; if(sha1_32(buf)==-716429757){break;} }
  107 + for(i=55;i<61;i++){ buf[97]=(byte)i; if(sha1_32(buf)==-247943948){break;} }
  108 + for(i=-23;i<1;i++){ buf[98]=(byte)i; if(sha1_32(buf)==1746476796){break;} }
  109 + for(i=-61;i<-46;i++){ buf[99]=(byte)i; if(sha1_32(buf)==1177060452){break;} }
  110 + for(i=-113;i<-95;i++){ buf[100]=(byte)i; if(sha1_32(buf)==898465393){break;} }
  111 + for(i=-55;i<-48;i++){ buf[101]=(byte)i; if(sha1_32(buf)==-656093597){break;} }
  112 + for(i=54;i<73;i++){ buf[102]=(byte)i; if(sha1_32(buf)==1623749862){break;} }
  113 + for(i=11;i<22;i++){ buf[103]=(byte)i; if(sha1_32(buf)==-1388212035){break;} }
  114 + for(i=106;i<122;i++){ buf[104]=(byte)i; if(sha1_32(buf)==1605688897){break;} }
  115 + for(i=-13;i<2;i++){ buf[105]=(byte)i; if(sha1_32(buf)==74042793){break;} }
  116 + for(i=33;i<56;i++){ buf[106]=(byte)i; if(sha1_32(buf)==-1443372015){break;} }
  117 + for(i=-7;i<-1;i++){ buf[107]=(byte)i; if(sha1_32(buf)==-1815059456){break;} }
  118 + for(i=6;i<21;i++){ buf[108]=(byte)i; if(sha1_32(buf)==1631820358){break;} }
  119 + for(i=19;i<33;i++){ buf[109]=(byte)i; if(sha1_32(buf)==-1383772869){break;} }
  120 + for(i=70;i<86;i++){ buf[110]=(byte)i; if(sha1_32(buf)==1806519799){break;} }
  121 + for(i=-55;i<-33;i++){ buf[111]=(byte)i; if(sha1_32(buf)==-1197195816){break;} }
  122 + for(i=-101;i<-95;i++){ buf[112]=(byte)i; if(sha1_32(buf)==-740873967){break;} }
  123 + for(i=-86;i<-58;i++){ buf[113]=(byte)i; if(sha1_32(buf)==457977614){break;} }
  124 + for(i=104;i<128;i++){ buf[114]=(byte)i; if(sha1_32(buf)==153335124){break;} }
  125 + for(i=-30;i<-6;i++){ buf[115]=(byte)i; if(sha1_32(buf)==-1158505703){break;} }
  126 + for(i=-122;i<-108;i++){ buf[116]=(byte)i; if(sha1_32(buf)==-1520351565){break;} }
  127 + for(i=26;i<40;i++){ buf[117]=(byte)i; if(sha1_32(buf)==-1885717297){break;} }
  128 + for(i=-11;i<14;i++){ buf[118]=(byte)i; if(sha1_32(buf)==34565569){break;} }
  129 + for(i=125;i<128;i++){ buf[119]=(byte)i; if(sha1_32(buf)==2118348766){break;} }
  130 + for(i=-31;i<-5;i++){ buf[120]=(byte)i; if(sha1_32(buf)==1343444600){break;} }
  131 + for(i=84;i<95;i++){ buf[121]=(byte)i; if(sha1_32(buf)==482927565){break;} }
  132 + for(i=-17;i<-1;i++){ buf[122]=(byte)i; if(sha1_32(buf)==-573315349){break;} }
  133 + for(i=62;i<91;i++){ buf[123]=(byte)i; if(sha1_32(buf)==-887072109){break;} }
  134 + for(i=-65;i<-57;i++){ buf[124]=(byte)i; if(sha1_32(buf)==97027370){break;} }
  135 + for(i=72;i<96;i++){ buf[125]=(byte)i; if(sha1_32(buf)==815446864){break;} }
  136 + for(i=87;i<115;i++){ buf[126]=(byte)i; if(sha1_32(buf)==570487743){break;} }
  137 + for(i=-52;i<-24;i++){ buf[127]=(byte)i; if(sha1_32(buf)==184712765){break;} }
  138 + for(i=-70;i<-60;i++){ buf[128]=(byte)i; if(sha1_32(buf)==1339509491){break;} }
  139 + for(i=-60;i<-54;i++){ buf[129]=(byte)i; if(sha1_32(buf)==848480842){break;} }
  140 + for(i=57;i<80;i++){ buf[130]=(byte)i; if(sha1_32(buf)==632905579){break;} }
  141 + for(i=-110;i<-101;i++){ buf[131]=(byte)i; if(sha1_32(buf)==-644702759){break;} }
  142 + for(i=-80;i<-64;i++){ buf[132]=(byte)i; if(sha1_32(buf)==1037221862){break;} }
  143 + for(i=-48;i<-35;i++){ buf[133]=(byte)i; if(sha1_32(buf)==-1909092798){break;} }
  144 + for(i=-65;i<-52;i++){ buf[134]=(byte)i; if(sha1_32(buf)==-1846427147){break;} }
  145 + for(i=-99;i<-79;i++){ buf[135]=(byte)i; if(sha1_32(buf)==1744715041){break;} }
  146 + for(i=77;i<90;i++){ buf[136]=(byte)i; if(sha1_32(buf)==-717680274){break;} }
  147 + for(i=121;i<128;i++){ buf[137]=(byte)i; if(sha1_32(buf)==-816360884){break;} }
  148 + for(i=109;i<119;i++){ buf[138]=(byte)i; if(sha1_32(buf)==1423552417){break;} }
  149 + for(i=96;i<119;i++){ buf[139]=(byte)i; if(sha1_32(buf)==-1297199044){break;} }
  150 + for(i=-37;i<-24;i++){ buf[140]=(byte)i; if(sha1_32(buf)==-257160533){break;} }
  151 + for(i=-87;i<-73;i++){ buf[141]=(byte)i; if(sha1_32(buf)==-1124965680){break;} }
  152 + for(i=-4;i<25;i++){ buf[142]=(byte)i; if(sha1_32(buf)==-1651474985){break;} }
  153 + for(i=-18;i<-10;i++){ buf[143]=(byte)i; if(sha1_32(buf)==1868357429){break;} }
  154 + for(i=75;i<97;i++){ buf[144]=(byte)i; if(sha1_32(buf)==-2012358088){break;} }
  155 + for(i=-116;i<-107;i++){ buf[145]=(byte)i; if(sha1_32(buf)==-263709464){break;} }
  156 + for(i=-20;i<6;i++){ buf[146]=(byte)i; if(sha1_32(buf)==526440419){break;} }
  157 + for(i=-5;i<7;i++){ buf[147]=(byte)i; if(sha1_32(buf)==-1976609973){break;} }
  158 + for(i=-60;i<-32;i++){ buf[148]=(byte)i; if(sha1_32(buf)==1766008377){break;} }
  159 + for(i=-37;i<-18;i++){ buf[149]=(byte)i; if(sha1_32(buf)==1209593613){break;} }
  160 + for(i=77;i<93;i++){ buf[150]=(byte)i; if(sha1_32(buf)==-532676351){break;} }
  161 + for(i=-128;i<-115;i++){ buf[151]=(byte)i; if(sha1_32(buf)==887668666){break;} }
  162 + for(i=-64;i<-44;i++){ buf[152]=(byte)i; if(sha1_32(buf)==523941899){break;} }
  163 + for(i=-48;i<-37;i++){ buf[153]=(byte)i; if(sha1_32(buf)==-1253473596){break;} }
  164 + for(i=40;i<44;i++){ buf[154]=(byte)i; if(sha1_32(buf)==-1844656960){break;} }
  165 + for(i=93;i<115;i++){ buf[155]=(byte)i; if(sha1_32(buf)==-1201973078){break;} }
  166 + for(i=-47;i<-27;i++){ buf[156]=(byte)i; if(sha1_32(buf)==1451795337){break;} }
  167 + for(i=-28;i<-11;i++){ buf[157]=(byte)i; if(sha1_32(buf)==1618568638){break;} }
  168 + for(i=-128;i<-112;i++){ buf[158]=(byte)i; if(sha1_32(buf)==-1035459845){break;} }
  169 + for(i=-75;i<-57;i++){ buf[159]=(byte)i; if(sha1_32(buf)==677751476){break;} }
  170 + for(i=-64;i<-41;i++){ buf[160]=(byte)i; if(sha1_32(buf)==557836020){break;} }
  171 + for(i=-123;i<-101;i++){ buf[161]=(byte)i; if(sha1_32(buf)==-364153946){break;} }
  172 + for(i=13;i<27;i++){ buf[162]=(byte)i; if(sha1_32(buf)==-1853023847){break;} }
  173 + for(i=41;i<60;i++){ buf[163]=(byte)i; if(sha1_32(buf)==-713079012){break;} }
  174 + for(i=78;i<94;i++){ buf[164]=(byte)i; if(sha1_32(buf)==-399447991){break;} }
  175 + for(i=-128;i<-114;i++){ buf[165]=(byte)i; if(sha1_32(buf)==-529895527){break;} }
  176 + for(i=53;i<67;i++){ buf[166]=(byte)i; if(sha1_32(buf)==560242306){break;} }
  177 + for(i=-112;i<-102;i++){ buf[167]=(byte)i; if(sha1_32(buf)==-236696044){break;} }
  178 + for(i=-1;i<10;i++){ buf[168]=(byte)i; if(sha1_32(buf)==157166){break;} }
  179 + for(i=-128;i<-125;i++){ buf[169]=(byte)i; if(sha1_32(buf)==1388722856){break;} }
  180 + for(i=67;i<90;i++){ buf[170]=(byte)i; if(sha1_32(buf)==-55710345){break;} }
  181 + for(i=-82;i<-59;i++){ buf[171]=(byte)i; if(sha1_32(buf)==926910257){break;} }
  182 + for(i=-5;i<3;i++){ buf[172]=(byte)i; if(sha1_32(buf)==-789404335){break;} }
  183 + for(i=24;i<27;i++){ buf[173]=(byte)i; if(sha1_32(buf)==-490406185){break;} }
  184 + for(i=20;i<40;i++){ buf[174]=(byte)i; if(sha1_32(buf)==-1372370744){break;} }
  185 + for(i=-20;i<0;i++){ buf[175]=(byte)i; if(sha1_32(buf)==980088688){break;} }
  186 + for(i=-114;i<-86;i++){ buf[176]=(byte)i; if(sha1_32(buf)==-998548255){break;} }
  187 + for(i=38;i<59;i++){ buf[177]=(byte)i; if(sha1_32(buf)==-131763501){break;} }
  188 + for(i=-105;i<-76;i++){ buf[178]=(byte)i; if(sha1_32(buf)==1394850591){break;} }
  189 + for(i=109;i<128;i++){ buf[179]=(byte)i; if(sha1_32(buf)==-1354080173){break;} }
  190 + for(i=-54;i<-41;i++){ buf[180]=(byte)i; if(sha1_32(buf)==-828282431){break;} }
  191 + for(i=106;i<121;i++){ buf[181]=(byte)i; if(sha1_32(buf)==-245782807){break;} }
  192 + for(i=-116;i<-102;i++){ buf[182]=(byte)i; if(sha1_32(buf)==-1384618283){break;} }
  193 + for(i=-63;i<-45;i++){ buf[183]=(byte)i; if(sha1_32(buf)==-2006075939){break;} }
  194 + for(i=-121;i<-95;i++){ buf[184]=(byte)i; if(sha1_32(buf)==-321266659){break;} }
  195 + for(i=16;i<42;i++){ buf[185]=(byte)i; if(sha1_32(buf)==-847036441){break;} }
  196 + for(i=-56;i<-35;i++){ buf[186]=(byte)i; if(sha1_32(buf)==-913222534){break;} }
  197 + for(i=90;i<111;i++){ buf[187]=(byte)i; if(sha1_32(buf)==75305619){break;} }
  198 + for(i=121;i<128;i++){ buf[188]=(byte)i; if(sha1_32(buf)==-1053634106){break;} }
  199 + for(i=-94;i<-89;i++){ buf[189]=(byte)i; if(sha1_32(buf)==-402944795){break;} }
  200 + for(i=119;i<128;i++){ buf[190]=(byte)i; if(sha1_32(buf)==-1583243999){break;} }
  201 + for(i=98;i<119;i++){ buf[191]=(byte)i; if(sha1_32(buf)==-261411541){break;} }
  202 + for(i=-58;i<-46;i++){ buf[192]=(byte)i; if(sha1_32(buf)==1145212668){break;} }
  203 + for(i=33;i<46;i++){ buf[193]=(byte)i; if(sha1_32(buf)==742953167){break;} }
  204 + for(i=-32;i<-24;i++){ buf[194]=(byte)i; if(sha1_32(buf)==-1255191914){break;} }
  205 + for(i=95;i<104;i++){ buf[195]=(byte)i; if(sha1_32(buf)==470407521){break;} }
  206 + for(i=27;i<42;i++){ buf[196]=(byte)i; if(sha1_32(buf)==1487319900){break;} }
  207 + for(i=-23;i<-13;i++){ buf[197]=(byte)i; if(sha1_32(buf)==-1279051846){break;} }
  208 + for(i=4;i<25;i++){ buf[198]=(byte)i; if(sha1_32(buf)==-1789858936){break;} }
  209 + for(i=-113;i<-108;i++){ buf[199]=(byte)i; if(sha1_32(buf)==1279702722){break;} }
  210 + for(i=-6;i<8;i++){ buf[200]=(byte)i; if(sha1_32(buf)==1784624535){break;} }
  211 + for(i=61;i<74;i++){ buf[201]=(byte)i; if(sha1_32(buf)==149602609){break;} }
  212 + for(i=3;i<10;i++){ buf[202]=(byte)i; if(sha1_32(buf)==-1686299286){break;} }
  213 + for(i=-63;i<-32;i++){ buf[203]=(byte)i; if(sha1_32(buf)==1103026669){break;} }
  214 + for(i=101;i<111;i++){ buf[204]=(byte)i; if(sha1_32(buf)==-428129682){break;} }
  215 + for(i=-77;i<-54;i++){ buf[205]=(byte)i; if(sha1_32(buf)==645289761){break;} }
  216 + for(i=-94;i<-86;i++){ buf[206]=(byte)i; if(sha1_32(buf)==1684406648){break;} }
  217 + for(i=75;i<99;i++){ buf[207]=(byte)i; if(sha1_32(buf)==-1801758234){break;} }
  218 + for(i=-78;i<-57;i++){ buf[208]=(byte)i; if(sha1_32(buf)==-2115357439){break;} }
  219 + for(i=-48;i<-37;i++){ buf[209]=(byte)i; if(sha1_32(buf)==-1467798297){break;} }
  220 + for(i=96;i<113;i++){ buf[210]=(byte)i; if(sha1_32(buf)==1740282272){break;} }
  221 + for(i=-34;i<-23;i++){ buf[211]=(byte)i; if(sha1_32(buf)==-1940612222){break;} }
  222 + for(i=-101;i<-82;i++){ buf[212]=(byte)i; if(sha1_32(buf)==100813956){break;} }
  223 + for(i=80;i<97;i++){ buf[213]=(byte)i; if(sha1_32(buf)==228259109){break;} }
  224 + for(i=-108;i<-98;i++){ buf[214]=(byte)i; if(sha1_32(buf)==1039509614){break;} }
  225 + for(i=53;i<79;i++){ buf[215]=(byte)i; if(sha1_32(buf)==1842179274){break;} }
  226 + for(i=102;i<120;i++){ buf[216]=(byte)i; if(sha1_32(buf)==-1115982330){break;} }
  227 + for(i=-63;i<-55;i++){ buf[217]=(byte)i; if(sha1_32(buf)==1779733582){break;} }
  228 + for(i=-45;i<-43;i++){ buf[218]=(byte)i; if(sha1_32(buf)==914332805){break;} }
  229 + for(i=-58;i<-48;i++){ buf[219]=(byte)i; if(sha1_32(buf)==1032608561){break;} }
  230 + for(i=-37;i<-32;i++){ buf[220]=(byte)i; if(sha1_32(buf)==1712594732){break;} }
  231 + for(i=-25;i<-13;i++){ buf[221]=(byte)i; if(sha1_32(buf)==-127630285){break;} }
  232 + for(i=48;i<54;i++){ buf[222]=(byte)i; if(sha1_32(buf)==-140337514){break;} }
  233 + for(i=-119;i<-108;i++){ buf[223]=(byte)i; if(sha1_32(buf)==-1982205800){break;} }
  234 + for(i=51;i<68;i++){ buf[224]=(byte)i; if(sha1_32(buf)==-1799245280){break;} }
  235 + for(i=-39;i<-19;i++){ buf[225]=(byte)i; if(sha1_32(buf)==1391253401){break;} }
  236 + for(i=-113;i<-94;i++){ buf[226]=(byte)i; if(sha1_32(buf)==-1950434640){break;} }
  237 + for(i=0;i<12;i++){ buf[227]=(byte)i; if(sha1_32(buf)==63768247){break;} }
  238 + for(i=49;i<63;i++){ buf[228]=(byte)i; if(sha1_32(buf)==-524498088){break;} }
  239 + for(i=-32;i<-16;i++){ buf[229]=(byte)i; if(sha1_32(buf)==-1924310378){break;} }
  240 + for(i=-109;i<-99;i++){ buf[230]=(byte)i; if(sha1_32(buf)==-439376361){break;} }
  241 + for(i=108;i<123;i++){ buf[231]=(byte)i; if(sha1_32(buf)==2001210056){break;} }
  242 + for(i=112;i<119;i++){ buf[232]=(byte)i; if(sha1_32(buf)==335350537){break;} }
  243 + for(i=40;i<71;i++){ buf[233]=(byte)i; if(sha1_32(buf)==1199825099){break;} }
  244 + for(i=-115;i<-112;i++){ buf[234]=(byte)i; if(sha1_32(buf)==1149669169){break;} }
  245 + for(i=-25;i<-8;i++){ buf[235]=(byte)i; if(sha1_32(buf)==-1374234612){break;} }
  246 + for(i=-72;i<-52;i++){ buf[236]=(byte)i; if(sha1_32(buf)==-670730360){break;} }
  247 + for(i=110;i<126;i++){ buf[237]=(byte)i; if(sha1_32(buf)==92982535){break;} }
  248 + for(i=-65;i<-35;i++){ buf[238]=(byte)i; if(sha1_32(buf)==-1830168430){break;} }
  249 + for(i=-99;i<-91;i++){ buf[239]=(byte)i; if(sha1_32(buf)==96401034){break;} }
  250 + for(i=-62;i<-46;i++){ buf[240]=(byte)i; if(sha1_32(buf)==268500425){break;} }
  251 + for(i=50;i<56;i++){ buf[241]=(byte)i; if(sha1_32(buf)==198725117){break;} }
  252 + for(i=-61;i<-40;i++){ buf[242]=(byte)i; if(sha1_32(buf)==-1787380362){break;} }
  253 + for(i=30;i<43;i++){ buf[243]=(byte)i; if(sha1_32(buf)==-1283696660){break;} }
  254 + for(i=-63;i<-39;i++){ buf[244]=(byte)i; if(sha1_32(buf)==1839833326){break;} }
  255 + for(i=11;i<17;i++){ buf[245]=(byte)i; if(sha1_32(buf)==840818561){break;} }
  256 + for(i=-91;i<-83;i++){ buf[246]=(byte)i; if(sha1_32(buf)==-1030118836){break;} }
  257 + for(i=-4;i<11;i++){ buf[247]=(byte)i; if(sha1_32(buf)==-968590522){break;} }
  258 + for(i=51;i<61;i++){ buf[248]=(byte)i; if(sha1_32(buf)==-933513505){break;} }
  259 + for(i=48;i<53;i++){ buf[249]=(byte)i; if(sha1_32(buf)==-1233465936){break;} }
  260 + for(i=-2;i<4;i++){ buf[250]=(byte)i; if(sha1_32(buf)==-901032040){break;} }
  261 + for(i=-125;i<-106;i++){ buf[251]=(byte)i; if(sha1_32(buf)==1401445935){break;} }
  262 + for(i=77;i<87;i++){ buf[252]=(byte)i; if(sha1_32(buf)==668849818){break;} }
  263 + for(i=-18;i<7;i++){ buf[253]=(byte)i; if(sha1_32(buf)==-177296194){break;} }
  264 + for(i=-58;i<-51;i++){ buf[254]=(byte)i; if(sha1_32(buf)==-1973172295){break;} }
  265 + for(i=-69;i<-52;i++){ buf[255]=(byte)i; if(sha1_32(buf)==-208162370){break;} }
  266 + for(i=13;i<15;i++){ buf[256]=(byte)i; if(sha1_32(buf)==1347805561){break;} }
  267 + for(i=-28;i<-14;i++){ buf[257]=(byte)i; if(sha1_32(buf)==-2084518264){break;} }
  268 + for(i=-25;i<-5;i++){ buf[258]=(byte)i; if(sha1_32(buf)==1993570847){break;} }
  269 + for(i=-76;i<-66;i++){ buf[259]=(byte)i; if(sha1_32(buf)==-935509523){break;} }
  270 + for(i=24;i<35;i++){ buf[260]=(byte)i; if(sha1_32(buf)==112474446){break;} }
  271 + for(i=109;i<126;i++){ buf[261]=(byte)i; if(sha1_32(buf)==-1297366212){break;} }
  272 + for(i=88;i<106;i++){ buf[262]=(byte)i; if(sha1_32(buf)==338729316){break;} }
  273 + for(i=91;i<115;i++){ buf[263]=(byte)i; if(sha1_32(buf)==-267333354){break;} }
  274 + for(i=-61;i<-55;i++){ buf[264]=(byte)i; if(sha1_32(buf)==880088732){break;} }
  275 + for(i=9;i<24;i++){ buf[265]=(byte)i; if(sha1_32(buf)==623140631){break;} }
  276 + for(i=-10;i<6;i++){ buf[266]=(byte)i; if(sha1_32(buf)==623140631){break;} }
  277 + for(i=82;i<102;i++){ buf[267]=(byte)i; if(sha1_32(buf)==1195810338){break;} }
  278 + for(i=119;i<128;i++){ buf[268]=(byte)i; if(sha1_32(buf)==-2034614349){break;} }
  279 + for(i=-10;i<-1;i++){ buf[269]=(byte)i; if(sha1_32(buf)==-862145325){break;} }
  280 + for(i=-117;i<-88;i++){ buf[270]=(byte)i; if(sha1_32(buf)==-19749693){break;} }
  281 + for(i=-115;i<-107;i++){ buf[271]=(byte)i; if(sha1_32(buf)==192112580){break;} }
  282 + for(i=-88;i<-70;i++){ buf[272]=(byte)i; if(sha1_32(buf)==1386559839){break;} }
  283 + for(i=2;i<7;i++){ buf[273]=(byte)i; if(sha1_32(buf)==736786231){break;} }
  284 + for(i=28;i<41;i++){ buf[274]=(byte)i; if(sha1_32(buf)==-306335518){break;} }
  285 + for(i=45;i<59;i++){ buf[275]=(byte)i; if(sha1_32(buf)==-2138012495){break;} }
  286 + for(i=9;i<25;i++){ buf[276]=(byte)i; if(sha1_32(buf)==1044901641){break;} }
  287 + for(i=-53;i<-36;i++){ buf[277]=(byte)i; if(sha1_32(buf)==1923190960){break;} }
  288 + for(i=54;i<65;i++){ buf[278]=(byte)i; if(sha1_32(buf)==-1008867744){break;} }
  289 + for(i=-64;i<-53;i++){ buf[279]=(byte)i; if(sha1_32(buf)==-774020964){break;} }
  290 + for(i=-7;i<-6;i++){ buf[280]=(byte)i; if(sha1_32(buf)==226805004){break;} }
  291 + for(i=-121;i<-94;i++){ buf[281]=(byte)i; if(sha1_32(buf)==-171118540){break;} }
  292 + for(i=66;i<91;i++){ buf[282]=(byte)i; if(sha1_32(buf)==-673022003){break;} }
  293 + for(i=45;i<61;i++){ buf[283]=(byte)i; if(sha1_32(buf)==229107163){break;} }
  294 + for(i=114;i<124;i++){ buf[284]=(byte)i; if(sha1_32(buf)==-1114126897){break;} }
  295 + for(i=-8;i<4;i++){ buf[285]=(byte)i; if(sha1_32(buf)==-1028162051){break;} }
  296 + for(i=111;i<115;i++){ buf[286]=(byte)i; if(sha1_32(buf)==-992740296){break;} }
  297 + for(i=-108;i<-93;i++){ buf[287]=(byte)i; if(sha1_32(buf)==-791082205){break;} }
  298 + for(i=-121;i<-107;i++){ buf[288]=(byte)i; if(sha1_32(buf)==-823010710){break;} }
  299 + for(i=-68;i<-62;i++){ buf[289]=(byte)i; if(sha1_32(buf)==-244206690){break;} }
  300 + for(i=-56;i<-39;i++){ buf[290]=(byte)i; if(sha1_32(buf)==911614492){break;} }
  301 + for(i=-81;i<-51;i++){ buf[291]=(byte)i; if(sha1_32(buf)==1460819513){break;} }
  302 + for(i=-71;i<-57;i++){ buf[292]=(byte)i; if(sha1_32(buf)==1334953191){break;} }
  303 + for(i=19;i<38;i++){ buf[293]=(byte)i; if(sha1_32(buf)==-1821620999){break;} }
  304 + for(i=-85;i<-69;i++){ buf[294]=(byte)i; if(sha1_32(buf)==1355767675){break;} }
  305 + for(i=74;i<102;i++){ buf[295]=(byte)i; if(sha1_32(buf)==1143459566){break;} }
  306 + for(i=105;i<118;i++){ buf[296]=(byte)i; if(sha1_32(buf)==-1408305208){break;} }
  307 + for(i=-125;i<-114;i++){ buf[297]=(byte)i; if(sha1_32(buf)==600567065){break;} }
  308 + for(i=-109;i<-96;i++){ buf[298]=(byte)i; if(sha1_32(buf)==-2001836571){break;} }
  309 + for(i=-95;i<-79;i++){ buf[299]=(byte)i; if(sha1_32(buf)==847323478){break;} }
  310 + for(i=-113;i<-97;i++){ buf[300]=(byte)i; if(sha1_32(buf)==-1014888205){break;} }
  311 + for(i=68;i<91;i++){ buf[301]=(byte)i; if(sha1_32(buf)==125250210){break;} }
  312 + for(i=-94;i<-86;i++){ buf[302]=(byte)i; if(sha1_32(buf)==-329214136){break;} }
  313 + for(i=74;i<90;i++){ buf[303]=(byte)i; if(sha1_32(buf)==-553691710){break;} }
  314 + for(i=11;i<16;i++){ buf[304]=(byte)i; if(sha1_32(buf)==-1126512818){break;} }
  315 + for(i=-122;i<-103;i++){ buf[305]=(byte)i; if(sha1_32(buf)==-463956902){break;} }
  316 + for(i=-76;i<-50;i++){ buf[306]=(byte)i; if(sha1_32(buf)==1642642556){break;} }
  317 + for(i=-98;i<-75;i++){ buf[307]=(byte)i; if(sha1_32(buf)==102115368){break;} }
  318 + for(i=24;i<48;i++){ buf[308]=(byte)i; if(sha1_32(buf)==-738084413){break;} }
  319 + for(i=112;i<125;i++){ buf[309]=(byte)i; if(sha1_32(buf)==-1826214285){break;} }
  320 + for(i=-95;i<-75;i++){ buf[310]=(byte)i; if(sha1_32(buf)==418463777){break;} }
  321 + for(i=-31;i<-11;i++){ buf[311]=(byte)i; if(sha1_32(buf)==1588644779){break;} }
  322 + for(i=95;i<114;i++){ buf[312]=(byte)i; if(sha1_32(buf)==1955993998){break;} }
  323 + for(i=48;i<63;i++){ buf[313]=(byte)i; if(sha1_32(buf)==533524947){break;} }
  324 + for(i=-106;i<-100;i++){ buf[314]=(byte)i; if(sha1_32(buf)==776241837){break;} }
  325 + for(i=39;i<61;i++){ buf[315]=(byte)i; if(sha1_32(buf)==786512856){break;} }
  326 + for(i=-38;i<-26;i++){ buf[316]=(byte)i; if(sha1_32(buf)==624413454){break;} }
  327 + for(i=-5;i<17;i++){ buf[317]=(byte)i; if(sha1_32(buf)==-1992243122){break;} }
  328 + for(i=2;i<25;i++){ buf[318]=(byte)i; if(sha1_32(buf)==1624129640){break;} }
  329 + for(i=66;i<78;i++){ buf[319]=(byte)i; if(sha1_32(buf)==-1609121773){break;} }
  330 + for(i=-80;i<-60;i++){ buf[320]=(byte)i; if(sha1_32(buf)==-1543176179){break;} }
  331 + for(i=-85;i<-67;i++){ buf[321]=(byte)i; if(sha1_32(buf)==1727845517){break;} }
  332 + for(i=8;i<29;i++){ buf[322]=(byte)i; if(sha1_32(buf)==1295717331){break;} }
  333 + for(i=3;i<16;i++){ buf[323]=(byte)i; if(sha1_32(buf)==1691608951){break;} }
  334 + for(i=-53;i<-24;i++){ buf[324]=(byte)i; if(sha1_32(buf)==1884306112){break;} }
  335 + for(i=48;i<67;i++){ buf[325]=(byte)i; if(sha1_32(buf)==1212361245){break;} }
  336 + for(i=-121;i<-99;i++){ buf[326]=(byte)i; if(sha1_32(buf)==1180206153){break;} }
  337 + for(i=-17;i<8;i++){ buf[327]=(byte)i; if(sha1_32(buf)==-2460743){break;} }
  338 + for(i=62;i<68;i++){ buf[328]=(byte)i; if(sha1_32(buf)==-402346103){break;} }
  339 + for(i=-90;i<-68;i++){ buf[329]=(byte)i; if(sha1_32(buf)==1714528977){break;} }
  340 + for(i=-80;i<-69;i++){ buf[330]=(byte)i; if(sha1_32(buf)==1777689203){break;} }
  341 + for(i=34;i<35;i++){ buf[331]=(byte)i; if(sha1_32(buf)==-1202977605){break;} }
  342 + for(i=55;i<59;i++){ buf[332]=(byte)i; if(sha1_32(buf)==669173026){break;} }
  343 + for(i=-52;i<-48;i++){ buf[333]=(byte)i; if(sha1_32(buf)==640080540){break;} }
  344 + for(i=61;i<72;i++){ buf[334]=(byte)i; if(sha1_32(buf)==1824153619){break;} }
  345 + for(i=-9;i<16;i++){ buf[335]=(byte)i; if(sha1_32(buf)==1822383395){break;} }
  346 + for(i=-2;i<24;i++){ buf[336]=(byte)i; if(sha1_32(buf)==1025638548){break;} }
  347 + for(i=-116;i<-88;i++){ buf[337]=(byte)i; if(sha1_32(buf)==634184322){break;} }
  348 + for(i=0;i<9;i++){ buf[338]=(byte)i; if(sha1_32(buf)==1136149430){break;} }
  349 + for(i=-14;i<3;i++){ buf[339]=(byte)i; if(sha1_32(buf)==1678286422){break;} }
  350 + for(i=-72;i<-56;i++){ buf[340]=(byte)i; if(sha1_32(buf)==1615974753){break;} }
  351 + for(i=-15;i<-2;i++){ buf[341]=(byte)i; if(sha1_32(buf)==1578228752){break;} }
  352 + for(i=-121;i<-102;i++){ buf[342]=(byte)i; if(sha1_32(buf)==-511799071){break;} }
  353 + for(i=-84;i<-70;i++){ buf[343]=(byte)i; if(sha1_32(buf)==185376009){break;} }
  354 + for(i=-128;i<-116;i++){ buf[344]=(byte)i; if(sha1_32(buf)==1032961404){break;} }
  355 + for(i=92;i<106;i++){ buf[345]=(byte)i; if(sha1_32(buf)==377530681){break;} }
  356 + for(i=-8;i<1;i++){ buf[346]=(byte)i; if(sha1_32(buf)==1651252799){break;} }
  357 + for(i=29;i<45;i++){ buf[347]=(byte)i; if(sha1_32(buf)==-542761336){break;} }
  358 + for(i=-84;i<-74;i++){ buf[348]=(byte)i; if(sha1_32(buf)==471011576){break;} }
  359 + for(i=-32;i<-5;i++){ buf[349]=(byte)i; if(sha1_32(buf)==846454382){break;} }
  360 + for(i=100;i<123;i++){ buf[350]=(byte)i; if(sha1_32(buf)==-1907007410){break;} }
  361 + for(i=80;i<103;i++){ buf[351]=(byte)i; if(sha1_32(buf)==1745165720){break;} }
  362 + for(i=85;i<101;i++){ buf[352]=(byte)i; if(sha1_32(buf)==-84585343){break;} }
  363 + for(i=-74;i<-48;i++){ buf[353]=(byte)i; if(sha1_32(buf)==-1912530513){break;} }
  364 + for(i=27;i<56;i++){ buf[354]=(byte)i; if(sha1_32(buf)==857859445){break;} }
  365 + for(i=34;i<52;i++){ buf[355]=(byte)i; if(sha1_32(buf)==-1155079315){break;} }
  366 + for(i=93;i<110;i++){ buf[356]=(byte)i; if(sha1_32(buf)==-1925930555){break;} }
  367 + for(i=-75;i<-65;i++){ buf[357]=(byte)i; if(sha1_32(buf)==-687305261){break;} }
  368 + for(i=-61;i<-53;i++){ buf[358]=(byte)i; if(sha1_32(buf)==-1526326443){break;} }
  369 + for(i=95;i<107;i++){ buf[359]=(byte)i; if(sha1_32(buf)==-2078438685){break;} }
  370 + for(i=-39;i<-27;i++){ buf[360]=(byte)i; if(sha1_32(buf)==-1543846085){break;} }
  371 + for(i=13;i<26;i++){ buf[361]=(byte)i; if(sha1_32(buf)==19422004){break;} }
  372 + for(i=-76;i<-69;i++){ buf[362]=(byte)i; if(sha1_32(buf)==-279372373){break;} }
  373 + for(i=18;i<25;i++){ buf[363]=(byte)i; if(sha1_32(buf)==740299287){break;} }
  374 + for(i=-41;i<-26;i++){ buf[364]=(byte)i; if(sha1_32(buf)==1474408721){break;} }
  375 + for(i=60;i<78;i++){ buf[365]=(byte)i; if(sha1_32(buf)==-1855469950){break;} }
  376 + for(i=-52;i<-43;i++){ buf[366]=(byte)i; if(sha1_32(buf)==1630525958){break;} }
  377 + for(i=-102;i<-80;i++){ buf[367]=(byte)i; if(sha1_32(buf)==1102203459){break;} }
  378 + for(i=-90;i<-85;i++){ buf[368]=(byte)i; if(sha1_32(buf)==409716612){break;} }
  379 + for(i=117;i<128;i++){ buf[369]=(byte)i; if(sha1_32(buf)==-25857084){break;} }
  380 + for(i=-81;i<-65;i++){ buf[370]=(byte)i; if(sha1_32(buf)==-1298915938){break;} }
  381 + for(i=-82;i<-75;i++){ buf[371]=(byte)i; if(sha1_32(buf)==750720493){break;} }
  382 + for(i=-128;i<-111;i++){ buf[372]=(byte)i; if(sha1_32(buf)==1086400582){break;} }
  383 + for(i=18;i<36;i++){ buf[373]=(byte)i; if(sha1_32(buf)==-1927994188){break;} }
  384 + for(i=-107;i<-89;i++){ buf[374]=(byte)i; if(sha1_32(buf)==-534720583){break;} }
  385 + for(i=-7;i<17;i++){ buf[375]=(byte)i; if(sha1_32(buf)==1204634911){break;} }
  386 + for(i=-122;i<-110;i++){ buf[376]=(byte)i; if(sha1_32(buf)==174539323){break;} }
  387 + for(i=119;i<128;i++){ buf[377]=(byte)i; if(sha1_32(buf)==1114955726){break;} }
  388 + for(i=-76;i<-67;i++){ buf[378]=(byte)i; if(sha1_32(buf)==-237844818){break;} }
  389 + for(i=-97;i<-78;i++){ buf[379]=(byte)i; if(sha1_32(buf)==967352862){break;} }
  390 + for(i=-120;i<-107;i++){ buf[380]=(byte)i; if(sha1_32(buf)==-684638680){break;} }
  391 + for(i=-48;i<-28;i++){ buf[381]=(byte)i; if(sha1_32(buf)==-505104165){break;} }
  392 + for(i=-108;i<-99;i++){ buf[382]=(byte)i; if(sha1_32(buf)==-1291930280){break;} }
  393 + for(i=-15;i<2;i++){ buf[383]=(byte)i; if(sha1_32(buf)==277054161){break;} }
  394 + for(i=-62;i<-34;i++){ buf[384]=(byte)i; if(sha1_32(buf)==-616175923){break;} }
  395 + for(i=-23;i<-6;i++){ buf[385]=(byte)i; if(sha1_32(buf)==-950489604){break;} }
  396 + for(i=-113;i<-84;i++){ buf[386]=(byte)i; if(sha1_32(buf)==1107129029){break;} }
  397 + for(i=126;i<128;i++){ buf[387]=(byte)i; if(sha1_32(buf)==-538181099){break;} }
  398 + for(i=114;i<119;i++){ buf[388]=(byte)i; if(sha1_32(buf)==-2037193922){break;} }
  399 + for(i=75;i<105;i++){ buf[389]=(byte)i; if(sha1_32(buf)==-182513800){break;} }
  400 + for(i=90;i<97;i++){ buf[390]=(byte)i; if(sha1_32(buf)==-812020454){break;} }
  401 + for(i=-55;i<-46;i++){ buf[391]=(byte)i; if(sha1_32(buf)==-44492374){break;} }
  402 + for(i=-110;i<-83;i++){ buf[392]=(byte)i; if(sha1_32(buf)==1816459165){break;} }
  403 + for(i=108;i<117;i++){ buf[393]=(byte)i; if(sha1_32(buf)==187922115){break;} }
  404 + for(i=-103;i<-97;i++){ buf[394]=(byte)i; if(sha1_32(buf)==907949146){break;} }
  405 + for(i=88;i<101;i++){ buf[395]=(byte)i; if(sha1_32(buf)==-241323617){break;} }
  406 + for(i=-42;i<-19;i++){ buf[396]=(byte)i; if(sha1_32(buf)==113209905){break;} }
  407 + for(i=-89;i<-72;i++){ buf[397]=(byte)i; if(sha1_32(buf)==2067435953){break;} }
  408 + for(i=-99;i<-82;i++){ buf[398]=(byte)i; if(sha1_32(buf)==55736715){break;} }
  409 + for(i=-35;i<-24;i++){ buf[399]=(byte)i; if(sha1_32(buf)==-572027631){break;} }
  410 + for(i=99;i<115;i++){ buf[400]=(byte)i; if(sha1_32(buf)==489975963){break;} }
  411 + for(i=-14;i<3;i++){ buf[401]=(byte)i; if(sha1_32(buf)==-698740722){break;} }
  412 + for(i=-127;i<-113;i++){ buf[402]=(byte)i; if(sha1_32(buf)==1789566105){break;} }
  413 + for(i=42;i<46;i++){ buf[403]=(byte)i; if(sha1_32(buf)==1331901651){break;} }
  414 + for(i=-86;i<-75;i++){ buf[404]=(byte)i; if(sha1_32(buf)==1576926411){break;} }
  415 + for(i=-78;i<-62;i++){ buf[405]=(byte)i; if(sha1_32(buf)==172889634){break;} }
  416 + for(i=-128;i<-109;i++){ buf[406]=(byte)i; if(sha1_32(buf)==-1464515411){break;} }
  417 + for(i=-127;i<-107;i++){ buf[407]=(byte)i; if(sha1_32(buf)==1052444314){break;} }
  418 + for(i=-128;i<-114;i++){ buf[408]=(byte)i; if(sha1_32(buf)==1791553224){break;} }
  419 + for(i=-16;i<0;i++){ buf[409]=(byte)i; if(sha1_32(buf)==-1541546883){break;} }
  420 + for(i=8;i<28;i++){ buf[410]=(byte)i; if(sha1_32(buf)==-1764105915){break;} }
  421 + for(i=-38;i<-29;i++){ buf[411]=(byte)i; if(sha1_32(buf)==-779519121){break;} }
  422 + for(i=21;i<39;i++){ buf[412]=(byte)i; if(sha1_32(buf)==-56869024){break;} }
  423 + for(i=59;i<77;i++){ buf[413]=(byte)i; if(sha1_32(buf)==425929132){break;} }
  424 + for(i=-4;i<13;i++){ buf[414]=(byte)i; if(sha1_32(buf)==425929132){break;} }
  425 + for(i=-86;i<-70;i++){ buf[415]=(byte)i; if(sha1_32(buf)==2091378970){break;} }
  426 + for(i=-107;i<-78;i++){ buf[416]=(byte)i; if(sha1_32(buf)==715816020){break;} }
  427 + for(i=110;i<111;i++){ buf[417]=(byte)i; if(sha1_32(buf)==-332543611){break;} }
  428 + for(i=91;i<104;i++){ buf[418]=(byte)i; if(sha1_32(buf)==-946788202){break;} }
  429 + for(i=-97;i<-86;i++){ buf[419]=(byte)i; if(sha1_32(buf)==-2033175352){break;} }
  430 + for(i=-35;i<-18;i++){ buf[420]=(byte)i; if(sha1_32(buf)==-246590053){break;} }
  431 + for(i=-123;i<-110;i++){ buf[421]=(byte)i; if(sha1_32(buf)==-1382635524){break;} }
  432 + for(i=67;i<69;i++){ buf[422]=(byte)i; if(sha1_32(buf)==-1154098524){break;} }
  433 + for(i=-1;i<20;i++){ buf[423]=(byte)i; if(sha1_32(buf)==20529329){break;} }
  434 + for(i=-5;i<4;i++){ buf[424]=(byte)i; if(sha1_32(buf)==427874842){break;} }
  435 + for(i=23;i<45;i++){ buf[425]=(byte)i; if(sha1_32(buf)==1984203304){break;} }
  436 + for(i=-67;i<-59;i++){ buf[426]=(byte)i; if(sha1_32(buf)==1838578673){break;} }
  437 + for(i=102;i<119;i++){ buf[427]=(byte)i; if(sha1_32(buf)==1743854446){break;} }
  438 + for(i=6;i<30;i++){ buf[428]=(byte)i; if(sha1_32(buf)==1226065927){break;} }
  439 + for(i=-10;i<3;i++){ buf[429]=(byte)i; if(sha1_32(buf)==912871040){break;} }
  440 + for(i=-25;i<-18;i++){ buf[430]=(byte)i; if(sha1_32(buf)==1607455553){break;} }
  441 + for(i=-1;i<21;i++){ buf[431]=(byte)i; if(sha1_32(buf)==-1944738969){break;} }
  442 + for(i=-2;i<18;i++){ buf[432]=(byte)i; if(sha1_32(buf)==-1139871537){break;} }
  443 + for(i=43;i<63;i++){ buf[433]=(byte)i; if(sha1_32(buf)==1887627766){break;} }
  444 + for(i=-49;i<-24;i++){ buf[434]=(byte)i; if(sha1_32(buf)==453968429){break;} }
  445 + for(i=2;i<10;i++){ buf[435]=(byte)i; if(sha1_32(buf)==357645748){break;} }
  446 + for(i=-72;i<-57;i++){ buf[436]=(byte)i; if(sha1_32(buf)==-1726211862){break;} }
  447 + for(i=31;i<54;i++){ buf[437]=(byte)i; if(sha1_32(buf)==-68007584){break;} }
  448 + for(i=25;i<47;i++){ buf[438]=(byte)i; if(sha1_32(buf)==-95745808){break;} }
  449 + for(i=-54;i<-31;i++){ buf[439]=(byte)i; if(sha1_32(buf)==-1899274323){break;} }
  450 + for(i=-82;i<-55;i++){ buf[440]=(byte)i; if(sha1_32(buf)==850404918){break;} }
  451 + for(i=-116;i<-103;i++){ buf[441]=(byte)i; if(sha1_32(buf)==-1957213709){break;} }
  452 + for(i=-57;i<-54;i++){ buf[442]=(byte)i; if(sha1_32(buf)==1667174153){break;} }
  453 + for(i=-5;i<11;i++){ buf[443]=(byte)i; if(sha1_32(buf)==-1029321236){break;} }
  454 + for(i=-23;i<-13;i++){ buf[444]=(byte)i; if(sha1_32(buf)==77423356){break;} }
  455 + for(i=92;i<102;i++){ buf[445]=(byte)i; if(sha1_32(buf)==-1274171984){break;} }
  456 + for(i=-128;i<-110;i++){ buf[446]=(byte)i; if(sha1_32(buf)==-1234675273){break;} }
  457 + for(i=31;i<51;i++){ buf[447]=(byte)i; if(sha1_32(buf)==161226207){break;} }
  458 + for(i=107;i<128;i++){ buf[448]=(byte)i; if(sha1_32(buf)==-1943028924){break;} }
  459 + for(i=26;i<38;i++){ buf[449]=(byte)i; if(sha1_32(buf)==-1790880854){break;} }
  460 + for(i=77;i<105;i++){ buf[450]=(byte)i; if(sha1_32(buf)==1901380983){break;} }
  461 + for(i=-38;i<-26;i++){ buf[451]=(byte)i; if(sha1_32(buf)==559462581){break;} }
  462 + for(i=-50;i<-29;i++){ buf[452]=(byte)i; if(sha1_32(buf)==1643976942){break;} }
  463 + for(i=55;i<72;i++){ buf[453]=(byte)i; if(sha1_32(buf)==-956745419){break;} }
  464 + for(i=-1;i<0;i++){ buf[454]=(byte)i; if(sha1_32(buf)==473268167){break;} }
  465 + for(i=-61;i<-40;i++){ buf[455]=(byte)i; if(sha1_32(buf)==1817956834){break;} }
  466 + for(i=14;i<38;i++){ buf[456]=(byte)i; if(sha1_32(buf)==373284758){break;} }
  467 + for(i=94;i<107;i++){ buf[457]=(byte)i; if(sha1_32(buf)==1452037098){break;} }
  468 + for(i=-45;i<-29;i++){ buf[458]=(byte)i; if(sha1_32(buf)==610595923){break;} }
  469 + for(i=-128;i<-110;i++){ buf[459]=(byte)i; if(sha1_32(buf)==458490632){break;} }
  470 + for(i=-120;i<-103;i++){ buf[460]=(byte)i; if(sha1_32(buf)==-95267097){break;} }
  471 + for(i=-78;i<-58;i++){ buf[461]=(byte)i; if(sha1_32(buf)==-579208817){break;} }
  472 + for(i=84;i<99;i++){ buf[462]=(byte)i; if(sha1_32(buf)==-733951747){break;} }
  473 + for(i=16;i<19;i++){ buf[463]=(byte)i; if(sha1_32(buf)==-1632302517){break;} }
  474 + for(i=-127;i<-103;i++){ buf[464]=(byte)i; if(sha1_32(buf)==-513335490){break;} }
  475 + for(i=-128;i<-98;i++){ buf[465]=(byte)i; if(sha1_32(buf)==-711711599){break;} }
  476 + for(i=-97;i<-81;i++){ buf[466]=(byte)i; if(sha1_32(buf)==-83825714){break;} }
  477 + for(i=58;i<74;i++){ buf[467]=(byte)i; if(sha1_32(buf)==889359389){break;} }
  478 + for(i=3;i<12;i++){ buf[468]=(byte)i; if(sha1_32(buf)==355751750){break;} }
  479 + for(i=20;i<43;i++){ buf[469]=(byte)i; if(sha1_32(buf)==-1028898992){break;} }
  480 + for(i=31;i<46;i++){ buf[470]=(byte)i; if(sha1_32(buf)==-1859242432){break;} }
  481 + for(i=-128;i<-110;i++){ buf[471]=(byte)i; if(sha1_32(buf)==877304689){break;} }
  482 + for(i=-68;i<-52;i++){ buf[472]=(byte)i; if(sha1_32(buf)==-2146685493){break;} }
  483 + for(i=102;i<126;i++){ buf[473]=(byte)i; if(sha1_32(buf)==-1348162367){break;} }
  484 + for(i=-56;i<-36;i++){ buf[474]=(byte)i; if(sha1_32(buf)==1856485533){break;} }
  485 + for(i=12;i<25;i++){ buf[475]=(byte)i; if(sha1_32(buf)==-503448029){break;} }
  486 + for(i=10;i<29;i++){ buf[476]=(byte)i; if(sha1_32(buf)==-3171719){break;} }
  487 + for(i=-60;i<-53;i++){ buf[477]=(byte)i; if(sha1_32(buf)==1910614362){break;} }
  488 + for(i=-96;i<-73;i++){ buf[478]=(byte)i; if(sha1_32(buf)==-2130635913){break;} }
  489 + for(i=-6;i<11;i++){ buf[479]=(byte)i; if(sha1_32(buf)==-802858346){break;} }
  490 + for(i=-128;i<-122;i++){ buf[480]=(byte)i; if(sha1_32(buf)==473346464){break;} }
  491 + for(i=24;i<40;i++){ buf[481]=(byte)i; if(sha1_32(buf)==-612014560){break;} }
  492 + for(i=7;i<25;i++){ buf[482]=(byte)i; if(sha1_32(buf)==-2095191461){break;} }
  493 + for(i=12;i<13;i++){ buf[483]=(byte)i; if(sha1_32(buf)==721606211){break;} }
  494 + for(i=82;i<103;i++){ buf[484]=(byte)i; if(sha1_32(buf)==984136015){break;} }
  495 + for(i=30;i<43;i++){ buf[485]=(byte)i; if(sha1_32(buf)==-105220005){break;} }
  496 + for(i=-2;i<14;i++){ buf[486]=(byte)i; if(sha1_32(buf)==-1652172814){break;} }
  497 + for(i=-63;i<-56;i++){ buf[487]=(byte)i; if(sha1_32(buf)==2116560115){break;} }
  498 + for(i=-63;i<-33;i++){ buf[488]=(byte)i; if(sha1_32(buf)==308886337){break;} }
  499 + for(i=120;i<122;i++){ buf[489]=(byte)i; if(sha1_32(buf)==224064501){break;} }
  500 + for(i=101;i<111;i++){ buf[490]=(byte)i; if(sha1_32(buf)==1244859591){break;} }
  501 + for(i=-121;i<-101;i++){ buf[491]=(byte)i; if(sha1_32(buf)==1357038436){break;} }
  502 + for(i=35;i<48;i++){ buf[492]=(byte)i; if(sha1_32(buf)==377355340){break;} }
  503 + for(i=80;i<85;i++){ buf[493]=(byte)i; if(sha1_32(buf)==503003140){break;} }
  504 + for(i=-27;i<-20;i++){ buf[494]=(byte)i; if(sha1_32(buf)==-1133747173){break;} }
  505 + for(i=-62;i<-35;i++){ buf[495]=(byte)i; if(sha1_32(buf)==-2078478488){break;} }
  506 + for(i=41;i<50;i++){ buf[496]=(byte)i; if(sha1_32(buf)==-559579455){break;} }
  507 + for(i=123;i<128;i++){ buf[497]=(byte)i; if(sha1_32(buf)==-485331920){break;} }
  508 + for(i=-85;i<-67;i++){ buf[498]=(byte)i; if(sha1_32(buf)==-804307943){break;} }
  509 + for(i=71;i<98;i++){ buf[499]=(byte)i; if(sha1_32(buf)==1066431810){break;} }
  510 + for(i=11;i<34;i++){ buf[500]=(byte)i; if(sha1_32(buf)==-1244557380){break;} }
  511 + for(i=-5;i<9;i++){ buf[501]=(byte)i; if(sha1_32(buf)==-1244557380){break;} }
  512 + for(i=118;i<128;i++){ buf[502]=(byte)i; if(sha1_32(buf)==341556018){break;} }
  513 + for(i=41;i<56;i++){ buf[503]=(byte)i; if(sha1_32(buf)==-4510395){break;} }
  514 + for(i=-124;i<-111;i++){ buf[504]=(byte)i; if(sha1_32(buf)==-1188338319){break;} }
  515 + for(i=-2;i<12;i++){ buf[505]=(byte)i; if(sha1_32(buf)==-1188338319){break;} }
  516 + for(i=4;i<15;i++){ buf[506]=(byte)i; if(sha1_32(buf)==350730014){break;} }
  517 + for(i=-64;i<-56;i++){ buf[507]=(byte)i; if(sha1_32(buf)==-1837119620){break;} }
  518 + for(i=-52;i<-40;i++){ buf[508]=(byte)i; if(sha1_32(buf)==-1990239896){break;} }
  519 + for(i=-30;i<-25;i++){ buf[509]=(byte)i; if(sha1_32(buf)==-937158971){break;} }
  520 + for(i=-13;i<7;i++){ buf[510]=(byte)i; if(sha1_32(buf)==-937158971){break;} }
  521 + for(i=-94;i<-77;i++){ buf[511]=(byte)i; if(sha1_32(buf)==-847141927){break;} }
  522 + for(i=-70;i<-50;i++){ buf[512]=(byte)i; if(sha1_32(buf)==-1659035288){break;} }
  523 + for(i=-128;i<-118;i++){ buf[513]=(byte)i; if(sha1_32(buf)==1180575013){break;} }
  524 + for(i=73;i<100;i++){ buf[514]=(byte)i; if(sha1_32(buf)==57755191){break;} }
  525 + for(i=-128;i<-119;i++){ buf[515]=(byte)i; if(sha1_32(buf)==1140968241){break;} }
  526 + for(i=-86;i<-62;i++){ buf[516]=(byte)i; if(sha1_32(buf)==997058755){break;} }
  527 + for(i=-88;i<-73;i++){ buf[517]=(byte)i; if(sha1_32(buf)==-942491502){break;} }
  528 + for(i=43;i<59;i++){ buf[518]=(byte)i; if(sha1_32(buf)==1059613876){break;} }
  529 + for(i=86;i<115;i++){ buf[519]=(byte)i; if(sha1_32(buf)==116084474){break;} }
  530 + for(i=24;i<37;i++){ buf[520]=(byte)i; if(sha1_32(buf)==698055700){break;} }
  531 + for(i=-6;i<9;i++){ buf[521]=(byte)i; if(sha1_32(buf)==1765018695){break;} }
  532 + for(i=-34;i<-14;i++){ buf[522]=(byte)i; if(sha1_32(buf)==1665674686){break;} }
  533 + for(i=62;i<88;i++){ buf[523]=(byte)i; if(sha1_32(buf)==-2033372811){break;} }
  534 + for(i=9;i<32;i++){ buf[524]=(byte)i; if(sha1_32(buf)==-1023718857){break;} }
  535 + for(i=111;i<125;i++){ buf[525]=(byte)i; if(sha1_32(buf)==-643259574){break;} }
  536 + for(i=-85;i<-68;i++){ buf[526]=(byte)i; if(sha1_32(buf)==-533470764){break;} }
  537 + for(i=9;i<18;i++){ buf[527]=(byte)i; if(sha1_32(buf)==773071802){break;} }
  538 + for(i=14;i<40;i++){ buf[528]=(byte)i; if(sha1_32(buf)==-144655867){break;} }
  539 + for(i=111;i<114;i++){ buf[529]=(byte)i; if(sha1_32(buf)==542083472){break;} }
  540 + for(i=84;i<103;i++){ buf[530]=(byte)i; if(sha1_32(buf)==-725989297){break;} }
  541 + for(i=57;i<77;i++){ buf[531]=(byte)i; if(sha1_32(buf)==-814869396){break;} }
  542 + for(i=-90;i<-70;i++){ buf[532]=(byte)i; if(sha1_32(buf)==-1858873866){break;} }
  543 + for(i=-67;i<-57;i++){ buf[533]=(byte)i; if(sha1_32(buf)==1735718354){break;} }
  544 + for(i=-44;i<-41;i++){ buf[534]=(byte)i; if(sha1_32(buf)==-1434914429){break;} }
  545 + for(i=90;i<111;i++){ buf[535]=(byte)i; if(sha1_32(buf)==232655445){break;} }
  546 + for(i=67;i<74;i++){ buf[536]=(byte)i; if(sha1_32(buf)==1538118481){break;} }
  547 + for(i=-115;i<-104;i++){ buf[537]=(byte)i; if(sha1_32(buf)==-429140164){break;} }
  548 + for(i=108;i<124;i++){ buf[538]=(byte)i; if(sha1_32(buf)==-1546073184){break;} }
  549 + for(i=-8;i<13;i++){ buf[539]=(byte)i; if(sha1_32(buf)==1351199880){break;} }
  550 + for(i=-4;i<8;i++){ buf[540]=(byte)i; if(sha1_32(buf)==991784875){break;} }
  551 + for(i=103;i<114;i++){ buf[541]=(byte)i; if(sha1_32(buf)==2091841684){break;} }
  552 + for(i=53;i<77;i++){ buf[542]=(byte)i; if(sha1_32(buf)==1366258579){break;} }
  553 + for(i=-81;i<-71;i++){ buf[543]=(byte)i; if(sha1_32(buf)==1188879873){break;} }
  554 + for(i=-43;i<-27;i++){ buf[544]=(byte)i; if(sha1_32(buf)==-1738512036){break;} }
  555 + for(i=21;i<32;i++){ buf[545]=(byte)i; if(sha1_32(buf)==-2433973){break;} }
  556 + for(i=-40;i<-34;i++){ buf[546]=(byte)i; if(sha1_32(buf)==11300465){break;} }
  557 + for(i=64;i<69;i++){ buf[547]=(byte)i; if(sha1_32(buf)==-1124164457){break;} }
  558 + for(i=64;i<76;i++){ buf[548]=(byte)i; if(sha1_32(buf)==-1714966521){break;} }
  559 + for(i=-43;i<-26;i++){ buf[549]=(byte)i; if(sha1_32(buf)==1380686681){break;} }
  560 + for(i=-37;i<-22;i++){ buf[550]=(byte)i; if(sha1_32(buf)==328913474){break;} }
  561 + for(i=-59;i<-46;i++){ buf[551]=(byte)i; if(sha1_32(buf)==345983384){break;} }
  562 + for(i=-75;i<-67;i++){ buf[552]=(byte)i; if(sha1_32(buf)==-2107355969){break;} }
  563 + for(i=-101;i<-89;i++){ buf[553]=(byte)i; if(sha1_32(buf)==-29661160){break;} }
  564 + for(i=110;i<128;i++){ buf[554]=(byte)i; if(sha1_32(buf)==-1242723550){break;} }
  565 + for(i=-69;i<-58;i++){ buf[555]=(byte)i; if(sha1_32(buf)==-662514361){break;} }
  566 + for(i=-58;i<-43;i++){ buf[556]=(byte)i; if(sha1_32(buf)==971339050){break;} }
  567 + for(i=-27;i<-23;i++){ buf[557]=(byte)i; if(sha1_32(buf)==-184135978){break;} }
  568 + for(i=82;i<104;i++){ buf[558]=(byte)i; if(sha1_32(buf)==304236881){break;} }
  569 + for(i=88;i<101;i++){ buf[559]=(byte)i; if(sha1_32(buf)==2114714768){break;} }
  570 + for(i=127;i<128;i++){ buf[560]=(byte)i; if(sha1_32(buf)==-2141541585){break;} }
  571 + for(i=-109;i<-89;i++){ buf[561]=(byte)i; if(sha1_32(buf)==-621751783){break;} }
  572 + for(i=37;i<41;i++){ buf[562]=(byte)i; if(sha1_32(buf)==-560435744){break;} }
  573 + for(i=7;i<32;i++){ buf[563]=(byte)i; if(sha1_32(buf)==-965190030){break;} }
  574 + for(i=33;i<53;i++){ buf[564]=(byte)i; if(sha1_32(buf)==-1721418526){break;} }
  575 + for(i=-105;i<-81;i++){ buf[565]=(byte)i; if(sha1_32(buf)==602396706){break;} }
  576 + for(i=-98;i<-94;i++){ buf[566]=(byte)i; if(sha1_32(buf)==-1587448780){break;} }
  577 + for(i=-38;i<-17;i++){ buf[567]=(byte)i; if(sha1_32(buf)==-1378183103){break;} }
  578 + for(i=76;i<94;i++){ buf[568]=(byte)i; if(sha1_32(buf)==131513627){break;} }
  579 + for(i=-49;i<-40;i++){ buf[569]=(byte)i; if(sha1_32(buf)==-210267820){break;} }
  580 + for(i=80;i<102;i++){ buf[570]=(byte)i; if(sha1_32(buf)==585402756){break;} }
  581 + for(i=65;i<75;i++){ buf[571]=(byte)i; if(sha1_32(buf)==1759516852){break;} }
  582 + for(i=4;i<12;i++){ buf[572]=(byte)i; if(sha1_32(buf)==-216095742){break;} }
  583 + for(i=49;i<55;i++){ buf[573]=(byte)i; if(sha1_32(buf)==-54029906){break;} }
  584 + for(i=0;i<19;i++){ buf[574]=(byte)i; if(sha1_32(buf)==540804074){break;} }
  585 + for(i=66;i<92;i++){ buf[575]=(byte)i; if(sha1_32(buf)==-1677520683){break;} }
  586 + for(i=-85;i<-70;i++){ buf[576]=(byte)i; if(sha1_32(buf)==1776357716){break;} }
  587 + for(i=60;i<75;i++){ buf[577]=(byte)i; if(sha1_32(buf)==1098013748){break;} }
  588 + for(i=-24;i<-4;i++){ buf[578]=(byte)i; if(sha1_32(buf)==-1064239134){break;} }
  589 + for(i=71;i<91;i++){ buf[579]=(byte)i; if(sha1_32(buf)==-2077890881){break;} }
  590 + for(i=-128;i<-104;i++){ buf[580]=(byte)i; if(sha1_32(buf)==-839823746){break;} }
  591 + for(i=89;i<105;i++){ buf[581]=(byte)i; if(sha1_32(buf)==-243455362){break;} }
  592 + for(i=65;i<84;i++){ buf[582]=(byte)i; if(sha1_32(buf)==-725175448){break;} }
  593 + for(i=-69;i<-49;i++){ buf[583]=(byte)i; if(sha1_32(buf)==-1871446807){break;} }
  594 + for(i=-104;i<-90;i++){ buf[584]=(byte)i; if(sha1_32(buf)==946379292){break;} }
  595 + for(i=-60;i<-48;i++){ buf[585]=(byte)i; if(sha1_32(buf)==127200092){break;} }
  596 + for(i=42;i<46;i++){ buf[586]=(byte)i; if(sha1_32(buf)==-443535401){break;} }
  597 + for(i=59;i<71;i++){ buf[587]=(byte)i; if(sha1_32(buf)==2104547342){break;} }
  598 + for(i=7;i<24;i++){ buf[588]=(byte)i; if(sha1_32(buf)==1746305519){break;} }
  599 + for(i=-29;i<-19;i++){ buf[589]=(byte)i; if(sha1_32(buf)==-738940376){break;} }
  600 + for(i=-115;i<-107;i++){ buf[590]=(byte)i; if(sha1_32(buf)==-2080725064){break;} }
  601 + for(i=31;i<44;i++){ buf[591]=(byte)i; if(sha1_32(buf)==366188013){break;} }
  602 + for(i=91;i<97;i++){ buf[592]=(byte)i; if(sha1_32(buf)==-400947442){break;} }
  603 + for(i=23;i<44;i++){ buf[593]=(byte)i; if(sha1_32(buf)==1368323480){break;} }
  604 + for(i=10;i<34;i++){ buf[594]=(byte)i; if(sha1_32(buf)==1370591272){break;} }
  605 + for(i=-31;i<-19;i++){ buf[595]=(byte)i; if(sha1_32(buf)==-1374786213){break;} }
  606 + for(i=-111;i<-98;i++){ buf[596]=(byte)i; if(sha1_32(buf)==-986947413){break;} }
  607 + for(i=47;i<58;i++){ buf[597]=(byte)i; if(sha1_32(buf)==1362964963){break;} }
  608 + for(i=84;i<92;i++){ buf[598]=(byte)i; if(sha1_32(buf)==-596854428){break;} }
  609 + for(i=127;i<128;i++){ buf[599]=(byte)i; if(sha1_32(buf)==-1281726988){break;} }
  610 + for(i=60;i<78;i++){ buf[600]=(byte)i; if(sha1_32(buf)==897760766){break;} }
  611 + for(i=-49;i<-44;i++){ buf[601]=(byte)i; if(sha1_32(buf)==-1455904051){break;} }
  612 + for(i=-93;i<-74;i++){ buf[602]=(byte)i; if(sha1_32(buf)==326216376){break;} }
  613 + for(i=47;i<56;i++){ buf[603]=(byte)i; if(sha1_32(buf)==466041345){break;} }
  614 + for(i=114;i<121;i++){ buf[604]=(byte)i; if(sha1_32(buf)==-694704414){break;} }
  615 + for(i=11;i<36;i++){ buf[605]=(byte)i; if(sha1_32(buf)==487288727){break;} }
  616 + for(i=-102;i<-95;i++){ buf[606]=(byte)i; if(sha1_32(buf)==-516291533){break;} }
  617 + for(i=11;i<30;i++){ buf[607]=(byte)i; if(sha1_32(buf)==-1391687305){break;} }
  618 + for(i=-62;i<-42;i++){ buf[608]=(byte)i; if(sha1_32(buf)==-662115007){break;} }
  619 + for(i=-95;i<-83;i++){ buf[609]=(byte)i; if(sha1_32(buf)==-1503502125){break;} }
  620 + for(i=-70;i<-54;i++){ buf[610]=(byte)i; if(sha1_32(buf)==-2116589672){break;} }
  621 + for(i=-66;i<-60;i++){ buf[611]=(byte)i; if(sha1_32(buf)==-2045800164){break;} }
  622 + for(i=-103;i<-83;i++){ buf[612]=(byte)i; if(sha1_32(buf)==1023918650){break;} }
  623 + for(i=-103;i<-83;i++){ buf[613]=(byte)i; if(sha1_32(buf)==-1024090408){break;} }
  624 + for(i=-7;i<13;i++){ buf[614]=(byte)i; if(sha1_32(buf)==-1024090408){break;} }
  625 + for(i=-48;i<-25;i++){ buf[615]=(byte)i; if(sha1_32(buf)==-186367657){break;} }
  626 + for(i=-61;i<-51;i++){ buf[616]=(byte)i; if(sha1_32(buf)==-1280745075){break;} }
  627 + for(i=62;i<78;i++){ buf[617]=(byte)i; if(sha1_32(buf)==-817832341){break;} }
  628 + for(i=-128;i<-102;i++){ buf[618]=(byte)i; if(sha1_32(buf)==341473258){break;} }
  629 + for(i=32;i<56;i++){ buf[619]=(byte)i; if(sha1_32(buf)==-513466697){break;} }
  630 + for(i=-103;i<-93;i++){ buf[620]=(byte)i; if(sha1_32(buf)==1906473064){break;} }
  631 + for(i=-47;i<-27;i++){ buf[621]=(byte)i; if(sha1_32(buf)==549306033){break;} }
  632 + for(i=1;i<18;i++){ buf[622]=(byte)i; if(sha1_32(buf)==200841762){break;} }
  633 + for(i=69;i<92;i++){ buf[623]=(byte)i; if(sha1_32(buf)==-757575212){break;} }
  634 + for(i=-64;i<-55;i++){ buf[624]=(byte)i; if(sha1_32(buf)==2068963518){break;} }
  635 + for(i=49;i<64;i++){ buf[625]=(byte)i; if(sha1_32(buf)==40423320){break;} }
  636 + for(i=11;i<30;i++){ buf[626]=(byte)i; if(sha1_32(buf)==-2018496342){break;} }
  637 + for(i=-46;i<-30;i++){ buf[627]=(byte)i; if(sha1_32(buf)==1567810667){break;} }
  638 + for(i=-107;i<-93;i++){ buf[628]=(byte)i; if(sha1_32(buf)==1898294265){break;} }
  639 + for(i=-128;i<-116;i++){ buf[629]=(byte)i; if(sha1_32(buf)==-1437582410){break;} }
  640 + for(i=72;i<88;i++){ buf[630]=(byte)i; if(sha1_32(buf)==479964404){break;} }
  641 + for(i=114;i<128;i++){ buf[631]=(byte)i; if(sha1_32(buf)==1846334071){break;} }
  642 + for(i=28;i<48;i++){ buf[632]=(byte)i; if(sha1_32(buf)==-1160775469){break;} }
  643 + for(i=-126;i<-112;i++){ buf[633]=(byte)i; if(sha1_32(buf)==1092256208){break;} }
  644 + for(i=97;i<106;i++){ buf[634]=(byte)i; if(sha1_32(buf)==-1426573959){break;} }
  645 + for(i=114;i<128;i++){ buf[635]=(byte)i; if(sha1_32(buf)==-1768499337){break;} }
  646 + for(i=85;i<92;i++){ buf[636]=(byte)i; if(sha1_32(buf)==-2072447044){break;} }
  647 + for(i=13;i<27;i++){ buf[637]=(byte)i; if(sha1_32(buf)==1512815092){break;} }
  648 + for(i=42;i<46;i++){ buf[638]=(byte)i; if(sha1_32(buf)==193495670){break;} }
  649 + for(i=-112;i<-94;i++){ buf[639]=(byte)i; if(sha1_32(buf)==518466140){break;} }
  650 + for(i=23;i<44;i++){ buf[640]=(byte)i; if(sha1_32(buf)==-586663266){break;} }
  651 + for(i=-60;i<-41;i++){ buf[641]=(byte)i; if(sha1_32(buf)==187326791){break;} }
  652 + for(i=18;i<29;i++){ buf[642]=(byte)i; if(sha1_32(buf)==517588139){break;} }
  653 + for(i=60;i<80;i++){ buf[643]=(byte)i; if(sha1_32(buf)==1243035508){break;} }
  654 + for(i=28;i<34;i++){ buf[644]=(byte)i; if(sha1_32(buf)==-2061265734){break;} }
  655 + for(i=-25;i<-9;i++){ buf[645]=(byte)i; if(sha1_32(buf)==-1342458252){break;} }
  656 + for(i=22;i<44;i++){ buf[646]=(byte)i; if(sha1_32(buf)==-946160035){break;} }
  657 + for(i=26;i<27;i++){ buf[647]=(byte)i; if(sha1_32(buf)==-840462199){break;} }
  658 + for(i=-128;i<-112;i++){ buf[648]=(byte)i; if(sha1_32(buf)==1797265020){break;} }
  659 + for(i=-8;i<0;i++){ buf[649]=(byte)i; if(sha1_32(buf)==144372865){break;} }
  660 + for(i=-108;i<-99;i++){ buf[650]=(byte)i; if(sha1_32(buf)==-1295988113){break;} }
  661 + for(i=1;i<17;i++){ buf[651]=(byte)i; if(sha1_32(buf)==1654685477){break;} }
  662 + for(i=109;i<116;i++){ buf[652]=(byte)i; if(sha1_32(buf)==-1685889233){break;} }
  663 + for(i=-5;i<5;i++){ buf[653]=(byte)i; if(sha1_32(buf)==-466808668){break;} }
  664 + for(i=17;i<35;i++){ buf[654]=(byte)i; if(sha1_32(buf)==1360505330){break;} }
  665 + for(i=5;i<23;i++){ buf[655]=(byte)i; if(sha1_32(buf)==734304122){break;} }
  666 + for(i=-75;i<-59;i++){ buf[656]=(byte)i; if(sha1_32(buf)==-53451148){break;} }
  667 + for(i=39;i<45;i++){ buf[657]=(byte)i; if(sha1_32(buf)==1378658033){break;} }
  668 + for(i=-59;i<-51;i++){ buf[658]=(byte)i; if(sha1_32(buf)==-505423833){break;} }
  669 + for(i=-128;i<-121;i++){ buf[659]=(byte)i; if(sha1_32(buf)==2108309185){break;} }
  670 + for(i=-92;i<-87;i++){ buf[660]=(byte)i; if(sha1_32(buf)==-776363972){break;} }
  671 + for(i=58;i<70;i++){ buf[661]=(byte)i; if(sha1_32(buf)==892794227){break;} }
  672 + for(i=37;i<45;i++){ buf[662]=(byte)i; if(sha1_32(buf)==-1765040271){break;} }
  673 + for(i=-13;i<10;i++){ buf[663]=(byte)i; if(sha1_32(buf)==1808457439){break;} }
  674 + for(i=-44;i<-21;i++){ buf[664]=(byte)i; if(sha1_32(buf)==-619637912){break;} }
  675 + for(i=-17;i<-12;i++){ buf[665]=(byte)i; if(sha1_32(buf)==732488013){break;} }
  676 + for(i=-86;i<-63;i++){ buf[666]=(byte)i; if(sha1_32(buf)==1653228123){break;} }
  677 + for(i=53;i<68;i++){ buf[667]=(byte)i; if(sha1_32(buf)==-471557872){break;} }
  678 + for(i=64;i<79;i++){ buf[668]=(byte)i; if(sha1_32(buf)==1376477683){break;} }
  679 + for(i=-33;i<-16;i++){ buf[669]=(byte)i; if(sha1_32(buf)==803200658){break;} }
  680 + for(i=74;i<84;i++){ buf[670]=(byte)i; if(sha1_32(buf)==-685106876){break;} }
  681 + for(i=95;i<115;i++){ buf[671]=(byte)i; if(sha1_32(buf)==-1154979628){break;} }
  682 + for(i=-95;i<-77;i++){ buf[672]=(byte)i; if(sha1_32(buf)==-1241566013){break;} }
  683 + for(i=-26;i<-8;i++){ buf[673]=(byte)i; if(sha1_32(buf)==44086761){break;} }
  684 + for(i=24;i<39;i++){ buf[674]=(byte)i; if(sha1_32(buf)==1549356593){break;} }
  685 + for(i=-59;i<-54;i++){ buf[675]=(byte)i; if(sha1_32(buf)==1842896957){break;} }
  686 + for(i=-50;i<-30;i++){ buf[676]=(byte)i; if(sha1_32(buf)==-1586479296){break;} }
  687 + for(i=52;i<78;i++){ buf[677]=(byte)i; if(sha1_32(buf)==1196832676){break;} }
  688 + for(i=-98;i<-81;i++){ buf[678]=(byte)i; if(sha1_32(buf)==-306327135){break;} }
  689 + for(i=-43;i<-29;i++){ buf[679]=(byte)i; if(sha1_32(buf)==1381380767){break;} }
  690 + for(i=107;i<119;i++){ buf[680]=(byte)i; if(sha1_32(buf)==-692226047){break;} }
  691 + for(i=-62;i<-41;i++){ buf[681]=(byte)i; if(sha1_32(buf)==1255714864){break;} }
  692 + for(i=-70;i<-43;i++){ buf[682]=(byte)i; if(sha1_32(buf)==672048784){break;} }
  693 + for(i=-93;i<-85;i++){ buf[683]=(byte)i; if(sha1_32(buf)==-1607357664){break;} }
  694 + for(i=19;i<28;i++){ buf[684]=(byte)i; if(sha1_32(buf)==-1951477696){break;} }
  695 + for(i=-56;i<-47;i++){ buf[685]=(byte)i; if(sha1_32(buf)==-469113615){break;} }
  696 + for(i=-106;i<-94;i++){ buf[686]=(byte)i; if(sha1_32(buf)==-1802116677){break;} }
  697 + for(i=-20;i<1;i++){ buf[687]=(byte)i; if(sha1_32(buf)==-1805301589){break;} }
  698 + for(i=3;i<20;i++){ buf[688]=(byte)i; if(sha1_32(buf)==-37962451){break;} }
  699 + for(i=-18;i<-1;i++){ buf[689]=(byte)i; if(sha1_32(buf)==-508916088){break;} }
  700 + for(i=-12;i<-5;i++){ buf[690]=(byte)i; if(sha1_32(buf)==1666417544){break;} }
  701 + for(i=56;i<75;i++){ buf[691]=(byte)i; if(sha1_32(buf)==728914776){break;} }
  702 + for(i=30;i<58;i++){ buf[692]=(byte)i; if(sha1_32(buf)==-1441984223){break;} }
  703 + for(i=46;i<64;i++){ buf[693]=(byte)i; if(sha1_32(buf)==-591777660){break;} }
  704 + for(i=-128;i<-116;i++){ buf[694]=(byte)i; if(sha1_32(buf)==1752534664){break;} }
  705 + for(i=-83;i<-59;i++){ buf[695]=(byte)i; if(sha1_32(buf)==-1440186820){break;} }
  706 + for(i=69;i<83;i++){ buf[696]=(byte)i; if(sha1_32(buf)==353150266){break;} }
  707 + for(i=35;i<38;i++){ buf[697]=(byte)i; if(sha1_32(buf)==-1202434068){break;} }
  708 + for(i=27;i<40;i++){ buf[698]=(byte)i; if(sha1_32(buf)==557210801){break;} }
  709 + for(i=62;i<72;i++){ buf[699]=(byte)i; if(sha1_32(buf)==-701318733){break;} }
  710 + for(i=36;i<46;i++){ buf[700]=(byte)i; if(sha1_32(buf)==-1152707863){break;} }
  711 + for(i=-43;i<-31;i++){ buf[701]=(byte)i; if(sha1_32(buf)==-1044286403){break;} }
  712 + for(i=-64;i<-47;i++){ buf[702]=(byte)i; if(sha1_32(buf)==2127529559){break;} }
  713 + for(i=-78;i<-61;i++){ buf[703]=(byte)i; if(sha1_32(buf)==1065134881){break;} }
  714 + for(i=5;i<31;i++){ buf[704]=(byte)i; if(sha1_32(buf)==-1504388356){break;} }
  715 + for(i=-93;i<-67;i++){ buf[705]=(byte)i; if(sha1_32(buf)==46755195){break;} }
  716 + for(i=-124;i<-108;i++){ buf[706]=(byte)i; if(sha1_32(buf)==1288663445){break;} }
  717 + for(i=-94;i<-66;i++){ buf[707]=(byte)i; if(sha1_32(buf)==-823150105){break;} }
  718 + for(i=101;i<109;i++){ buf[708]=(byte)i; if(sha1_32(buf)==-600979623){break;} }
  719 + for(i=-18;i<8;i++){ buf[709]=(byte)i; if(sha1_32(buf)==-1308439152){break;} }
  720 + for(i=-2;i<15;i++){ buf[710]=(byte)i; if(sha1_32(buf)==-583921725){break;} }
  721 + for(i=-109;i<-103;i++){ buf[711]=(byte)i; if(sha1_32(buf)==-1035786261){break;} }
  722 + for(i=80;i<85;i++){ buf[712]=(byte)i; if(sha1_32(buf)==-224940396){break;} }
  723 + for(i=-83;i<-73;i++){ buf[713]=(byte)i; if(sha1_32(buf)==-64432094){break;} }
  724 + for(i=-21;i<-9;i++){ buf[714]=(byte)i; if(sha1_32(buf)==-1444858690){break;} }
  725 + for(i=39;i<58;i++){ buf[715]=(byte)i; if(sha1_32(buf)==-301620636){break;} }
  726 + for(i=99;i<125;i++){ buf[716]=(byte)i; if(sha1_32(buf)==496186792){break;} }
  727 + for(i=-30;i<-18;i++){ buf[717]=(byte)i; if(sha1_32(buf)==-480836668){break;} }
  728 + for(i=-12;i<8;i++){ buf[718]=(byte)i; if(sha1_32(buf)==919735557){break;} }
  729 + for(i=-48;i<-40;i++){ buf[719]=(byte)i; if(sha1_32(buf)==-1764559453){break;} }
  730 + for(i=-121;i<-109;i++){ buf[720]=(byte)i; if(sha1_32(buf)==9096437){break;} }
  731 + for(i=-66;i<-46;i++){ buf[721]=(byte)i; if(sha1_32(buf)==2130893142){break;} }
  732 + for(i=-41;i<-31;i++){ buf[722]=(byte)i; if(sha1_32(buf)==-874171279){break;} }
  733 + for(i=-12;i<-1;i++){ buf[723]=(byte)i; if(sha1_32(buf)==-1795967222){break;} }
  734 + for(i=-121;i<-110;i++){ buf[724]=(byte)i; if(sha1_32(buf)==-273882432){break;} }
  735 + for(i=58;i<71;i++){ buf[725]=(byte)i; if(sha1_32(buf)==-154031605){break;} }
  736 + for(i=-54;i<-40;i++){ buf[726]=(byte)i; if(sha1_32(buf)==-1838265974){break;} }
  737 + for(i=-121;i<-107;i++){ buf[727]=(byte)i; if(sha1_32(buf)==-892228569){break;} }
  738 + for(i=-49;i<-28;i++){ buf[728]=(byte)i; if(sha1_32(buf)==1675128022){break;} }
  739 + for(i=-115;i<-100;i++){ buf[729]=(byte)i; if(sha1_32(buf)==-1633676606){break;} }
  740 + for(i=103;i<116;i++){ buf[730]=(byte)i; if(sha1_32(buf)==1648270908){break;} }
  741 + for(i=96;i<110;i++){ buf[731]=(byte)i; if(sha1_32(buf)==1694902555){break;} }
  742 + for(i=-128;i<-107;i++){ buf[732]=(byte)i; if(sha1_32(buf)==554237356){break;} }
  743 + for(i=44;i<54;i++){ buf[733]=(byte)i; if(sha1_32(buf)==1342608943){break;} }
  744 + for(i=-13;i<3;i++){ buf[734]=(byte)i; if(sha1_32(buf)==1346076392){break;} }
  745 + for(i=-73;i<-51;i++){ buf[735]=(byte)i; if(sha1_32(buf)==435984579){break;} }
  746 + for(i=-75;i<-46;i++){ buf[736]=(byte)i; if(sha1_32(buf)==-66514260){break;} }
  747 + for(i=86;i<93;i++){ buf[737]=(byte)i; if(sha1_32(buf)==834035741){break;} }
  748 + for(i=74;i<83;i++){ buf[738]=(byte)i; if(sha1_32(buf)==1096746559){break;} }
  749 + for(i=86;i<101;i++){ buf[739]=(byte)i; if(sha1_32(buf)==641358007){break;} }
  750 + for(i=65;i<77;i++){ buf[740]=(byte)i; if(sha1_32(buf)==-620751638){break;} }
  751 + for(i=74;i<90;i++){ buf[741]=(byte)i; if(sha1_32(buf)==2007783664){break;} }
  752 + for(i=-95;i<-79;i++){ buf[742]=(byte)i; if(sha1_32(buf)==-1295752107){break;} }
  753 + for(i=-84;i<-64;i++){ buf[743]=(byte)i; if(sha1_32(buf)==505854344){break;} }
  754 + for(i=114;i<116;i++){ buf[744]=(byte)i; if(sha1_32(buf)==1715929946){break;} }
  755 + for(i=40;i<51;i++){ buf[745]=(byte)i; if(sha1_32(buf)==-44360951){break;} }
  756 + for(i=-59;i<-43;i++){ buf[746]=(byte)i; if(sha1_32(buf)==280689592){break;} }
  757 + for(i=110;i<117;i++){ buf[747]=(byte)i; if(sha1_32(buf)==1111149458){break;} }
  758 + for(i=82;i<89;i++){ buf[748]=(byte)i; if(sha1_32(buf)==-57588639){break;} }
  759 + for(i=10;i<32;i++){ buf[749]=(byte)i; if(sha1_32(buf)==-1823827362){break;} }
  760 + for(i=9;i<22;i++){ buf[750]=(byte)i; if(sha1_32(buf)==1001717205){break;} }
  761 + for(i=9;i<27;i++){ buf[751]=(byte)i; if(sha1_32(buf)==255375472){break;} }
  762 + for(i=18;i<29;i++){ buf[752]=(byte)i; if(sha1_32(buf)==1008199932){break;} }
  763 + for(i=44;i<62;i++){ buf[753]=(byte)i; if(sha1_32(buf)==-1436568908){break;} }
  764 + for(i=104;i<121;i++){ buf[754]=(byte)i; if(sha1_32(buf)==-2069001382){break;} }
  765 + for(i=-92;i<-65;i++){ buf[755]=(byte)i; if(sha1_32(buf)==-245701720){break;} }
  766 + for(i=11;i<27;i++){ buf[756]=(byte)i; if(sha1_32(buf)==894216801){break;} }
  767 + for(i=-58;i<-37;i++){ buf[757]=(byte)i; if(sha1_32(buf)==-72593385){break;} }
  768 + for(i=-57;i<-36;i++){ buf[758]=(byte)i; if(sha1_32(buf)==116757579){break;} }
  769 + for(i=-6;i<2;i++){ buf[759]=(byte)i; if(sha1_32(buf)==-1472756188){break;} }
  770 + for(i=-29;i<-21;i++){ buf[760]=(byte)i; if(sha1_32(buf)==-1049966321){break;} }
  771 + for(i=-98;i<-81;i++){ buf[761]=(byte)i; if(sha1_32(buf)==-1643293981){break;} }
  772 + for(i=-93;i<-65;i++){ buf[762]=(byte)i; if(sha1_32(buf)==1438153587){break;} }
  773 + for(i=-42;i<-11;i++){ buf[763]=(byte)i; if(sha1_32(buf)==-1817455929){break;} }
  774 + for(i=-38;i<-32;i++){ buf[764]=(byte)i; if(sha1_32(buf)==1236834313){break;} }
  775 + for(i=22;i<32;i++){ buf[765]=(byte)i; if(sha1_32(buf)==-923882541){break;} }
  776 + for(i=-94;i<-78;i++){ buf[766]=(byte)i; if(sha1_32(buf)==46514715){break;} }
  777 + for(i=-101;i<-78;i++){ buf[767]=(byte)i; if(sha1_32(buf)==-508579659){break;} }
  778 + for(i=-93;i<-82;i++){ buf[768]=(byte)i; if(sha1_32(buf)==268005422){break;} }
  779 + for(i=118;i<128;i++){ buf[769]=(byte)i; if(sha1_32(buf)==-2082060960){break;} }
  780 + for(i=-57;i<-40;i++){ buf[770]=(byte)i; if(sha1_32(buf)==-821050876){break;} }
  781 + for(i=-124;i<-110;i++){ buf[771]=(byte)i; if(sha1_32(buf)==1862668243){break;} }
  782 + for(i=-70;i<-63;i++){ buf[772]=(byte)i; if(sha1_32(buf)==2134840246){break;} }
  783 + for(i=33;i<55;i++){ buf[773]=(byte)i; if(sha1_32(buf)==831801516){break;} }
  784 + for(i=70;i<99;i++){ buf[774]=(byte)i; if(sha1_32(buf)==-1337905819){break;} }
  785 + for(i=-93;i<-83;i++){ buf[775]=(byte)i; if(sha1_32(buf)==-2116186974){break;} }
  786 + for(i=99;i<120;i++){ buf[776]=(byte)i; if(sha1_32(buf)==-1361818230){break;} }
  787 + for(i=-4;i<6;i++){ buf[777]=(byte)i; if(sha1_32(buf)==-1361818230){break;} }
  788 + for(i=42;i<60;i++){ buf[778]=(byte)i; if(sha1_32(buf)==1254162568){break;} }
  789 + for(i=12;i<29;i++){ buf[779]=(byte)i; if(sha1_32(buf)==-1828089339){break;} }
  790 + for(i=-72;i<-50;i++){ buf[780]=(byte)i; if(sha1_32(buf)==-22693696){break;} }
  791 + for(i=22;i<37;i++){ buf[781]=(byte)i; if(sha1_32(buf)==-392305421){break;} }
  792 + for(i=-29;i<-9;i++){ buf[782]=(byte)i; if(sha1_32(buf)==-835117443){break;} }
  793 + for(i=-66;i<-60;i++){ buf[783]=(byte)i; if(sha1_32(buf)==2070609038){break;} }
  794 + for(i=-29;i<-19;i++){ buf[784]=(byte)i; if(sha1_32(buf)==2013920284){break;} }
  795 + for(i=-87;i<-61;i++){ buf[785]=(byte)i; if(sha1_32(buf)==-1713049492){break;} }
  796 + for(i=44;i<57;i++){ buf[786]=(byte)i; if(sha1_32(buf)==-1923739910){break;} }
  797 + for(i=-89;i<-69;i++){ buf[787]=(byte)i; if(sha1_32(buf)==998980675){break;} }
  798 + for(i=99;i<109;i++){ buf[788]=(byte)i; if(sha1_32(buf)==310692790){break;} }
  799 + for(i=113;i<118;i++){ buf[789]=(byte)i; if(sha1_32(buf)==-409447107){break;} }
  800 + for(i=-115;i<-86;i++){ buf[790]=(byte)i; if(sha1_32(buf)==669468995){break;} }
  801 + for(i=43;i<68;i++){ buf[791]=(byte)i; if(sha1_32(buf)==-1024576754){break;} }
  802 + for(i=25;i<44;i++){ buf[792]=(byte)i; if(sha1_32(buf)==2048354334){break;} }
  803 + for(i=118;i<124;i++){ buf[793]=(byte)i; if(sha1_32(buf)==167595018){break;} }
  804 + for(i=43;i<52;i++){ buf[794]=(byte)i; if(sha1_32(buf)==-1812530553){break;} }
  805 + for(i=-112;i<-88;i++){ buf[795]=(byte)i; if(sha1_32(buf)==-411513304){break;} }
  806 + for(i=40;i<62;i++){ buf[796]=(byte)i; if(sha1_32(buf)==-544499711){break;} }
  807 + for(i=6;i<16;i++){ buf[797]=(byte)i; if(sha1_32(buf)==-1384719864){break;} }
  808 + for(i=73;i<97;i++){ buf[798]=(byte)i; if(sha1_32(buf)==2139506616){break;} }
  809 + for(i=-34;i<-31;i++){ buf[799]=(byte)i; if(sha1_32(buf)==-990430351){break;} }
  810 + for(i=53;i<79;i++){ buf[800]=(byte)i; if(sha1_32(buf)==-472644824){break;} }
  811 + for(i=-116;i<-104;i++){ buf[801]=(byte)i; if(sha1_32(buf)==-1647841597){break;} }
  812 + for(i=90;i<109;i++){ buf[802]=(byte)i; if(sha1_32(buf)==-1339044815){break;} }
  813 + for(i=-84;i<-71;i++){ buf[803]=(byte)i; if(sha1_32(buf)==606527180){break;} }
  814 + for(i=89;i<106;i++){ buf[804]=(byte)i; if(sha1_32(buf)==973631380){break;} }
  815 + for(i=-45;i<-30;i++){ buf[805]=(byte)i; if(sha1_32(buf)==-659099682){break;} }
  816 + for(i=87;i<106;i++){ buf[806]=(byte)i; if(sha1_32(buf)==-995684730){break;} }
  817 + for(i=-87;i<-67;i++){ buf[807]=(byte)i; if(sha1_32(buf)==2052781879){break;} }
  818 + for(i=-55;i<-28;i++){ buf[808]=(byte)i; if(sha1_32(buf)==-360231079){break;} }
  819 + for(i=119;i<128;i++){ buf[809]=(byte)i; if(sha1_32(buf)==-1413503367){break;} }
  820 + for(i=87;i<98;i++){ buf[810]=(byte)i; if(sha1_32(buf)==1169384068){break;} }
  821 + for(i=111;i<128;i++){ buf[811]=(byte)i; if(sha1_32(buf)==1889211506){break;} }
  822 + for(i=-18;i<0;i++){ buf[812]=(byte)i; if(sha1_32(buf)==149848895){break;} }
  823 + for(i=-21;i<-1;i++){ buf[813]=(byte)i; if(sha1_32(buf)==-1020910290){break;} }
  824 + for(i=-99;i<-95;i++){ buf[814]=(byte)i; if(sha1_32(buf)==571335480){break;} }
  825 + for(i=0;i<12;i++){ buf[815]=(byte)i; if(sha1_32(buf)==-1596259382){break;} }
  826 + for(i=-102;i<-95;i++){ buf[816]=(byte)i; if(sha1_32(buf)==-858687193){break;} }
  827 + for(i=-125;i<-113;i++){ buf[817]=(byte)i; if(sha1_32(buf)==427029012){break;} }
  828 + for(i=-86;i<-79;i++){ buf[818]=(byte)i; if(sha1_32(buf)==2043800628){break;} }
  829 + for(i=-67;i<-49;i++){ buf[819]=(byte)i; if(sha1_32(buf)==-1813846534){break;} }
  830 + for(i=-89;i<-71;i++){ buf[820]=(byte)i; if(sha1_32(buf)==-1082324042){break;} }
  831 + for(i=56;i<74;i++){ buf[821]=(byte)i; if(sha1_32(buf)==-754499064){break;} }
  832 + for(i=58;i<64;i++){ buf[822]=(byte)i; if(sha1_32(buf)==-460697010){break;} }
  833 + for(i=19;i<40;i++){ buf[823]=(byte)i; if(sha1_32(buf)==1137045662){break;} }
  834 + for(i=-10;i<3;i++){ buf[824]=(byte)i; if(sha1_32(buf)==-521396724){break;} }
  835 + for(i=-54;i<-26;i++){ buf[825]=(byte)i; if(sha1_32(buf)==-1120348466){break;} }
  836 + for(i=-127;i<-109;i++){ buf[826]=(byte)i; if(sha1_32(buf)==-1873894727){break;} }
  837 + for(i=66;i<82;i++){ buf[827]=(byte)i; if(sha1_32(buf)==2135696560){break;} }
  838 + for(i=81;i<93;i++){ buf[828]=(byte)i; if(sha1_32(buf)==1091876439){break;} }
  839 + for(i=27;i<45;i++){ buf[829]=(byte)i; if(sha1_32(buf)==-1713128159){break;} }
  840 + for(i=101;i<119;i++){ buf[830]=(byte)i; if(sha1_32(buf)==580906425){break;} }
  841 + for(i=91;i<120;i++){ buf[831]=(byte)i; if(sha1_32(buf)==1535472503){break;} }
  842 + for(i=-128;i<-121;i++){ buf[832]=(byte)i; if(sha1_32(buf)==2096930378){break;} }
  843 + for(i=90;i<108;i++){ buf[833]=(byte)i; if(sha1_32(buf)==-1582680798){break;} }
  844 + for(i=-33;i<-15;i++){ buf[834]=(byte)i; if(sha1_32(buf)==-807374817){break;} }
  845 + for(i=-29;i<-15;i++){ buf[835]=(byte)i; if(sha1_32(buf)==607649943){break;} }
  846 + for(i=113;i<128;i++){ buf[836]=(byte)i; if(sha1_32(buf)==-615034323){break;} }
  847 + for(i=116;i<127;i++){ buf[837]=(byte)i; if(sha1_32(buf)==1689502767){break;} }
  848 + for(i=-57;i<-32;i++){ buf[838]=(byte)i; if(sha1_32(buf)==-1604569654){break;} }
  849 + for(i=-89;i<-67;i++){ buf[839]=(byte)i; if(sha1_32(buf)==1372534786){break;} }
  850 + for(i=116;i<128;i++){ buf[840]=(byte)i; if(sha1_32(buf)==-392651987){break;} }
  851 + for(i=103;i<115;i++){ buf[841]=(byte)i; if(sha1_32(buf)==456333378){break;} }
  852 + for(i=96;i<102;i++){ buf[842]=(byte)i; if(sha1_32(buf)==-2102428930){break;} }
  853 + for(i=-66;i<-53;i++){ buf[843]=(byte)i; if(sha1_32(buf)==1169871193){break;} }
  854 + for(i=35;i<65;i++){ buf[844]=(byte)i; if(sha1_32(buf)==1452451205){break;} }
  855 + for(i=19;i<36;i++){ buf[845]=(byte)i; if(sha1_32(buf)==300788108){break;} }
  856 + for(i=18;i<36;i++){ buf[846]=(byte)i; if(sha1_32(buf)==-1595328647){break;} }
  857 + for(i=56;i<69;i++){ buf[847]=(byte)i; if(sha1_32(buf)==1993689579){break;} }
  858 + for(i=41;i<48;i++){ buf[848]=(byte)i; if(sha1_32(buf)==-1224132689){break;} }
  859 + for(i=-122;i<-101;i++){ buf[849]=(byte)i; if(sha1_32(buf)==218838983){break;} }
  860 + for(i=-18;i<-3;i++){ buf[850]=(byte)i; if(sha1_32(buf)==86225471){break;} }
  861 + for(i=110;i<121;i++){ buf[851]=(byte)i; if(sha1_32(buf)==1295757216){break;} }
  862 + for(i=85;i<101;i++){ buf[852]=(byte)i; if(sha1_32(buf)==-65106615){break;} }
  863 + for(i=-93;i<-76;i++){ buf[853]=(byte)i; if(sha1_32(buf)==759307342){break;} }
  864 + for(i=-121;i<-101;i++){ buf[854]=(byte)i; if(sha1_32(buf)==789001774){break;} }
  865 + for(i=-23;i<2;i++){ buf[855]=(byte)i; if(sha1_32(buf)==-1447834832){break;} }
  866 + for(i=-70;i<-61;i++){ buf[856]=(byte)i; if(sha1_32(buf)==-44355954){break;} }
  867 + for(i=-112;i<-105;i++){ buf[857]=(byte)i; if(sha1_32(buf)==-1829798433){break;} }
  868 + for(i=105;i<120;i++){ buf[858]=(byte)i; if(sha1_32(buf)==618442377){break;} }
  869 + for(i=-42;i<-30;i++){ buf[859]=(byte)i; if(sha1_32(buf)==1267522784){break;} }
  870 + for(i=4;i<18;i++){ buf[860]=(byte)i; if(sha1_32(buf)==-1591917050){break;} }
  871 + for(i=105;i<122;i++){ buf[861]=(byte)i; if(sha1_32(buf)==1371035887){break;} }
  872 + for(i=90;i<107;i++){ buf[862]=(byte)i; if(sha1_32(buf)==-1551546972){break;} }
  873 + for(i=-12;i<8;i++){ buf[863]=(byte)i; if(sha1_32(buf)==1904109939){break;} }
  874 + for(i=-78;i<-62;i++){ buf[864]=(byte)i; if(sha1_32(buf)==-848521623){break;} }
  875 + for(i=-87;i<-86;i++){ buf[865]=(byte)i; if(sha1_32(buf)==-28105324){break;} }
  876 + for(i=-128;i<-118;i++){ buf[866]=(byte)i; if(sha1_32(buf)==1444337841){break;} }
  877 + for(i=-60;i<-45;i++){ buf[867]=(byte)i; if(sha1_32(buf)==-149845483){break;} }
  878 + for(i=26;i<51;i++){ buf[868]=(byte)i; if(sha1_32(buf)==115238846){break;} }
  879 + for(i=-38;i<-11;i++){ buf[869]=(byte)i; if(sha1_32(buf)==137438883){break;} }
  880 + for(i=-92;i<-79;i++){ buf[870]=(byte)i; if(sha1_32(buf)==1335090647){break;} }
  881 + for(i=29;i<44;i++){ buf[871]=(byte)i; if(sha1_32(buf)==1699614736){break;} }
  882 + for(i=60;i<75;i++){ buf[872]=(byte)i; if(sha1_32(buf)==1965855955){break;} }
  883 + for(i=64;i<78;i++){ buf[873]=(byte)i; if(sha1_32(buf)==645498901){break;} }
  884 + for(i=-50;i<-33;i++){ buf[874]=(byte)i; if(sha1_32(buf)==1309841305){break;} }
  885 + for(i=37;i<44;i++){ buf[875]=(byte)i; if(sha1_32(buf)==969267448){break;} }
  886 + for(i=-41;i<-25;i++){ buf[876]=(byte)i; if(sha1_32(buf)==-253200763){break;} }
  887 + for(i=-26;i<-12;i++){ buf[877]=(byte)i; if(sha1_32(buf)==1478441362){break;} }
  888 + for(i=-20;i<-10;i++){ buf[878]=(byte)i; if(sha1_32(buf)==333652038){break;} }
  889 + for(i=-32;i<-6;i++){ buf[879]=(byte)i; if(sha1_32(buf)==676958823){break;} }
  890 + for(i=-91;i<-66;i++){ buf[880]=(byte)i; if(sha1_32(buf)==-1201480728){break;} }
  891 + for(i=1;i<9;i++){ buf[881]=(byte)i; if(sha1_32(buf)==679978043){break;} }
  892 + for(i=-26;i<-4;i++){ buf[882]=(byte)i; if(sha1_32(buf)==-547244730){break;} }
  893 + for(i=106;i<122;i++){ buf[883]=(byte)i; if(sha1_32(buf)==-1512798165){break;} }
  894 + for(i=0;i<12;i++){ buf[884]=(byte)i; if(sha1_32(buf)==-2014532029){break;} }
  895 + for(i=-76;i<-67;i++){ buf[885]=(byte)i; if(sha1_32(buf)==-1790282562){break;} }
  896 + for(i=-128;i<-102;i++){ buf[886]=(byte)i; if(sha1_32(buf)==727442242){break;} }
  897 + for(i=-15;i<2;i++){ buf[887]=(byte)i; if(sha1_32(buf)==739142986){break;} }
  898 + for(i=117;i<127;i++){ buf[888]=(byte)i; if(sha1_32(buf)==1754081610){break;} }
  899 + for(i=-42;i<-22;i++){ buf[889]=(byte)i; if(sha1_32(buf)==-781301006){break;} }
  900 + for(i=-84;i<-77;i++){ buf[890]=(byte)i; if(sha1_32(buf)==-676630030){break;} }
  901 + for(i=-109;i<-98;i++){ buf[891]=(byte)i; if(sha1_32(buf)==-910157857){break;} }
  902 + for(i=97;i<112;i++){ buf[892]=(byte)i; if(sha1_32(buf)==2141165867){break;} }
  903 + for(i=90;i<117;i++){ buf[893]=(byte)i; if(sha1_32(buf)==187553065){break;} }
  904 + for(i=-47;i<-30;i++){ buf[894]=(byte)i; if(sha1_32(buf)==378787916){break;} }
  905 + for(i=-86;i<-68;i++){ buf[895]=(byte)i; if(sha1_32(buf)==1833895600){break;} }
  906 + for(i=-53;i<-29;i++){ buf[896]=(byte)i; if(sha1_32(buf)==109610088){break;} }
  907 + for(i=109;i<118;i++){ buf[897]=(byte)i; if(sha1_32(buf)==-1754096868){break;} }
  908 + for(i=-106;i<-98;i++){ buf[898]=(byte)i; if(sha1_32(buf)==991775097){break;} }
  909 + for(i=120;i<128;i++){ buf[899]=(byte)i; if(sha1_32(buf)==1681949960){break;} }
  910 + for(i=34;i<38;i++){ buf[900]=(byte)i; if(sha1_32(buf)==-249966675){break;} }
  911 + for(i=5;i<31;i++){ buf[901]=(byte)i; if(sha1_32(buf)==1503551986){break;} }
  912 + for(i=62;i<84;i++){ buf[902]=(byte)i; if(sha1_32(buf)==-2098958776){break;} }
  913 + for(i=-66;i<-50;i++){ buf[903]=(byte)i; if(sha1_32(buf)==1826063563){break;} }
  914 + for(i=-36;i<-19;i++){ buf[904]=(byte)i; if(sha1_32(buf)==-1761335699){break;} }
  915 + for(i=-100;i<-77;i++){ buf[905]=(byte)i; if(sha1_32(buf)==-1714650192){break;} }
  916 + for(i=-64;i<-52;i++){ buf[906]=(byte)i; if(sha1_32(buf)==376768973){break;} }
  917 + for(i=75;i<89;i++){ buf[907]=(byte)i; if(sha1_32(buf)==-1346985127){break;} }
  918 + for(i=46;i<54;i++){ buf[908]=(byte)i; if(sha1_32(buf)==1902286847){break;} }
  919 + for(i=-128;i<-125;i++){ buf[909]=(byte)i; if(sha1_32(buf)==626006740){break;} }
  920 + for(i=12;i<29;i++){ buf[910]=(byte)i; if(sha1_32(buf)==-1223107398){break;} }
  921 + for(i=-2;i<-1;i++){ buf[911]=(byte)i; if(sha1_32(buf)==-1073173256){break;} }
  922 + for(i=118;i<128;i++){ buf[912]=(byte)i; if(sha1_32(buf)==-2108227342){break;} }
  923 + for(i=3;i<30;i++){ buf[913]=(byte)i; if(sha1_32(buf)==-1902321747){break;} }
  924 + for(i=89;i<108;i++){ buf[914]=(byte)i; if(sha1_32(buf)==2060111089){break;} }
  925 + for(i=9;i<30;i++){ buf[915]=(byte)i; if(sha1_32(buf)==56354503){break;} }
  926 + for(i=97;i<114;i++){ buf[916]=(byte)i; if(sha1_32(buf)==1378981250){break;} }
  927 + for(i=-39;i<-29;i++){ buf[917]=(byte)i; if(sha1_32(buf)==2043027633){break;} }
  928 + for(i=-128;i<-117;i++){ buf[918]=(byte)i; if(sha1_32(buf)==1841084296){break;} }
  929 + for(i=-126;i<-112;i++){ buf[919]=(byte)i; if(sha1_32(buf)==-1845371503){break;} }
  930 + for(i=86;i<112;i++){ buf[920]=(byte)i; if(sha1_32(buf)==1055837376){break;} }
  931 + for(i=60;i<77;i++){ buf[921]=(byte)i; if(sha1_32(buf)==-1987644133){break;} }
  932 + for(i=-13;i<12;i++){ buf[922]=(byte)i; if(sha1_32(buf)==916950688){break;} }
  933 + for(i=-20;i<-9;i++){ buf[923]=(byte)i; if(sha1_32(buf)==-1393941709){break;} }
  934 + for(i=-114;i<-102;i++){ buf[924]=(byte)i; if(sha1_32(buf)==2146462729){break;} }
  935 + for(i=-96;i<-87;i++){ buf[925]=(byte)i; if(sha1_32(buf)==900577137){break;} }
  936 + for(i=-9;i<1;i++){ buf[926]=(byte)i; if(sha1_32(buf)==952080992){break;} }
  937 + for(i=4;i<12;i++){ buf[927]=(byte)i; if(sha1_32(buf)==313868104){break;} }
  938 + for(i=20;i<40;i++){ buf[928]=(byte)i; if(sha1_32(buf)==-1934835353){break;} }
  939 + for(i=109;i<128;i++){ buf[929]=(byte)i; if(sha1_32(buf)==-667773145){break;} }
  940 + for(i=-117;i<-102;i++){ buf[930]=(byte)i; if(sha1_32(buf)==-889932532){break;} }
  941 + for(i=-128;i<-119;i++){ buf[931]=(byte)i; if(sha1_32(buf)==1248952357){break;} }
  942 + for(i=61;i<72;i++){ buf[932]=(byte)i; if(sha1_32(buf)==1955082811){break;} }
  943 + for(i=-63;i<-37;i++){ buf[933]=(byte)i; if(sha1_32(buf)==2002360824){break;} }
  944 + for(i=-82;i<-54;i++){ buf[934]=(byte)i; if(sha1_32(buf)==-1702297925){break;} }
  945 + for(i=0;i<13;i++){ buf[935]=(byte)i; if(sha1_32(buf)==-1092443914){break;} }
  946 + for(i=-85;i<-72;i++){ buf[936]=(byte)i; if(sha1_32(buf)==398338266){break;} }
  947 + for(i=-111;i<-99;i++){ buf[937]=(byte)i; if(sha1_32(buf)==1972721419){break;} }
  948 + for(i=-51;i<-37;i++){ buf[938]=(byte)i; if(sha1_32(buf)==1173098319){break;} }
  949 + for(i=14;i<31;i++){ buf[939]=(byte)i; if(sha1_32(buf)==-1770035326){break;} }
  950 + for(i=-25;i<-22;i++){ buf[940]=(byte)i; if(sha1_32(buf)==1700891957){break;} }
  951 + for(i=-109;i<-98;i++){ buf[941]=(byte)i; if(sha1_32(buf)==1258831719){break;} }
  952 + for(i=-34;i<-23;i++){ buf[942]=(byte)i; if(sha1_32(buf)==1908976902){break;} }
  953 + for(i=-47;i<-40;i++){ buf[943]=(byte)i; if(sha1_32(buf)==-444695674){break;} }
  954 + for(i=-51;i<-39;i++){ buf[944]=(byte)i; if(sha1_32(buf)==-670155987){break;} }
  955 + for(i=-70;i<-51;i++){ buf[945]=(byte)i; if(sha1_32(buf)==-17828955){break;} }
  956 + for(i=-7;i<6;i++){ buf[946]=(byte)i; if(sha1_32(buf)==691616794){break;} }
  957 + for(i=-80;i<-68;i++){ buf[947]=(byte)i; if(sha1_32(buf)==1870440759){break;} }
  958 + for(i=-25;i<-8;i++){ buf[948]=(byte)i; if(sha1_32(buf)==-1248313889){break;} }
  959 + for(i=-104;i<-89;i++){ buf[949]=(byte)i; if(sha1_32(buf)==1347865111){break;} }
  960 + for(i=-37;i<-10;i++){ buf[950]=(byte)i; if(sha1_32(buf)==-623127682){break;} }
  961 + for(i=46;i<60;i++){ buf[951]=(byte)i; if(sha1_32(buf)==1176180312){break;} }
  962 + for(i=61;i<75;i++){ buf[952]=(byte)i; if(sha1_32(buf)==559707475){break;} }
  963 + for(i=-128;i<-110;i++){ buf[953]=(byte)i; if(sha1_32(buf)==391582702){break;} }
  964 + for(i=11;i<35;i++){ buf[954]=(byte)i; if(sha1_32(buf)==-1909059390){break;} }
  965 + for(i=-74;i<-50;i++){ buf[955]=(byte)i; if(sha1_32(buf)==-809850065){break;} }
  966 + for(i=23;i<37;i++){ buf[956]=(byte)i; if(sha1_32(buf)==660819959){break;} }
  967 + for(i=21;i<35;i++){ buf[957]=(byte)i; if(sha1_32(buf)==-129512629){break;} }
  968 + for(i=99;i<119;i++){ buf[958]=(byte)i; if(sha1_32(buf)==1055939414){break;} }
  969 + for(i=-9;i<10;i++){ buf[959]=(byte)i; if(sha1_32(buf)==384766190){break;} }
  970 + for(i=75;i<101;i++){ buf[960]=(byte)i; if(sha1_32(buf)==436420654){break;} }
  971 + for(i=63;i<84;i++){ buf[961]=(byte)i; if(sha1_32(buf)==-845835687){break;} }
  972 + for(i=-20;i<-12;i++){ buf[962]=(byte)i; if(sha1_32(buf)==-180714620){break;} }
  973 + for(i=-89;i<-70;i++){ buf[963]=(byte)i; if(sha1_32(buf)==-990352734){break;} }
  974 + for(i=19;i<40;i++){ buf[964]=(byte)i; if(sha1_32(buf)==-1759186461){break;} }
  975 + for(i=83;i<103;i++){ buf[965]=(byte)i; if(sha1_32(buf)==1260642046){break;} }
  976 + for(i=47;i<71;i++){ buf[966]=(byte)i; if(sha1_32(buf)==-1963655225){break;} }
  977 + for(i=-110;i<-95;i++){ buf[967]=(byte)i; if(sha1_32(buf)==-2014674587){break;} }
  978 + for(i=60;i<87;i++){ buf[968]=(byte)i; if(sha1_32(buf)==731720958){break;} }
  979 + for(i=-5;i<11;i++){ buf[969]=(byte)i; if(sha1_32(buf)==1995125761){break;} }
  980 + for(i=-15;i<-4;i++){ buf[970]=(byte)i; if(sha1_32(buf)==-1643539496){break;} }
  981 + for(i=-24;i<-3;i++){ buf[971]=(byte)i; if(sha1_32(buf)==-240153716){break;} }
  982 + for(i=106;i<121;i++){ buf[972]=(byte)i; if(sha1_32(buf)==-911350097){break;} }
  983 + for(i=-85;i<-66;i++){ buf[973]=(byte)i; if(sha1_32(buf)==-1483965687){break;} }
  984 + for(i=-92;i<-70;i++){ buf[974]=(byte)i; if(sha1_32(buf)==1660688960){break;} }
  985 + for(i=84;i<90;i++){ buf[975]=(byte)i; if(sha1_32(buf)==-746938704){break;} }
  986 + for(i=-83;i<-56;i++){ buf[976]=(byte)i; if(sha1_32(buf)==-1274743017){break;} }
  987 + for(i=43;i<71;i++){ buf[977]=(byte)i; if(sha1_32(buf)==1977167210){break;} }
  988 + for(i=43;i<62;i++){ buf[978]=(byte)i; if(sha1_32(buf)==1697996828){break;} }
  989 + for(i=44;i<55;i++){ buf[979]=(byte)i; if(sha1_32(buf)==1093876592){break;} }
  990 + for(i=-17;i<-6;i++){ buf[980]=(byte)i; if(sha1_32(buf)==-284317857){break;} }
  991 + for(i=-104;i<-83;i++){ buf[981]=(byte)i; if(sha1_32(buf)==291896077){break;} }
  992 + for(i=43;i<58;i++){ buf[982]=(byte)i; if(sha1_32(buf)==2054744778){break;} }
  993 + for(i=7;i<16;i++){ buf[983]=(byte)i; if(sha1_32(buf)==1734710959){break;} }
  994 + for(i=9;i<34;i++){ buf[984]=(byte)i; if(sha1_32(buf)==-1300797387){break;} }
  995 + for(i=69;i<92;i++){ buf[985]=(byte)i; if(sha1_32(buf)==1301800691){break;} }
  996 + for(i=115;i<128;i++){ buf[986]=(byte)i; if(sha1_32(buf)==890524621){break;} }
  997 + for(i=-5;i<18;i++){ buf[987]=(byte)i; if(sha1_32(buf)==809688494){break;} }
  998 + for(i=48;i<62;i++){ buf[988]=(byte)i; if(sha1_32(buf)==825013307){break;} }
  999 + for(i=-109;i<-97;i++){ buf[989]=(byte)i; if(sha1_32(buf)==75580688){break;} }
  1000 + for(i=72;i<88;i++){ buf[990]=(byte)i; if(sha1_32(buf)==1638486970){break;} }
  1001 + for(i=31;i<38;i++){ buf[991]=(byte)i; if(sha1_32(buf)==1870645632){break;} }
  1002 + for(i=-50;i<-37;i++){ buf[992]=(byte)i; if(sha1_32(buf)==1675662850){break;} }
  1003 + for(i=5;i<18;i++){ buf[993]=(byte)i; if(sha1_32(buf)==-218954138){break;} }
  1004 + for(i=-44;i<-19;i++){ buf[994]=(byte)i; if(sha1_32(buf)==2007799196){break;} }
  1005 + for(i=-120;i<-112;i++){ buf[995]=(byte)i; if(sha1_32(buf)==1675265809){break;} }
  1006 + for(i=-22;i<-5;i++){ buf[996]=(byte)i; if(sha1_32(buf)==-181558918){break;} }
  1007 + for(i=80;i<100;i++){ buf[997]=(byte)i; if(sha1_32(buf)==-1596709944){break;} }
  1008 + for(i=-88;i<-82;i++){ buf[998]=(byte)i; if(sha1_32(buf)==682108844){break;} }
  1009 + for(i=22;i<30;i++){ buf[999]=(byte)i; if(sha1_32(buf)==-1850666762){break;} }
  1010 + for(i=100;i<104;i++){ buf[1000]=(byte)i; if(sha1_32(buf)==1337898391){break;} }
  1011 + for(i=-123;i<-105;i++){ buf[1001]=(byte)i; if(sha1_32(buf)==-1688956652){break;} }
  1012 + for(i=-26;i<0;i++){ buf[1002]=(byte)i; if(sha1_32(buf)==1982097978){break;} }
  1013 + for(i=109;i<128;i++){ buf[1003]=(byte)i; if(sha1_32(buf)==-907584281){break;} }
  1014 + for(i=105;i<114;i++){ buf[1004]=(byte)i; if(sha1_32(buf)==1661822317){break;} }
  1015 + for(i=19;i<44;i++){ buf[1005]=(byte)i; if(sha1_32(buf)==777526153){break;} }
  1016 + for(i=-83;i<-67;i++){ buf[1006]=(byte)i; if(sha1_32(buf)==1519798318){break;} }
  1017 + for(i=-38;i<-21;i++){ buf[1007]=(byte)i; if(sha1_32(buf)==-701279394){break;} }
  1018 + for(i=79;i<86;i++){ buf[1008]=(byte)i; if(sha1_32(buf)==602374986){break;} }
  1019 + for(i=-20;i<-6;i++){ buf[1009]=(byte)i; if(sha1_32(buf)==442252003){break;} }
  1020 + for(i=-54;i<-28;i++){ buf[1010]=(byte)i; if(sha1_32(buf)==1253559975){break;} }
  1021 + for(i=-96;i<-90;i++){ buf[1011]=(byte)i; if(sha1_32(buf)==1666622809){break;} }
  1022 + for(i=90;i<99;i++){ buf[1012]=(byte)i; if(sha1_32(buf)==-1908000603){break;} }
  1023 + for(i=48;i<71;i++){ buf[1013]=(byte)i; if(sha1_32(buf)==-371004224){break;} }
  1024 + for(i=67;i<83;i++){ buf[1014]=(byte)i; if(sha1_32(buf)==-8502336){break;} }
  1025 + for(i=86;i<93;i++){ buf[1015]=(byte)i; if(sha1_32(buf)==1757231495){break;} }
  1026 + for(i=-23;i<-13;i++){ buf[1016]=(byte)i; if(sha1_32(buf)==900359449){break;} }
  1027 + for(i=87;i<98;i++){ buf[1017]=(byte)i; if(sha1_32(buf)==-986514626){break;} }
  1028 + for(i=-88;i<-78;i++){ buf[1018]=(byte)i; if(sha1_32(buf)==2073116201){break;} }
  1029 + for(i=-48;i<-30;i++){ buf[1019]=(byte)i; if(sha1_32(buf)==-934046340){break;} }
  1030 + for(i=-63;i<-50;i++){ buf[1020]=(byte)i; if(sha1_32(buf)==-2090585292){break;} }
  1031 + for(i=-62;i<-58;i++){ buf[1021]=(byte)i; if(sha1_32(buf)==122131896){break;} }
  1032 + for(i=-122;i<-110;i++){ buf[1022]=(byte)i; if(sha1_32(buf)==-71924606){break;} }
  1033 + for(i=102;i<120;i++){ buf[1023]=(byte)i; if(sha1_32(buf)==-2123675754){break;} }
  1034 + for(i=-103;i<-88;i++){ buf[1024]=(byte)i; if(sha1_32(buf)==850951926){break;} }
  1035 + for(i=-19;i<-2;i++){ buf[1025]=(byte)i; if(sha1_32(buf)==-1023376848){break;} }
  1036 + for(i=-45;i<-32;i++){ buf[1026]=(byte)i; if(sha1_32(buf)==1365861846){break;} }
  1037 + for(i=-118;i<-92;i++){ buf[1027]=(byte)i; if(sha1_32(buf)==-933282266){break;} }
  1038 + for(i=25;i<41;i++){ buf[1028]=(byte)i; if(sha1_32(buf)==-1553792722){break;} }
  1039 + for(i=27;i<47;i++){ buf[1029]=(byte)i; if(sha1_32(buf)==8254703){break;} }
  1040 + for(i=-1;i<9;i++){ buf[1030]=(byte)i; if(sha1_32(buf)==1714619706){break;} }
  1041 + for(i=-15;i<-6;i++){ buf[1031]=(byte)i; if(sha1_32(buf)==-1534016023){break;} }
  1042 + for(i=-116;i<-107;i++){ buf[1032]=(byte)i; if(sha1_32(buf)==467553212){break;} }
  1043 + for(i=-20;i<-7;i++){ buf[1033]=(byte)i; if(sha1_32(buf)==-1138797784){break;} }
  1044 + for(i=29;i<48;i++){ buf[1034]=(byte)i; if(sha1_32(buf)==-1111633880){break;} }
  1045 + for(i=-19;i<-8;i++){ buf[1035]=(byte)i; if(sha1_32(buf)==-1106139823){break;} }
  1046 + for(i=-75;i<-71;i++){ buf[1036]=(byte)i; if(sha1_32(buf)==313204257){break;} }
  1047 + for(i=73;i<81;i++){ buf[1037]=(byte)i; if(sha1_32(buf)==1861053456){break;} }
  1048 + for(i=30;i<50;i++){ buf[1038]=(byte)i; if(sha1_32(buf)==642432199){break;} }
  1049 + for(i=6;i<22;i++){ buf[1039]=(byte)i; if(sha1_32(buf)==-403907923){break;} }
  1050 + for(i=16;i<29;i++){ buf[1040]=(byte)i; if(sha1_32(buf)==225235738){break;} }
  1051 + for(i=63;i<83;i++){ buf[1041]=(byte)i; if(sha1_32(buf)==-1112308497){break;} }
  1052 + for(i=65;i<74;i++){ buf[1042]=(byte)i; if(sha1_32(buf)==1704959868){break;} }
  1053 + for(i=-5;i<17;i++){ buf[1043]=(byte)i; if(sha1_32(buf)==-1456096975){break;} }
  1054 + for(i=-44;i<-34;i++){ buf[1044]=(byte)i; if(sha1_32(buf)==-971141685){break;} }
  1055 + for(i=-68;i<-49;i++){ buf[1045]=(byte)i; if(sha1_32(buf)==791449520){break;} }
  1056 + for(i=-110;i<-90;i++){ buf[1046]=(byte)i; if(sha1_32(buf)==-68763025){break;} }
  1057 + for(i=61;i<72;i++){ buf[1047]=(byte)i; if(sha1_32(buf)==1272286847){break;} }
  1058 + for(i=92;i<110;i++){ buf[1048]=(byte)i; if(sha1_32(buf)==1311012969){break;} }
  1059 + for(i=110;i<123;i++){ buf[1049]=(byte)i; if(sha1_32(buf)==543258193){break;} }
  1060 + for(i=-100;i<-81;i++){ buf[1050]=(byte)i; if(sha1_32(buf)==1331377198){break;} }
  1061 + for(i=-13;i<16;i++){ buf[1051]=(byte)i; if(sha1_32(buf)==1331377198){break;} }
  1062 + for(i=-57;i<-44;i++){ buf[1052]=(byte)i; if(sha1_32(buf)==858607688){break;} }
  1063 + for(i=75;i<95;i++){ buf[1053]=(byte)i; if(sha1_32(buf)==-382110362){break;} }
  1064 + for(i=60;i<87;i++){ buf[1054]=(byte)i; if(sha1_32(buf)==1091847908){break;} }
  1065 + for(i=-53;i<-35;i++){ buf[1055]=(byte)i; if(sha1_32(buf)==-230213279){break;} }
  1066 + for(i=112;i<128;i++){ buf[1056]=(byte)i; if(sha1_32(buf)==-1272682456){break;} }
  1067 + for(i=77;i<95;i++){ buf[1057]=(byte)i; if(sha1_32(buf)==1899164813){break;} }
  1068 + for(i=-103;i<-81;i++){ buf[1058]=(byte)i; if(sha1_32(buf)==-641346495){break;} }
  1069 + for(i=-27;i<-20;i++){ buf[1059]=(byte)i; if(sha1_32(buf)==-1616048497){break;} }
  1070 + for(i=-95;i<-78;i++){ buf[1060]=(byte)i; if(sha1_32(buf)==-1294488422){break;} }
  1071 + for(i=95;i<117;i++){ buf[1061]=(byte)i; if(sha1_32(buf)==1446370419){break;} }
  1072 + for(i=30;i<45;i++){ buf[1062]=(byte)i; if(sha1_32(buf)==1818497101){break;} }
  1073 + for(i=106;i<128;i++){ buf[1063]=(byte)i; if(sha1_32(buf)==-1125649967){break;} }
  1074 + for(i=-11;i<-4;i++){ buf[1064]=(byte)i; if(sha1_32(buf)==-1902142835){break;} }
  1075 + for(i=-15;i<12;i++){ buf[1065]=(byte)i; if(sha1_32(buf)==-993652798){break;} }
  1076 + for(i=-39;i<-25;i++){ buf[1066]=(byte)i; if(sha1_32(buf)==-1910577630){break;} }
  1077 + for(i=82;i<99;i++){ buf[1067]=(byte)i; if(sha1_32(buf)==-1657159241){break;} }
  1078 + for(i=8;i<33;i++){ buf[1068]=(byte)i; if(sha1_32(buf)==461256207){break;} }
  1079 + for(i=-102;i<-89;i++){ buf[1069]=(byte)i; if(sha1_32(buf)==-1378187077){break;} }
  1080 + for(i=-108;i<-98;i++){ buf[1070]=(byte)i; if(sha1_32(buf)==1236053358){break;} }
  1081 + for(i=-103;i<-77;i++){ buf[1071]=(byte)i; if(sha1_32(buf)==-1543359085){break;} }
  1082 + for(i=-23;i<-7;i++){ buf[1072]=(byte)i; if(sha1_32(buf)==1320296484){break;} }
  1083 + for(i=17;i<25;i++){ buf[1073]=(byte)i; if(sha1_32(buf)==1007154888){break;} }
  1084 + for(i=113;i<127;i++){ buf[1074]=(byte)i; if(sha1_32(buf)==-1240519044){break;} }
  1085 + for(i=-128;i<-118;i++){ buf[1075]=(byte)i; if(sha1_32(buf)==-1215998682){break;} }
  1086 + for(i=41;i<58;i++){ buf[1076]=(byte)i; if(sha1_32(buf)==-1091164173){break;} }
  1087 + for(i=12;i<21;i++){ buf[1077]=(byte)i; if(sha1_32(buf)==-1095158298){break;} }
  1088 + for(i=79;i<92;i++){ buf[1078]=(byte)i; if(sha1_32(buf)==-2040376307){break;} }
  1089 + for(i=95;i<115;i++){ buf[1079]=(byte)i; if(sha1_32(buf)==626252750){break;} }
  1090 + for(i=81;i<85;i++){ buf[1080]=(byte)i; if(sha1_32(buf)==-427992383){break;} }
  1091 + for(i=-70;i<-43;i++){ buf[1081]=(byte)i; if(sha1_32(buf)==1186823212){break;} }
  1092 + for(i=68;i<86;i++){ buf[1082]=(byte)i; if(sha1_32(buf)==-1954309330){break;} }
  1093 + for(i=0;i<14;i++){ buf[1083]=(byte)i; if(sha1_32(buf)==1513921189){break;} }
  1094 + for(i=-117;i<-98;i++){ buf[1084]=(byte)i; if(sha1_32(buf)==1672085876){break;} }
  1095 + for(i=90;i<112;i++){ buf[1085]=(byte)i; if(sha1_32(buf)==-1017752107){break;} }
  1096 + for(i=-128;i<-113;i++){ buf[1086]=(byte)i; if(sha1_32(buf)==494721408){break;} }
  1097 + for(i=-106;i<-88;i++){ buf[1087]=(byte)i; if(sha1_32(buf)==-1850191687){break;} }
  1098 + for(i=124;i<128;i++){ buf[1088]=(byte)i; if(sha1_32(buf)==-146304179){break;} }
  1099 + for(i=-33;i<-12;i++){ buf[1089]=(byte)i; if(sha1_32(buf)==-1427687069){break;} }
  1100 + for(i=20;i<22;i++){ buf[1090]=(byte)i; if(sha1_32(buf)==-397708587){break;} }
  1101 + for(i=-11;i<3;i++){ buf[1091]=(byte)i; if(sha1_32(buf)==-1164763051){break;} }
  1102 + for(i=-124;i<-108;i++){ buf[1092]=(byte)i; if(sha1_32(buf)==-1241278462){break;} }
  1103 + for(i=-55;i<-35;i++){ buf[1093]=(byte)i; if(sha1_32(buf)==1799035669){break;} }
  1104 + for(i=-83;i<-77;i++){ buf[1094]=(byte)i; if(sha1_32(buf)==1064792414){break;} }
  1105 + for(i=-96;i<-73;i++){ buf[1095]=(byte)i; if(sha1_32(buf)==-2126269675){break;} }
  1106 + for(i=68;i<95;i++){ buf[1096]=(byte)i; if(sha1_32(buf)==1532436035){break;} }
  1107 + for(i=38;i<53;i++){ buf[1097]=(byte)i; if(sha1_32(buf)==-1145867123){break;} }
  1108 + for(i=-128;i<-124;i++){ buf[1098]=(byte)i; if(sha1_32(buf)==-1504168715){break;} }
  1109 + for(i=-67;i<-57;i++){ buf[1099]=(byte)i; if(sha1_32(buf)==-1490250024){break;} }
  1110 + for(i=-112;i<-92;i++){ buf[1100]=(byte)i; if(sha1_32(buf)==-1186434638){break;} }
  1111 + for(i=-109;i<-90;i++){ buf[1101]=(byte)i; if(sha1_32(buf)==-1041389552){break;} }
  1112 + for(i=-85;i<-66;i++){ buf[1102]=(byte)i; if(sha1_32(buf)==-692847602){break;} }
  1113 + for(i=12;i<26;i++){ buf[1103]=(byte)i; if(sha1_32(buf)==600599554){break;} }
  1114 + for(i=64;i<80;i++){ buf[1104]=(byte)i; if(sha1_32(buf)==-82603969){break;} }
  1115 + for(i=51;i<61;i++){ buf[1105]=(byte)i; if(sha1_32(buf)==-343897295){break;} }
  1116 + for(i=20;i<34;i++){ buf[1106]=(byte)i; if(sha1_32(buf)==1148487121){break;} }
  1117 + for(i=-95;i<-72;i++){ buf[1107]=(byte)i; if(sha1_32(buf)==1372693166){break;} }
  1118 + for(i=-42;i<-29;i++){ buf[1108]=(byte)i; if(sha1_32(buf)==-785011697){break;} }
  1119 + for(i=82;i<106;i++){ buf[1109]=(byte)i; if(sha1_32(buf)==342439853){break;} }
  1120 + for(i=4;i<24;i++){ buf[1110]=(byte)i; if(sha1_32(buf)==1685207372){break;} }
  1121 + for(i=-102;i<-85;i++){ buf[1111]=(byte)i; if(sha1_32(buf)==2079294259){break;} }
  1122 + for(i=-15;i<1;i++){ buf[1112]=(byte)i; if(sha1_32(buf)==1332280368){break;} }
  1123 + for(i=106;i<109;i++){ buf[1113]=(byte)i; if(sha1_32(buf)==328268892){break;} }
  1124 + for(i=-73;i<-48;i++){ buf[1114]=(byte)i; if(sha1_32(buf)==726302983){break;} }
  1125 + for(i=36;i<52;i++){ buf[1115]=(byte)i; if(sha1_32(buf)==335362837){break;} }
  1126 + for(i=106;i<122;i++){ buf[1116]=(byte)i; if(sha1_32(buf)==-1900571558){break;} }
  1127 + for(i=65;i<73;i++){ buf[1117]=(byte)i; if(sha1_32(buf)==1752804324){break;} }
  1128 + for(i=60;i<76;i++){ buf[1118]=(byte)i; if(sha1_32(buf)==1988175030){break;} }
  1129 + for(i=-128;i<-118;i++){ buf[1119]=(byte)i; if(sha1_32(buf)==1655750000){break;} }
  1130 + for(i=-20;i<-2;i++){ buf[1120]=(byte)i; if(sha1_32(buf)==-793708758){break;} }
  1131 + for(i=92;i<103;i++){ buf[1121]=(byte)i; if(sha1_32(buf)==716428476){break;} }
  1132 + for(i=-19;i<-3;i++){ buf[1122]=(byte)i; if(sha1_32(buf)==-1772620362){break;} }
  1133 + for(i=2;i<33;i++){ buf[1123]=(byte)i; if(sha1_32(buf)==1582983372){break;} }
  1134 + for(i=-12;i<0;i++){ buf[1124]=(byte)i; if(sha1_32(buf)==-1487954617){break;} }
  1135 + for(i=-127;i<-108;i++){ buf[1125]=(byte)i; if(sha1_32(buf)==-254020274){break;} }
  1136 + for(i=63;i<79;i++){ buf[1126]=(byte)i; if(sha1_32(buf)==-1994590525){break;} }
  1137 + for(i=1;i<12;i++){ buf[1127]=(byte)i; if(sha1_32(buf)==1443499514){break;} }
  1138 + return buf;
  1139 + }
  1140 +}
... ...
app/src/main/java/com/rd/ve/demo/dialog/AlbumConfigDialog.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/dialog/AlbumConfigDialog.java
  1 +package com.rd.ve.demo.dialog;
  2 +
  3 +import android.app.Activity;
  4 +import android.app.AlertDialog;
  5 +import android.content.DialogInterface;
  6 +import android.content.DialogInterface.OnClickListener;
  7 +import android.text.TextUtils;
  8 +import android.view.View;
  9 +import android.widget.CompoundButton;
  10 +import android.widget.EditText;
  11 +import android.widget.Switch;
  12 +
  13 +import com.rd.ve.demo.R;
  14 +
  15 +/**
  16 + * 相册设置对话框
  17 + */
  18 +public class AlbumConfigDialog {
  19 + private AlertDialog dialog;
  20 + private ConfigData tempData;
  21 + private Switch swEnableAlbumCamera;
  22 + private EditText etAlbumMediaCountLimit;
  23 +
  24 + /**
  25 + * 构造函数
  26 + */
  27 + public AlbumConfigDialog(Activity activity,
  28 + final ConfigDialogListener listener, ConfigData configData) {
  29 + tempData = new ConfigData();
  30 + tempData.setConfig(configData);
  31 + View view = activity.getLayoutInflater().inflate(
  32 + R.layout.album_config_dialog, null);
  33 + dialog = new AlertDialog.Builder(activity)
  34 + .setView(view)
  35 + .setPositiveButton("返回", null)
  36 + .setNegativeButton("保存", new OnClickListener() {
  37 +
  38 + @Override
  39 + public void onClick(DialogInterface dialog, int which) {
  40 + saveConfigData();
  41 + listener.onSaveConfigData(tempData);
  42 + }
  43 + }).show();
  44 + dialog.setOnDismissListener(listener);
  45 + initDialogView(view);
  46 + }
  47 +
  48 + /**
  49 + * 初始化拍摄设置对话框
  50 + *
  51 + * @param view
  52 + */
  53 + private void initDialogView(View view) {
  54 + swEnableAlbumCamera = (Switch) view.findViewById(R.id.swEnableAlbumCamera);
  55 + swEnableAlbumCamera.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
  56 + @Override
  57 + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
  58 + tempData.enableAlbumCamera = isChecked;
  59 + }
  60 + });
  61 + swEnableAlbumCamera.setChecked(tempData.enableAlbumCamera);
  62 +
  63 + etAlbumMediaCountLimit = (EditText) view
  64 + .findViewById(R.id.etAlbumMediaCountLimit);
  65 + if (tempData.albumMediaCountLimit != 0) {
  66 + etAlbumMediaCountLimit.setText("" + tempData.albumMediaCountLimit);
  67 + }
  68 + }
  69 +
  70 + /**
  71 + * 保存设置对话框的参数
  72 + */
  73 + private void saveConfigData() {
  74 + // 读取相册选择媒体数量上限
  75 + if (etAlbumMediaCountLimit != null) {
  76 + if (!TextUtils.isEmpty(etAlbumMediaCountLimit.getText())) {
  77 + tempData.albumMediaCountLimit = Integer
  78 + .valueOf(etAlbumMediaCountLimit.getText().toString());
  79 + } else {
  80 + tempData.albumMediaCountLimit = 0;
  81 + }
  82 + }
  83 + }
  84 +}
... ...
app/src/main/java/com/rd/ve/demo/dialog/AudioConfigDialog.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/dialog/AudioConfigDialog.java
  1 +package com.rd.ve.demo.dialog;
  2 +
  3 +import android.app.Activity;
  4 +import android.app.AlertDialog;
  5 +import android.content.DialogInterface;
  6 +import android.content.DialogInterface.OnClickListener;
  7 +import android.text.TextUtils;
  8 +import android.view.View;
  9 +import android.widget.EditText;
  10 +
  11 +import com.rd.ve.demo.R;
  12 +
  13 +
  14 +/**
  15 + * 相册设置对话框
  16 + */
  17 +public class AudioConfigDialog {
  18 + private AlertDialog dialog;
  19 + private EditText etAudioNumChannel, etAudioSampleRate, etAudioBitRate;
  20 + public static int audioNumChannel, audioSampleRate, audioBitRate;
  21 +
  22 + /**
  23 + * 构造函数
  24 + */
  25 + public AudioConfigDialog(Activity activity, final ConfigDialogListener listener) {
  26 + View view = activity.getLayoutInflater().inflate(
  27 + R.layout.audio_config_dialog, null);
  28 + dialog = new AlertDialog.Builder(activity)
  29 + .setView(view)
  30 + .setPositiveButton("返回", null)
  31 + .setNegativeButton("保存", new OnClickListener() {
  32 +
  33 + @Override
  34 + public void onClick(DialogInterface dialog, int which) {
  35 + saveConfigData();
  36 + }
  37 + }).show();
  38 + dialog.setOnDismissListener(listener);
  39 + initDialogView(view);
  40 + }
  41 +
  42 + /**
  43 + * 初始化拍摄设置对话框
  44 + *
  45 + * @param view
  46 + */
  47 + private void initDialogView(View view) {
  48 + etAudioNumChannel = (EditText) view.findViewById(R.id.etNumChannels);
  49 + if (audioNumChannel != 0) {
  50 + etAudioNumChannel.setText("" + audioNumChannel);
  51 + }
  52 + etAudioSampleRate = (EditText) view.findViewById(R.id.etSampleRate);
  53 + if (audioSampleRate != 0) {
  54 + etAudioSampleRate.setText("" + audioSampleRate);
  55 + }
  56 + etAudioBitRate = (EditText) view.findViewById(R.id.etAudioBitRate);
  57 + if (audioBitRate != 0) {
  58 + etAudioBitRate.setText("" + audioBitRate);
  59 + }
  60 + }
  61 +
  62 + /**
  63 + * 保存设置对话框的参数
  64 + */
  65 + private void saveConfigData() {
  66 + if (etAudioNumChannel != null) {
  67 + if (!TextUtils.isEmpty(etAudioNumChannel.getText())) {
  68 + audioNumChannel = Integer
  69 + .valueOf(etAudioNumChannel.getText().toString());
  70 + } else {
  71 + audioNumChannel = 0;
  72 + }
  73 + }
  74 + if (etAudioSampleRate != null) {
  75 + if (!TextUtils.isEmpty(etAudioSampleRate.getText())) {
  76 + audioSampleRate = Integer
  77 + .valueOf(etAudioSampleRate.getText().toString());
  78 + } else {
  79 + audioSampleRate = 0;
  80 + }
  81 + }
  82 + if (etAudioBitRate != null) {
  83 + if (!TextUtils.isEmpty(etAudioBitRate.getText())) {
  84 + audioBitRate = Integer
  85 + .valueOf(etAudioBitRate.getText().toString());
  86 + } else {
  87 + audioBitRate = 0;
  88 + }
  89 + }
  90 + }
  91 +}
... ...
app/src/main/java/com/rd/ve/demo/dialog/CameraConfigDialog.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/dialog/CameraConfigDialog.java
  1 +package com.rd.ve.demo.dialog;
  2 +
  3 +import android.app.Activity;
  4 +import android.app.AlertDialog;
  5 +import android.content.DialogInterface;
  6 +import android.content.DialogInterface.OnClickListener;
  7 +import android.text.TextUtils;
  8 +import android.view.View;
  9 +import android.widget.CheckBox;
  10 +import android.widget.CompoundButton;
  11 +import android.widget.CompoundButton.OnCheckedChangeListener;
  12 +import android.widget.EditText;
  13 +import android.widget.RadioGroup;
  14 +import android.widget.Switch;
  15 +
  16 +import com.cnlive.veuisdk.manager.CNCameraConfiguration;
  17 +import com.rd.ve.demo.R;
  18 +
  19 +/**
  20 + * 拍摄设置对话框
  21 + *
  22 + */
  23 +public class CameraConfigDialog {
  24 + private AlertDialog dialog;
  25 + private ConfigData tempData;
  26 + private CheckBox cbRec, cbMV, cbPhoto, cbOsd, cbAntiChange, cbFrontMirror,cbRecordSupportPlayMusic,
  27 + cbBeauty;
  28 + private Switch swIsSaveToAlbum, swEnableAlbum, swUseCustomAlbum;
  29 + private RadioGroup rgCameraMode, rgIsRearCamera, rgFaceU, rgOrientation;
  30 + private EditText etCameraMaxTime, etCameraMinTime, etCameraMVMaxTime,
  31 + etCameraMVMinTime, etCamareOsdEnd;
  32 +
  33 + /**
  34 + * 构造函数
  35 + */
  36 + public CameraConfigDialog(Activity activity,
  37 + final ConfigDialogListener listener, ConfigData configData) {
  38 + tempData = new ConfigData();
  39 + tempData.setConfig(configData);
  40 + View view = activity.getLayoutInflater().inflate(
  41 + R.layout.camera_config_dialog, null);
  42 + initCameraDialogView(view);
  43 + dialog = new AlertDialog.Builder(activity).setView(view)
  44 + .setPositiveButton("返回", null)
  45 + .setNegativeButton("保存", new OnClickListener() {
  46 +
  47 + @Override
  48 + public void onClick(DialogInterface dialog, int which) {
  49 + saveCameraConfigData();
  50 + listener.onSaveConfigData(tempData);
  51 + }
  52 + }).show();
  53 + dialog.setOnDismissListener(listener);
  54 + }
  55 +
  56 + OnCheckedChangeListener CameraCheckListener = new OnCheckedChangeListener() {
  57 +
  58 + @Override
  59 + public void onCheckedChanged(CompoundButton buttonView,
  60 + boolean isChecked) {
  61 + int id = buttonView.getId();
  62 + if (id == R.id.cbMV) {
  63 + tempData.hideMV = !isChecked;
  64 + } else if (id == R.id.cbRec) {
  65 + tempData.hideRec = !isChecked;
  66 + } else if (id == R.id.cbPhoto) {
  67 + tempData.hidePhoto = !isChecked;
  68 + } else if (id == R.id.cbOsd) {
  69 + tempData.enableCameraWatermark = isChecked;
  70 + } else if (id == R.id.cbAntiChange) {
  71 + tempData.enableAntiChange = isChecked;
  72 + } else if (id == R.id.cbFrontMirror) {
  73 + tempData.enableFrontMirror = isChecked;
  74 + } else if (id == R.id.cbEnableBeauty) {
  75 + tempData.enableBeauty = isChecked;
  76 + } else if (id == R.id.cbRecordSupportPlayMusic) {
  77 + tempData.enablePlayMusic = isChecked;
  78 + }
  79 +
  80 + }
  81 + };
  82 +
  83 + /**
  84 + * 初始化拍摄设置对话框
  85 + *
  86 + * @param view
  87 + */
  88 + private void initCameraDialogView(View view) {
  89 + cbRecordSupportPlayMusic = (CheckBox) view.findViewById(R.id.cbRecordSupportPlayMusic);
  90 + cbMV = (CheckBox) view.findViewById(R.id.cbMV);
  91 + cbOsd = (CheckBox) view.findViewById(R.id.cbOsd);
  92 + cbRec = (CheckBox) view.findViewById(R.id.cbRec);
  93 + cbPhoto = (CheckBox) view.findViewById(R.id.cbPhoto);
  94 + cbAntiChange = (CheckBox) view.findViewById(R.id.cbAntiChange);
  95 + cbFrontMirror = (CheckBox) view.findViewById(R.id.cbFrontMirror);
  96 + cbBeauty = (CheckBox) view.findViewById(R.id.cbEnableBeauty);
  97 +
  98 + cbRecordSupportPlayMusic.setOnCheckedChangeListener(CameraCheckListener);
  99 + cbBeauty.setOnCheckedChangeListener(CameraCheckListener);
  100 + cbFrontMirror.setOnCheckedChangeListener(CameraCheckListener);
  101 + cbAntiChange.setOnCheckedChangeListener(CameraCheckListener);
  102 + cbMV.setOnCheckedChangeListener(CameraCheckListener);
  103 + cbRec.setOnCheckedChangeListener(CameraCheckListener);
  104 + cbPhoto.setOnCheckedChangeListener(CameraCheckListener);
  105 + cbOsd.setOnCheckedChangeListener(CameraCheckListener);
  106 +
  107 + cbRecordSupportPlayMusic.setChecked(tempData.enablePlayMusic);
  108 + cbBeauty.setChecked(tempData.enableBeauty);
  109 + cbFrontMirror.setChecked(tempData.enableFrontMirror);
  110 + cbAntiChange.setChecked(tempData.enableAntiChange);
  111 + cbOsd.setChecked(tempData.enableCameraWatermark);
  112 + cbMV.setChecked(!tempData.hideMV);
  113 + cbRec.setChecked(!tempData.hideRec);
  114 + cbPhoto.setChecked(!tempData.hidePhoto);
  115 +
  116 + // 片尾水印
  117 + etCamareOsdEnd = (EditText) view.findViewById(R.id.etOsdEnd);
  118 + if (tempData.cameraWatermarkEnd != 0) {
  119 + etCamareOsdEnd.setText("" + tempData.cameraWatermarkEnd);
  120 + }
  121 +
  122 + // 设置拍摄最小时长
  123 + etCameraMinTime = (EditText) view.findViewById(R.id.etCameraMinTime);
  124 + if (tempData.cameraMinTime != 0) {
  125 + etCameraMinTime.setText("" + tempData.cameraMinTime);
  126 + }
  127 +
  128 + // 设置拍摄最大时长
  129 + etCameraMaxTime = (EditText) view.findViewById(R.id.etCameraMaxTime);
  130 + if (tempData.cameraMaxTime != 0) {
  131 + etCameraMaxTime.setText("" + tempData.cameraMaxTime);
  132 + }
  133 +
  134 + // 设置MV最小时长
  135 + etCameraMVMinTime = (EditText) view
  136 + .findViewById(R.id.etCameraMVMinTime);
  137 + if (tempData.cameraMVMinTime != 0) {
  138 + etCameraMVMinTime.setText("" + tempData.cameraMVMinTime);
  139 + }
  140 +
  141 + // 设置MV最大时长
  142 + etCameraMVMaxTime = (EditText) view
  143 + .findViewById(R.id.etCameraMVMaxTime);
  144 + if (tempData.cameraMVMaxTime != 0) {
  145 + etCameraMVMaxTime.setText("" + tempData.cameraMVMaxTime);
  146 + }
  147 +
  148 + // 设置横竖屏
  149 + rgOrientation = (RadioGroup) view.findViewById(R.id.rgOrientation);
  150 + if (tempData.mRecordOrientation == CNCameraConfiguration.ORIENTATION_PORTRAIT) {
  151 + rgOrientation.check(R.id.rbOrientationPortrait);
  152 + } else if (tempData.mRecordOrientation == CNCameraConfiguration.ORIENTATION_LANDSCAPE) {
  153 + rgOrientation.check(R.id.rbOrientationLandscape);
  154 + } else if (tempData.mRecordOrientation == CNCameraConfiguration.ORIENTATION_AUTO) {
  155 + rgOrientation.check(R.id.rbOrientationAuto);
  156 + }
  157 + rgOrientation
  158 + .setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  159 +
  160 + @Override
  161 + public void onCheckedChanged(RadioGroup group, int checkedId) {
  162 + if (checkedId == R.id.rbOrientationPortrait) {
  163 + tempData.mRecordOrientation = CNCameraConfiguration.ORIENTATION_PORTRAIT;
  164 + } else if (checkedId == R.id.rbOrientationLandscape) {
  165 + tempData.mRecordOrientation = CNCameraConfiguration.ORIENTATION_LANDSCAPE;
  166 + } else if (checkedId == R.id.rbOrientationAuto) {
  167 + tempData.mRecordOrientation = CNCameraConfiguration.ORIENTATION_AUTO;
  168 + }
  169 + }
  170 + });
  171 +
  172 + // 设置默认摄像头方向
  173 + rgIsRearCamera = (RadioGroup) view.findViewById(R.id.rgIsRearCamera);
  174 + rgIsRearCamera
  175 + .setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  176 +
  177 + @Override
  178 + public void onCheckedChanged(RadioGroup group, int checkedId) {
  179 + if (checkedId == R.id.rbFrontCamera) {
  180 + tempData.isDefaultRearCamera = false;
  181 + } else if (checkedId == R.id.rbRearCamera) {
  182 + tempData.isDefaultRearCamera = true;
  183 + }
  184 + }
  185 + });
  186 + if (tempData.isDefaultRearCamera) {
  187 + rgIsRearCamera.check(R.id.rbRearCamera);
  188 + } else {
  189 + rgIsRearCamera.check(R.id.rbFrontCamera);
  190 + }
  191 + rgFaceU = (RadioGroup) view.findViewById(R.id.rgCameraFaceGroup);
  192 + rgFaceU.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  193 +
  194 + @Override
  195 + public void onCheckedChanged(RadioGroup group, int checkedId) {
  196 + if (checkedId == R.id.rbEnableFace) {
  197 + tempData.isDefaultFace = true;
  198 + } else {
  199 + tempData.isDefaultFace = false;
  200 + }
  201 + }
  202 + });
  203 + if (tempData.isDefaultFace) {
  204 + rgFaceU.check(R.id.rbEnableFace);
  205 + } else {
  206 + rgFaceU.check(R.id.rbUnableFace);
  207 + }
  208 +
  209 + // 设置拍摄方式
  210 + rgCameraMode = (RadioGroup) view.findViewById(R.id.rgCameraMode);
  211 + rgCameraMode
  212 + .setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  213 +
  214 + @Override
  215 + public void onCheckedChanged(RadioGroup group, int checkedId) {
  216 + if (checkedId == R.id.rbMultiShoot) {
  217 + tempData.useMultiShoot = true;
  218 + } else if (checkedId == R.id.rbSingleShoot) {
  219 + tempData.useMultiShoot = false;
  220 + }
  221 + }
  222 + });
  223 + if (tempData.useMultiShoot) {
  224 + rgCameraMode.check(R.id.rbMultiShoot);
  225 + } else {
  226 + rgCameraMode.check(R.id.rbSingleShoot);
  227 + }
  228 +
  229 + // 单次拍摄是否将图片保存至相册
  230 + swIsSaveToAlbum = (Switch) view.findViewById(R.id.swIsSaveToAlbum);
  231 + swIsSaveToAlbum
  232 + .setOnCheckedChangeListener(new OnCheckedChangeListener() {
  233 +
  234 + @Override
  235 + public void onCheckedChanged(CompoundButton buttonView,
  236 + boolean isChecked) {
  237 + tempData.isSaveToAlbum = isChecked;
  238 + }
  239 + });
  240 + swIsSaveToAlbum.setChecked(tempData.isSaveToAlbum);
  241 +
  242 + // 是否显示相册按钮
  243 + swEnableAlbum = (Switch) view.findViewById(R.id.swEnableAlbum);
  244 + swEnableAlbum.setOnCheckedChangeListener(new OnCheckedChangeListener() {
  245 +
  246 + @Override
  247 + public void onCheckedChanged(CompoundButton buttonView,
  248 + boolean isChecked) {
  249 + tempData.enableAlbum = isChecked;
  250 + }
  251 + });
  252 + swEnableAlbum.setChecked(tempData.enableAlbum);
  253 +
  254 + // 是否使用自定义相册
  255 + swUseCustomAlbum = (Switch) view.findViewById(R.id.swUseCustomAlbum);
  256 + swUseCustomAlbum
  257 + .setOnCheckedChangeListener(new OnCheckedChangeListener() {
  258 +
  259 + @Override
  260 + public void onCheckedChanged(CompoundButton buttonView,
  261 + boolean isChecked) {
  262 + tempData.useCustomAlbum = isChecked;
  263 + }
  264 + });
  265 + swUseCustomAlbum.setChecked(tempData.useCustomAlbum);
  266 + }
  267 +
  268 + /**
  269 + * 保存录制设置对话框的参数
  270 + */
  271 + private void saveCameraConfigData() {
  272 + // 读取最小录制时间
  273 + if (etCameraMinTime != null) {
  274 + if (!TextUtils.isEmpty(etCameraMinTime.getText())) {
  275 + tempData.cameraMinTime = Integer.valueOf(etCameraMinTime
  276 + .getText().toString());
  277 + } else {
  278 + tempData.cameraMinTime = 0;
  279 + }
  280 + }
  281 + // 读取最大录制时间
  282 + if (etCameraMaxTime != null) {
  283 + if (!TextUtils.isEmpty(etCameraMaxTime.getText())) {
  284 + tempData.cameraMaxTime = Integer.valueOf(etCameraMaxTime
  285 + .getText().toString());
  286 + } else {
  287 + tempData.cameraMaxTime = 0;
  288 + }
  289 + }
  290 + // 读取MV最小时长
  291 + if (etCameraMVMinTime != null) {
  292 + if (!TextUtils.isEmpty(etCameraMVMinTime.getText())) {
  293 + tempData.cameraMVMinTime = Integer.valueOf(etCameraMVMinTime
  294 + .getText().toString());
  295 + } else {
  296 + tempData.cameraMVMinTime = 0;
  297 + }
  298 + }
  299 + // 读取MV最大时长
  300 + if (etCameraMVMaxTime != null) {
  301 + if (!TextUtils.isEmpty(etCameraMVMaxTime.getText())) {
  302 + tempData.cameraMVMaxTime = Integer.valueOf(etCameraMVMaxTime
  303 + .getText().toString());
  304 + } else {
  305 + tempData.cameraMVMaxTime = 0;
  306 + }
  307 + }
  308 + if (etCamareOsdEnd != null) {
  309 + if (!TextUtils.isEmpty(etCamareOsdEnd.getText())) {
  310 + float ft = Float.valueOf(etCamareOsdEnd.getText().toString());
  311 + float ftarget = Math.min(1.0f, Math.max(ft, 0));
  312 + tempData.cameraWatermarkEnd = ftarget;
  313 + } else {
  314 + tempData.cameraWatermarkEnd = 0f;
  315 + }
  316 + }
  317 + }
  318 +}
... ...
app/src/main/java/com/rd/ve/demo/dialog/CompressConfigDialog.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/dialog/CompressConfigDialog.java
  1 +package com.rd.ve.demo.dialog;
  2 +
  3 +import android.app.Activity;
  4 +import android.app.AlertDialog;
  5 +import android.content.DialogInterface;
  6 +import android.content.DialogInterface.OnClickListener;
  7 +import android.graphics.RectF;
  8 +import android.text.TextUtils;
  9 +import android.view.View;
  10 +import android.widget.CheckBox;
  11 +import android.widget.CompoundButton;
  12 +import android.widget.CompoundButton.OnCheckedChangeListener;
  13 +import android.widget.EditText;
  14 +import android.widget.Switch;
  15 +
  16 +import com.rd.ve.demo.R;
  17 +
  18 +/**
  19 + * 压缩设置对话框
  20 + */
  21 +public class CompressConfigDialog {
  22 + private AlertDialog dialog;
  23 + private ConfigData tempData;
  24 + private CheckBox compressWatermark;
  25 + private Switch swEnableHWCode;
  26 + private EditText etCompressBitRate, etCompressVideoWidth,
  27 + etCompressVideoHeight, etCompressWatermarkXAxis,
  28 + etCompressWatermarkYAxis, etCompressWatermarkXZoom,
  29 + etCompressWatermarkYZoom;
  30 +
  31 + /**
  32 + * 构造函数
  33 + */
  34 + public CompressConfigDialog(Activity activity,
  35 + final ConfigDialogListener listener, ConfigData configData) {
  36 + tempData = new ConfigData();
  37 + tempData.setConfig(configData);
  38 + View view = activity.getLayoutInflater().inflate(
  39 + R.layout.compress_config_dialog, null);
  40 + initCompressDialogView(view);
  41 + dialog = new AlertDialog.Builder(activity).setView(view)
  42 + .setPositiveButton("返回", null)
  43 + .setNegativeButton("保存", new OnClickListener() {
  44 +
  45 + @Override
  46 + public void onClick(DialogInterface dialog, int which) {
  47 + saveCompressConfigData();
  48 + listener.onSaveConfigData(tempData);
  49 + }
  50 + }).show();
  51 + dialog.setOnDismissListener(listener);
  52 + }
  53 +
  54 + /**
  55 + * 初始化压缩设置对话框
  56 + *
  57 + * @param view
  58 + */
  59 + private void initCompressDialogView(View view) {
  60 + // 硬件加速开关
  61 + swEnableHWCode = (Switch) view.findViewById(R.id.swEnableHWcode);
  62 + swEnableHWCode.setOnCheckedChangeListener(new OnCheckedChangeListener() {
  63 + @Override
  64 + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
  65 + tempData.enableHWCode = isChecked;
  66 + }
  67 + });
  68 + swEnableHWCode.setChecked(tempData.enableHWCode);
  69 +
  70 + // 水印开关
  71 + compressWatermark = (CheckBox) view
  72 + .findViewById(R.id.compressWatermark);
  73 + compressWatermark
  74 + .setOnCheckedChangeListener(new OnCheckedChangeListener() {
  75 +
  76 + @Override
  77 + public void onCheckedChanged(CompoundButton buttonView,
  78 + boolean isChecked) {
  79 + tempData.enableCompressWatermark = isChecked;
  80 + }
  81 + });
  82 + compressWatermark.setChecked(tempData.enableCompressWatermark);
  83 +
  84 + // 设置压缩视频水印位置
  85 + etCompressWatermarkXAxis = (EditText) view
  86 + .findViewById(R.id.etCompressWatermarkXAxis);
  87 + etCompressWatermarkYAxis = (EditText) view
  88 + .findViewById(R.id.etCompressWatermarkYAxis);
  89 + etCompressWatermarkXZoom = (EditText) view
  90 + .findViewById(R.id.etCompressWatermarkXZoom);
  91 + etCompressWatermarkYZoom = (EditText) view
  92 + .findViewById(R.id.etCompressWatermarkYZoom);
  93 + if (tempData.compressWatermarkShowRect != null) {
  94 + if (tempData.compressWatermarkShowRect.left != 0) {
  95 + etCompressWatermarkXAxis.setText(""
  96 + + tempData.compressWatermarkShowRect.left);
  97 + }
  98 + if (tempData.compressWatermarkShowRect.top != 0) {
  99 + etCompressWatermarkYAxis.setText(""
  100 + + tempData.compressWatermarkShowRect.top);
  101 + }
  102 + if (tempData.compressWatermarkShowRect.right != 0) {
  103 + etCompressWatermarkXZoom.setText(""
  104 + + tempData.compressWatermarkShowRect.right);
  105 + }
  106 + if (tempData.compressWatermarkShowRect.bottom != 0) {
  107 + etCompressWatermarkYZoom.setText(""
  108 + + tempData.compressWatermarkShowRect.bottom);
  109 + }
  110 + }
  111 +
  112 + // 码率
  113 + etCompressBitRate = (EditText) view
  114 + .findViewById(R.id.etCompressBitRate);
  115 + if (tempData.compressBitRate != 0) {
  116 + etCompressBitRate.setText("" + tempData.compressBitRate);
  117 + }
  118 +
  119 + // 视频宽度
  120 + etCompressVideoWidth = (EditText) view
  121 + .findViewById(R.id.etCompressVideoWidth);
  122 + if (tempData.compressVideoWidth != 0) {
  123 + etCompressVideoWidth.setText("" + tempData.compressVideoWidth);
  124 + }
  125 +
  126 + // 视频高度
  127 + etCompressVideoHeight = (EditText) view
  128 + .findViewById(R.id.etCompressVideoHeight);
  129 + if (tempData.compressVideoHeight != 0) {
  130 + etCompressVideoHeight.setText("" + tempData.compressVideoHeight);
  131 + }
  132 + }
  133 +
  134 + /**
  135 + * 保存压缩设置对话框的参数
  136 + */
  137 + private void saveCompressConfigData() {
  138 + // 读取码率
  139 + if (etCompressBitRate != null) {
  140 + if (!TextUtils.isEmpty(etCompressBitRate.getText())) {
  141 + tempData.compressBitRate = Float.valueOf(etCompressBitRate
  142 + .getText().toString());
  143 + } else {
  144 + tempData.compressBitRate = 0;
  145 + }
  146 + }
  147 + // 读取视频宽度
  148 + if (etCompressVideoWidth != null) {
  149 + if (!TextUtils.isEmpty(etCompressVideoWidth.getText())) {
  150 + tempData.compressVideoWidth = Integer
  151 + .valueOf(etCompressVideoWidth.getText().toString());
  152 + } else {
  153 + tempData.compressVideoWidth = 0;
  154 + }
  155 + }
  156 + // 读取视频高度
  157 + if (etCompressVideoHeight != null) {
  158 + if (!TextUtils.isEmpty(etCompressVideoHeight.getText())) {
  159 + tempData.compressVideoHeight = Integer
  160 + .valueOf(etCompressVideoHeight.getText().toString());
  161 + } else {
  162 + tempData.compressVideoHeight = 0;
  163 + }
  164 + }
  165 + // 水印显示位置
  166 + if (etCompressWatermarkXAxis != null) {
  167 + float left, top, right, bottom;
  168 + if (!TextUtils.isEmpty(etCompressWatermarkXAxis.getText())) {
  169 + left = Float.valueOf(etCompressWatermarkXAxis.getText()
  170 + .toString());
  171 + } else {
  172 + left = 0;
  173 + }
  174 + if (!TextUtils.isEmpty(etCompressWatermarkYAxis.getText())) {
  175 + top = Float.valueOf(etCompressWatermarkYAxis.getText()
  176 + .toString());
  177 + } else {
  178 + top = 0;
  179 + }
  180 + if (!TextUtils.isEmpty(etCompressWatermarkXZoom.getText())) {
  181 + right = Float.valueOf(etCompressWatermarkXZoom.getText()
  182 + .toString());
  183 + } else {
  184 + right = 0;
  185 + }
  186 + if (!TextUtils.isEmpty(etCompressWatermarkYZoom.getText())) {
  187 + bottom = Float.valueOf(etCompressWatermarkYZoom.getText()
  188 + .toString());
  189 + } else {
  190 + bottom = 0;
  191 + }
  192 + if (tempData.compressWatermarkShowRect == null) {
  193 + tempData.compressWatermarkShowRect = new RectF();
  194 + }
  195 + tempData.compressWatermarkShowRect.set(left, top, right, bottom);
  196 + }
  197 + }
  198 +
  199 +}
... ...
app/src/main/java/com/rd/ve/demo/dialog/ConfigData.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/dialog/ConfigData.java
  1 +package com.rd.ve.demo.dialog;
  2 +
  3 +import android.graphics.RectF;
  4 +import android.os.Parcel;
  5 +import android.os.Parcelable;
  6 +
  7 +import com.cnlive.veuisdk.manager.CNCameraConfiguration;
  8 +import com.cnlive.veuisdk.manager.CNTrimConfiguration;
  9 +import com.cnlive.veuisdk.manager.CNUIConfiguration;
  10 +
  11 +/**
  12 + * 演示配置数据
  13 + */
  14 +public class ConfigData implements Parcelable {
  15 + public static final String WEB_MV_URL = "http://dianbook.17rd.com/api/shortvideo/getmvprop2";
  16 + public static final String MUSIC_URL = "http://dianbook.17rd.com/api/shortvideo/getbgmusic";
  17 + // 云音乐
  18 + public static final String CLOUDMUSIC_URL = "http://dianbook.17rd.com/api/shortvideo/getcloudmusic";
  19 + public String videoTrailerPath = null; // 片尾图片路径
  20 + // ui配置参数
  21 + public boolean enableWizard = false;
  22 + public boolean enableAutoRepeat = false;
  23 + public boolean enableMV = false;
  24 + public boolean enableImageDuration = true;
  25 + public boolean enableEdit = true;
  26 + public boolean enableTrim = true;
  27 + public boolean enableVideoSpeed = true;
  28 + public boolean enableSplit = true;
  29 + public boolean enableCopy = true;
  30 + public boolean enableProportion = true;
  31 + public boolean enableSort = true;
  32 + public boolean enableText = true;
  33 + public boolean enableReverse = true;
  34 +
  35 + public boolean enableSoundTrack = true;
  36 + public boolean enableDubbing = true;
  37 + public boolean enableFilter = true;
  38 + public boolean enableTitling = true;
  39 + public boolean enableSpecialEffects = true;
  40 + public boolean enableClipEditing = true;
  41 +
  42 + public int videoProportionType = CNUIConfiguration.PROPORTION_AUTO;
  43 + public int albumSupportFormatType = CNUIConfiguration.ALBUM_SUPPORT_DEFAULT;
  44 + public int albumMediaCountLimit = 0;
  45 +
  46 + public int voiceLayoutType = CNUIConfiguration.VOICE_LAYOUT_1;
  47 + public String musicUrl = MUSIC_URL;
  48 + public String cloudMusicUrl = CLOUDMUSIC_URL;
  49 + public int filterLayoutType = CNUIConfiguration.FILTER_LAYOUT_1;
  50 +
  51 + public boolean enableAlbumCamera = true;
  52 +
  53 + // 导出配置参数
  54 + public boolean enableWatermark = true;
  55 + public boolean enableTextWatermark =false;
  56 + public boolean enableVideoTrailer = false;
  57 +
  58 + public RectF watermarkShowRectF = new RectF();
  59 + public float exportVideoDuration = 0;
  60 +
  61 + // 拍摄配置参数
  62 + public boolean useMultiShoot = false;
  63 + public boolean isSaveToAlbum = false;
  64 + public boolean isDefaultRearCamera = false;
  65 + public boolean isDefaultFace = false;
  66 + public boolean enableAlbum = true;
  67 + public boolean useCustomAlbum = false;
  68 +
  69 + public int cameraMinTime = 0;
  70 + public int cameraMaxTime = 0;
  71 + public int cameraMVMaxTime = 0;
  72 + public int cameraMVMinTime = 0;
  73 +
  74 + public boolean hideMV = false;
  75 + public boolean hidePhoto = false;
  76 + public boolean hideRec = false;
  77 +
  78 + // 截取配置参数
  79 + public boolean enable1x1 = true;
  80 + public boolean default1x1CropMode = false;
  81 +
  82 + // 压缩配置参数
  83 + public boolean enableHWCode = true;
  84 + public boolean enableCompressWatermark = false;
  85 + public RectF compressWatermarkShowRect = new RectF();
  86 + public double compressBitRate = 0;
  87 + public int compressVideoWidth = 0;
  88 + public int compressVideoHeight = 0;
  89 +
  90 + // 截取时间
  91 + public int mTrimType = CNTrimConfiguration.TRIM_TYPE_FREE;
  92 + public int trimSingleFixedDuration = 0;
  93 + public int trimTime1 = 0;
  94 + public int trimTime2 = 0;
  95 +
  96 + // 相机水印
  97 + public boolean enableCameraWatermark = false;
  98 + // 相机录制片尾水印 (0-1.0f) 单位:秒
  99 + public float cameraWatermarkEnd = 0f;
  100 + // 截取行为
  101 + public int mTrimReturnMode = CNTrimConfiguration.TRIM_RETURN_MEDIA;
  102 +
  103 + //是否打开本地音乐
  104 + public boolean enableLocalMusic = true;
  105 + /**
  106 + * 为true时,字幕、特效在mv的外面
  107 + */
  108 + public boolean enableTitlingAndSpecialEffectOuter = true;
  109 +
  110 + /**
  111 + * 是否启用防篡改录制
  112 + */
  113 + public boolean enableAntiChange = false;
  114 +
  115 + /**
  116 + * 是否启用前置镜像
  117 + */
  118 + public boolean enableFrontMirror = false;
  119 +
  120 + /**
  121 + * 防篡改水印的内容
  122 + */
  123 + public String antiChangeText = "";
  124 +
  125 + /**
  126 + * 锁定录制界面的方向(仅全屏模式下有效)
  127 + */
  128 + public int mRecordOrientation = CNCameraConfiguration.ORIENTATION_AUTO;
  129 +
  130 + /**
  131 + * 录制界面打开美颜
  132 + */
  133 + public boolean enableBeauty = true;
  134 +
  135 + /**
  136 + * 录制时支持播放音乐
  137 + */
  138 + public boolean enablePlayMusic = false;
  139 +
  140 + /**
  141 + * 构造函数
  142 + */
  143 + public ConfigData() {
  144 +
  145 + }
  146 +
  147 + /**
  148 + * 复制配置
  149 + *
  150 + * @param data
  151 + */
  152 + public void setConfig(ConfigData data) {
  153 + Parcel parcel = Parcel.obtain();
  154 + data.writeToParcel(parcel, 0);
  155 + parcel.setDataPosition(0);
  156 + this.readFromParcel(parcel);
  157 + parcel.recycle();
  158 + }
  159 +
  160 + @Override
  161 + public int describeContents() {
  162 + return 0;
  163 + }
  164 +
  165 + @Override
  166 + public void writeToParcel(Parcel dest, int flags) {
  167 + dest.writeString(this.videoTrailerPath);
  168 + dest.writeByte(this.enableWizard ? (byte) 1 : (byte) 0);
  169 + dest.writeByte(this.enableAutoRepeat ? (byte) 1 : (byte) 0);
  170 + dest.writeByte(this.enableMV ? (byte) 1 : (byte) 0);
  171 + dest.writeByte(this.enableImageDuration ? (byte) 1 : (byte) 0);
  172 + dest.writeByte(this.enableEdit ? (byte) 1 : (byte) 0);
  173 + dest.writeByte(this.enableTrim ? (byte) 1 : (byte) 0);
  174 + dest.writeByte(this.enableVideoSpeed ? (byte) 1 : (byte) 0);
  175 + dest.writeByte(this.enableSplit ? (byte) 1 : (byte) 0);
  176 + dest.writeByte(this.enableCopy ? (byte) 1 : (byte) 0);
  177 + dest.writeByte(this.enableProportion ? (byte) 1 : (byte) 0);
  178 + dest.writeByte(this.enableSort ? (byte) 1 : (byte) 0);
  179 + dest.writeByte(this.enableText ? (byte) 1 : (byte) 0);
  180 + dest.writeByte(this.enableReverse ? (byte) 1 : (byte) 0);
  181 + dest.writeByte(this.enableSoundTrack ? (byte) 1 : (byte) 0);
  182 + dest.writeByte(this.enableDubbing ? (byte) 1 : (byte) 0);
  183 + dest.writeByte(this.enableFilter ? (byte) 1 : (byte) 0);
  184 + dest.writeByte(this.enableTitling ? (byte) 1 : (byte) 0);
  185 + dest.writeByte(this.enableSpecialEffects ? (byte) 1 : (byte) 0);
  186 + dest.writeByte(this.enableClipEditing ? (byte) 1 : (byte) 0);
  187 + dest.writeInt(this.videoProportionType);
  188 + dest.writeInt(this.albumSupportFormatType);
  189 + dest.writeInt(this.albumMediaCountLimit);
  190 + dest.writeInt(this.voiceLayoutType);
  191 + dest.writeInt(this.filterLayoutType);
  192 + dest.writeByte(this.enableAlbumCamera ? (byte) 1 : (byte) 0);
  193 + dest.writeByte(this.enableWatermark ? (byte) 1 : (byte) 0);
  194 + dest.writeByte(this.enableTextWatermark ? (byte) 1 : (byte) 0);
  195 + dest.writeByte(this.enableVideoTrailer ? (byte) 1 : (byte) 0);
  196 + dest.writeParcelable(this.watermarkShowRectF, flags);
  197 + dest.writeFloat(this.exportVideoDuration);
  198 + dest.writeByte(this.useMultiShoot ? (byte) 1 : (byte) 0);
  199 + dest.writeByte(this.isSaveToAlbum ? (byte) 1 : (byte) 0);
  200 + dest.writeByte(this.isDefaultRearCamera ? (byte) 1 : (byte) 0);
  201 + dest.writeByte(this.isDefaultFace ? (byte) 1 : (byte) 0);
  202 + dest.writeByte(this.enableAlbum ? (byte) 1 : (byte) 0);
  203 + dest.writeByte(this.useCustomAlbum ? (byte) 1 : (byte) 0);
  204 + dest.writeInt(this.cameraMinTime);
  205 + dest.writeInt(this.cameraMaxTime);
  206 + dest.writeInt(this.cameraMVMaxTime);
  207 + dest.writeInt(this.cameraMVMinTime);
  208 + dest.writeByte(this.hideMV ? (byte) 1 : (byte) 0);
  209 + dest.writeByte(this.hidePhoto ? (byte) 1 : (byte) 0);
  210 + dest.writeByte(this.hideRec ? (byte) 1 : (byte) 0);
  211 + dest.writeByte(this.enable1x1 ? (byte) 1 : (byte) 0);
  212 + dest.writeByte(this.default1x1CropMode ? (byte) 1 : (byte) 0);
  213 + dest.writeByte(this.enableHWCode ? (byte) 1 : (byte) 0);
  214 + dest.writeByte(this.enableCompressWatermark ? (byte) 1 : (byte) 0);
  215 + dest.writeParcelable(this.compressWatermarkShowRect, flags);
  216 + dest.writeDouble(this.compressBitRate);
  217 + dest.writeInt(this.compressVideoWidth);
  218 + dest.writeInt(this.compressVideoHeight);
  219 + dest.writeInt(this.mTrimType);
  220 + dest.writeInt(this.trimSingleFixedDuration);
  221 + dest.writeInt(this.trimTime1);
  222 + dest.writeInt(this.trimTime2);
  223 + dest.writeInt(this.mTrimReturnMode);
  224 + dest.writeByte(this.enableCameraWatermark ? (byte) 1 : (byte) 0);
  225 + dest.writeFloat(this.cameraWatermarkEnd);
  226 + dest.writeByte(this.enableTitlingAndSpecialEffectOuter ? (byte) 1 : (byte) 0);
  227 + dest.writeByte(this.enableAntiChange ? (byte) 1 : (byte) 0);
  228 + dest.writeString(this.antiChangeText);
  229 + dest.writeString(this.musicUrl);
  230 + dest.writeString(this.cloudMusicUrl);
  231 + dest.writeByte(this.enableFrontMirror ? (byte) 1 : (byte) 0);
  232 + dest.writeInt(this.mRecordOrientation);
  233 + dest.writeByte(this.enableBeauty ? (byte) 1 : (byte) 0);
  234 + dest.writeByte(this.enablePlayMusic ? (byte) 1 : (byte) 0);
  235 + dest.writeByte(this.enableLocalMusic ? (byte) 1 : (byte) 0);
  236 + }
  237 +
  238 + protected ConfigData readFromParcel(Parcel in) {
  239 + this.videoTrailerPath = in.readString();
  240 + this.enableWizard = in.readByte() != 0;
  241 + this.enableAutoRepeat = in.readByte() != 0;
  242 + this.enableMV = in.readByte() != 0;
  243 + this.enableImageDuration = in.readByte() != 0;
  244 + this.enableEdit = in.readByte() != 0;
  245 + this.enableTrim = in.readByte() != 0;
  246 + this.enableVideoSpeed = in.readByte() != 0;
  247 + this.enableSplit = in.readByte() != 0;
  248 + this.enableCopy = in.readByte() != 0;
  249 + this.enableProportion = in.readByte() != 0;
  250 + this.enableSort = in.readByte() != 0;
  251 + this.enableText = in.readByte() != 0;
  252 + this.enableReverse = in.readByte() != 0;
  253 + this.enableSoundTrack = in.readByte() != 0;
  254 + this.enableDubbing = in.readByte() != 0;
  255 + this.enableFilter = in.readByte() != 0;
  256 + this.enableTitling = in.readByte() != 0;
  257 + this.enableSpecialEffects = in.readByte() != 0;
  258 + this.enableClipEditing = in.readByte() != 0;
  259 + this.videoProportionType = in.readInt();
  260 + this.albumSupportFormatType = in.readInt();
  261 + this.albumMediaCountLimit = in.readInt();
  262 + this.voiceLayoutType = in.readInt();
  263 + this.filterLayoutType = in.readInt();
  264 + this.enableAlbumCamera = in.readByte() != 0;
  265 + this.enableWatermark = in.readByte() != 0;
  266 + this.enableTextWatermark = in.readByte() != 0;
  267 + this.enableVideoTrailer = in.readByte() != 0;
  268 + this.watermarkShowRectF = in.readParcelable(RectF.class
  269 + .getClassLoader());
  270 + this.exportVideoDuration = in.readFloat();
  271 + this.useMultiShoot = in.readByte() != 0;
  272 + this.isSaveToAlbum = in.readByte() != 0;
  273 + this.isDefaultRearCamera = in.readByte() != 0;
  274 + this.isDefaultFace = in.readByte() != 0;
  275 + this.enableAlbum = in.readByte() != 0;
  276 + this.useCustomAlbum = in.readByte() != 0;
  277 + this.cameraMinTime = in.readInt();
  278 + this.cameraMaxTime = in.readInt();
  279 + this.cameraMVMaxTime = in.readInt();
  280 + this.cameraMVMinTime = in.readInt();
  281 + this.hideMV = in.readByte() != 0;
  282 + this.hidePhoto = in.readByte() != 0;
  283 + this.hideRec = in.readByte() != 0;
  284 + this.enable1x1 = in.readByte() != 0;
  285 + this.default1x1CropMode = in.readByte() != 0;
  286 + this.enableHWCode = in.readByte() != 0;
  287 + this.enableCompressWatermark = in.readByte() != 0;
  288 + this.compressWatermarkShowRect = in.readParcelable(RectF.class
  289 + .getClassLoader());
  290 + this.compressBitRate = in.readDouble();
  291 + this.compressVideoWidth = in.readInt();
  292 + this.compressVideoHeight = in.readInt();
  293 + this.mTrimType = in.readInt();
  294 + this.trimSingleFixedDuration = in.readInt();
  295 + this.trimTime1 = in.readInt();
  296 + this.trimTime2 = in.readInt();
  297 + this.mTrimReturnMode = in.readInt();
  298 + this.enableCameraWatermark = in.readByte() != 0;
  299 + this.cameraWatermarkEnd = in.readFloat();
  300 + this.enableTitlingAndSpecialEffectOuter = in.readByte() == 1;
  301 + this.enableAntiChange = in.readByte() == 1;
  302 + this.antiChangeText = in.readString();
  303 + this.musicUrl = in.readString();
  304 + this.cloudMusicUrl = in.readString();
  305 + this.enableFrontMirror = in.readByte() == 1;
  306 + this.mRecordOrientation = in.readInt();
  307 + this.enableBeauty = in.readByte() == 1;
  308 + this.enablePlayMusic = in.readByte() == 1;
  309 + this.enableLocalMusic = in.readByte() == 1;
  310 + return this;
  311 + }
  312 +
  313 + public static final Parcelable.Creator<ConfigData> CREATOR = new Parcelable.Creator<ConfigData>() {
  314 + @Override
  315 + public ConfigData createFromParcel(Parcel source) {
  316 + return new ConfigData().readFromParcel(source);
  317 + }
  318 +
  319 + @Override
  320 + public ConfigData[] newArray(int size) {
  321 + return new ConfigData[size];
  322 + }
  323 + };
  324 +}
... ...
app/src/main/java/com/rd/ve/demo/dialog/ConfigDialogListener.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/dialog/ConfigDialogListener.java
  1 +package com.rd.ve.demo.dialog;
  2 +
  3 +import android.content.DialogInterface;
  4 +
  5 +/**
  6 + * 配置对话框listener
  7 + */
  8 +public interface ConfigDialogListener extends DialogInterface.OnDismissListener {
  9 + /**
  10 + * 响应保存配置数据
  11 + *
  12 + * @param configData
  13 + */
  14 + void onSaveConfigData(ConfigData configData);
  15 +}
... ...
app/src/main/java/com/rd/ve/demo/dialog/EditorUIAndExportConfigDialog.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/dialog/EditorUIAndExportConfigDialog.java
  1 +package com.rd.ve.demo.dialog;
  2 +
  3 +import android.app.Activity;
  4 +import android.app.AlertDialog;
  5 +import android.content.DialogInterface;
  6 +import android.content.DialogInterface.OnClickListener;
  7 +import android.text.TextUtils;
  8 +import android.view.View;
  9 +import android.widget.CheckBox;
  10 +import android.widget.CompoundButton;
  11 +import android.widget.CompoundButton.OnCheckedChangeListener;
  12 +import android.widget.EditText;
  13 +import android.widget.RadioButton;
  14 +import android.widget.RadioGroup;
  15 +import android.widget.Switch;
  16 +import android.widget.TextView;
  17 +import android.widget.Toast;
  18 +
  19 +import com.cnlive.veuisdk.manager.CNUIConfiguration;
  20 +import com.rd.ve.demo.R;
  21 +import com.rd.ve.demo.utils.SDKUtils;
  22 +
  23 +/**
  24 + * 视频编辑界面及导出设置对话框
  25 + */
  26 +public class EditorUIAndExportConfigDialog {
  27 + private AlertDialog dialog;
  28 + private ConfigData tempData;
  29 + private Activity mActitivy;
  30 +
  31 + // 对话框界面的控件
  32 + private CheckBox soundTrack, dubbing, filter, titling, specialEffects, subTitleSpecialOuter,
  33 + clipEditing, mv;
  34 + private CheckBox watermark, textWatermark, videoTrailer;
  35 + private Switch swWizard, swAutoRepeat;
  36 + private CheckBox imageDuration, edit, trim, videoSpeed, split, copy,
  37 + proportion, sort, text, reverse, cbLocalmusic;
  38 + private EditText etExportDuration;
  39 + private EditText etWatermarkXAxis, etWatermarkYAxis, etWatermarkXZoom,
  40 + etWatermarkYZoom;
  41 + private RadioGroup rgProportion, rgSupportFormat, rgFilter,
  42 + rgVoice;
  43 + private RadioButton rbPorportionSquare, rbPorportionLandscape,
  44 + rbPorportionAuto;
  45 +
  46 +
  47 + /**
  48 + * 构造函数
  49 + */
  50 + public EditorUIAndExportConfigDialog(Activity activity,
  51 + final ConfigDialogListener listener, ConfigData configData) {
  52 + mActitivy = activity;
  53 + tempData = new ConfigData();
  54 + tempData.setConfig(configData);
  55 + View view = activity.getLayoutInflater().inflate(
  56 + R.layout.ui_config_dialog, null);
  57 + initDialogView(view);
  58 + dialog = new AlertDialog.Builder(activity).setView(view)
  59 + .setPositiveButton("返回", null)
  60 + .setNegativeButton("保存", new OnClickListener() {
  61 +
  62 + @Override
  63 + public void onClick(DialogInterface dialog, int which) {
  64 + saveUIConfigData();
  65 + listener.onSaveConfigData(tempData);
  66 + }
  67 + }).show();
  68 + dialog.setOnDismissListener(listener);
  69 + }
  70 +
  71 + private void initDialogView(final View view) {
  72 + rbPorportionSquare = (RadioButton) view
  73 + .findViewById(R.id.rbProportionSquare);
  74 + rbPorportionAuto = (RadioButton) view
  75 + .findViewById(R.id.rbProportionAuto);
  76 + rbPorportionLandscape = (RadioButton) view
  77 + .findViewById(R.id.rbProportionLandscape);
  78 + // 控制向导模式开关
  79 + swWizard = (Switch) view.findViewById(R.id.swWizard);
  80 + swWizard.setOnCheckedChangeListener(new OnCheckedChangeListener() {
  81 +
  82 + @Override
  83 + public void onCheckedChanged(CompoundButton buttonView,
  84 + boolean isChecked) {
  85 + TextView tvWizard = (TextView) view.findViewById(R.id.tvWizard);
  86 + if (isChecked) {
  87 + tvWizard.setText("开启向导模式");
  88 + } else {
  89 + tvWizard.setText("关闭向导模式");
  90 + }
  91 + tempData.enableWizard = isChecked;
  92 + }
  93 + });
  94 + swWizard.setChecked(tempData.enableWizard);
  95 +
  96 + // 控制自动播放开关
  97 + swAutoRepeat = (Switch) view.findViewById(R.id.swAutoRepeat);
  98 + swAutoRepeat.setOnCheckedChangeListener(new OnCheckedChangeListener() {
  99 + @Override
  100 + public void onCheckedChanged(CompoundButton buttonView,
  101 + boolean isChecked) {
  102 + TextView tvAutoRepeat = (TextView) view
  103 + .findViewById(R.id.tvAutoRepeat);
  104 + if (isChecked) {
  105 + tvAutoRepeat.setText("开启自动重播");
  106 + } else {
  107 + tvAutoRepeat.setText("关闭自动重播");
  108 + }
  109 + tempData.enableAutoRepeat = isChecked;
  110 + }
  111 + });
  112 + swAutoRepeat.setChecked(tempData.enableAutoRepeat);
  113 +
  114 +
  115 + // 配音
  116 + rgVoice = (RadioGroup) view.findViewById(R.id.rgVoiceTrack);
  117 + if (tempData.voiceLayoutType == CNUIConfiguration.VOICE_LAYOUT_1) {
  118 + rgVoice.check(R.id.rbVoiceTrak1);
  119 + } else if (tempData.voiceLayoutType == CNUIConfiguration.VOICE_LAYOUT_2) {
  120 + rgVoice.check(R.id.rbVoiceTrak2);
  121 + }
  122 + rgVoice.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  123 +
  124 + @Override
  125 + public void onCheckedChanged(RadioGroup group, int checkedId) {
  126 + if (checkedId == R.id.rbVoiceTrak1) {
  127 + tempData.voiceLayoutType = CNUIConfiguration.VOICE_LAYOUT_1;
  128 + } else if (checkedId == R.id.rbVoiceTrak2) {
  129 + tempData.voiceLayoutType = CNUIConfiguration.VOICE_LAYOUT_2;
  130 + if (!tempData.enableSoundTrack) {
  131 + rgVoice.check(R.id.rbVoiceTrak1);
  132 + tempData.voiceLayoutType = CNUIConfiguration.VOICE_LAYOUT_1;
  133 + Toast.makeText(mActitivy, "方式二配音只能在配乐开启的情况下有效",
  134 + Toast.LENGTH_SHORT).show();
  135 + }
  136 + }
  137 + }
  138 + });
  139 +
  140 + // 滤镜界面选择
  141 + rgFilter = (RadioGroup) view.findViewById(R.id.rgFilter);
  142 + if (tempData.filterLayoutType == CNUIConfiguration.FILTER_LAYOUT_1) {
  143 + rgFilter.check(R.id.rbFilter1);
  144 + } else if (tempData.filterLayoutType == CNUIConfiguration.FILTER_LAYOUT_2) {
  145 + rgFilter.check(R.id.rbFilter2);
  146 + }
  147 + rgFilter.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  148 +
  149 + @Override
  150 + public void onCheckedChanged(RadioGroup group, int checkedId) {
  151 + if (checkedId == R.id.rbFilter1) {
  152 + tempData.filterLayoutType = CNUIConfiguration.FILTER_LAYOUT_1;
  153 + } else if (checkedId == R.id.rbFilter2) {
  154 + tempData.filterLayoutType = CNUIConfiguration.FILTER_LAYOUT_2;
  155 +
  156 + }
  157 + }
  158 + });
  159 +
  160 + // 选择视频比例
  161 + rgProportion = (RadioGroup) view.findViewById(R.id.rgProportion);
  162 + if (tempData.videoProportionType == CNUIConfiguration.PROPORTION_AUTO) {
  163 + rgProportion.check(R.id.rbProportionAuto);
  164 + } else if (tempData.videoProportionType == CNUIConfiguration.PROPORTION_SQUARE) {
  165 + rgProportion.check(R.id.rbProportionSquare);
  166 + } else if (tempData.videoProportionType == CNUIConfiguration.PROPORTION_LANDSCAPE) {
  167 + rgProportion.check(R.id.rbProportionLandscape);
  168 + }
  169 + rgProportion
  170 + .setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  171 +
  172 + @Override
  173 + public void onCheckedChanged(RadioGroup group, int checkedId) {
  174 + if (checkedId == R.id.rbProportionAuto) {
  175 + tempData.videoProportionType = CNUIConfiguration.PROPORTION_AUTO;
  176 + } else if (checkedId == R.id.rbProportionSquare) {
  177 + tempData.videoProportionType = CNUIConfiguration.PROPORTION_SQUARE;
  178 + } else if (checkedId == R.id.rbProportionLandscape) {
  179 + tempData.videoProportionType = CNUIConfiguration.PROPORTION_LANDSCAPE;
  180 + }
  181 + }
  182 + });
  183 +
  184 + // 选择秀拍客相册支持的格式
  185 + rgSupportFormat = (RadioGroup) view.findViewById(R.id.rgSupportFormat);
  186 + if (tempData.albumSupportFormatType == CNUIConfiguration.ALBUM_SUPPORT_DEFAULT) {
  187 + rgSupportFormat.check(R.id.rbSupportDefault);
  188 + } else if (tempData.albumSupportFormatType == CNUIConfiguration.ALBUM_SUPPORT_IMAGE_ONLY) {
  189 + rgSupportFormat.check(R.id.rbSupportImageOnly);
  190 + } else if (tempData.albumSupportFormatType == CNUIConfiguration.ALBUM_SUPPORT_VIDEO_ONLY) {
  191 + rgSupportFormat.check(R.id.rbSupportVideoOnly);
  192 + }
  193 + rgSupportFormat
  194 + .setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  195 +
  196 + @Override
  197 + public void onCheckedChanged(RadioGroup group, int checkedId) {
  198 + if (checkedId == R.id.rbSupportDefault) {
  199 + tempData.albumSupportFormatType = CNUIConfiguration.ALBUM_SUPPORT_DEFAULT;
  200 + } else if (checkedId == R.id.rbSupportImageOnly) {
  201 + tempData.albumSupportFormatType = CNUIConfiguration.ALBUM_SUPPORT_IMAGE_ONLY;
  202 + } else if (checkedId == R.id.rbSupportVideoOnly) {
  203 + tempData.albumSupportFormatType = CNUIConfiguration.ALBUM_SUPPORT_VIDEO_ONLY;
  204 + }
  205 + }
  206 + });
  207 +
  208 +
  209 + // 设置视频水印位置
  210 + etWatermarkXAxis = (EditText) view.findViewById(R.id.etWatermarkXAxis);
  211 + etWatermarkYAxis = (EditText) view.findViewById(R.id.etWatermarkYAxis);
  212 + etWatermarkXZoom = (EditText) view.findViewById(R.id.etWatermarkXZoom);
  213 + etWatermarkYZoom = (EditText) view.findViewById(R.id.etWatermarkYZoom);
  214 + if (tempData.watermarkShowRectF != null) {
  215 + if (tempData.watermarkShowRectF.left != 0) {
  216 + etWatermarkXAxis.setText("" + tempData.watermarkShowRectF.left);
  217 + }
  218 + if (tempData.watermarkShowRectF.top != 0) {
  219 + etWatermarkYAxis.setText("" + tempData.watermarkShowRectF.top);
  220 + }
  221 + if (tempData.watermarkShowRectF.right != 0) {
  222 + etWatermarkXZoom
  223 + .setText("" + tempData.watermarkShowRectF.right);
  224 + }
  225 + if (tempData.watermarkShowRectF.bottom != 0) {
  226 + etWatermarkYZoom.setText(""
  227 + + tempData.watermarkShowRectF.bottom);
  228 + }
  229 + }
  230 +
  231 + // 限制导出视频时间的EditText
  232 + etExportDuration = (EditText) view.findViewById(R.id.etTimeLimit);
  233 + if (tempData.exportVideoDuration != 0) {
  234 + etExportDuration.setText("" + tempData.exportVideoDuration);
  235 + }
  236 +
  237 +
  238 + cbLocalmusic = (CheckBox) view.findViewById(R.id.enableLocalMusic);
  239 +
  240 + cbLocalmusic.setChecked(tempData.enableLocalMusic);
  241 +
  242 + // 控制功能模块的CheckBox
  243 + imageDuration = (CheckBox) view.findViewById(R.id.imageDurationControl);
  244 + edit = (CheckBox) view.findViewById(R.id.edit);
  245 + trim = (CheckBox) view.findViewById(R.id.trim);
  246 + videoSpeed = (CheckBox) view.findViewById(R.id.videoSpeedControl);
  247 + split = (CheckBox) view.findViewById(R.id.split);
  248 + copy = (CheckBox) view.findViewById(R.id.copy);
  249 + proportion = (CheckBox) view.findViewById(R.id.proportion);
  250 + sort = (CheckBox) view.findViewById(R.id.sort);
  251 + text = (CheckBox) view.findViewById(R.id.text);
  252 + reverse = (CheckBox) view.findViewById(R.id.reverse);
  253 + mv = (CheckBox) view.findViewById(R.id.mv);
  254 +
  255 + soundTrack = (CheckBox) view.findViewById(R.id.soundTrack);
  256 + dubbing = (CheckBox) view.findViewById(R.id.VoiceTrack);
  257 + filter = (CheckBox) view.findViewById(R.id.filter);
  258 + titling = (CheckBox) view.findViewById(R.id.titling);
  259 + specialEffects = (CheckBox) view.findViewById(R.id.specialEffects);
  260 + clipEditing = (CheckBox) view.findViewById(R.id.clipEditing);
  261 +
  262 + watermark = (CheckBox) view.findViewById(R.id.watermark);
  263 + textWatermark = (CheckBox) view.findViewById(R.id.textWatermark);
  264 + videoTrailer = (CheckBox) view.findViewById(R.id.videoTrailer);
  265 +
  266 +
  267 + subTitleSpecialOuter = (CheckBox) view.findViewById(R.id.subTitleSpecialEffectOuter);
  268 +
  269 + subTitleSpecialOuter.setOnCheckedChangeListener(UICheckListener);
  270 +
  271 +
  272 + imageDuration.setOnCheckedChangeListener(UICheckListener);
  273 + edit.setOnCheckedChangeListener(UICheckListener);
  274 + trim.setOnCheckedChangeListener(UICheckListener);
  275 + videoSpeed.setOnCheckedChangeListener(UICheckListener);
  276 + split.setOnCheckedChangeListener(UICheckListener);
  277 + copy.setOnCheckedChangeListener(UICheckListener);
  278 + proportion.setOnCheckedChangeListener(UICheckListener);
  279 + sort.setOnCheckedChangeListener(UICheckListener);
  280 + text.setOnCheckedChangeListener(UICheckListener);
  281 + reverse.setOnCheckedChangeListener(UICheckListener);
  282 +
  283 + soundTrack.setOnCheckedChangeListener(UICheckListener);
  284 + dubbing.setOnCheckedChangeListener(UICheckListener);
  285 + filter.setOnCheckedChangeListener(UICheckListener);
  286 + titling.setOnCheckedChangeListener(UICheckListener);
  287 + specialEffects.setOnCheckedChangeListener(UICheckListener);
  288 + clipEditing.setOnCheckedChangeListener(UICheckListener);
  289 + mv.setOnCheckedChangeListener(UICheckListener);
  290 +
  291 + watermark.setOnCheckedChangeListener(UICheckListener);
  292 + textWatermark.setOnCheckedChangeListener(UICheckListener);
  293 + videoTrailer.setOnCheckedChangeListener(UICheckListener);
  294 + cbLocalmusic.setOnCheckedChangeListener(UICheckListener);
  295 + imageDuration.setChecked(tempData.enableImageDuration);
  296 + edit.setChecked(tempData.enableEdit);
  297 + trim.setChecked(tempData.enableTrim);
  298 + videoSpeed.setChecked(tempData.enableVideoSpeed);
  299 + split.setChecked(tempData.enableSplit);
  300 + copy.setChecked(tempData.enableCopy);
  301 + proportion.setChecked(tempData.enableProportion);
  302 + sort.setChecked(tempData.enableSort);
  303 + text.setChecked(tempData.enableText);
  304 + reverse.setChecked(tempData.enableReverse);
  305 +
  306 + soundTrack.setChecked(tempData.enableSoundTrack);
  307 + dubbing.setChecked(tempData.enableDubbing);
  308 + filter.setChecked(tempData.enableFilter);
  309 + titling.setChecked(tempData.enableTitling);
  310 + specialEffects.setChecked(tempData.enableSpecialEffects);
  311 + clipEditing.setChecked(tempData.enableClipEditing);
  312 +
  313 + videoTrailer.setChecked(tempData.enableVideoTrailer);
  314 + watermark.setChecked(tempData.enableWatermark);
  315 + textWatermark.setChecked(tempData.enableTextWatermark);
  316 + mv.setChecked(tempData.enableMV);
  317 +
  318 + proportion.setEnabled(!tempData.enableMV);
  319 +
  320 + rbPorportionSquare.setEnabled(!tempData.enableMV);
  321 + rbPorportionAuto.setEnabled(!tempData.enableMV);
  322 + rbPorportionLandscape.setEnabled(!tempData.enableMV);
  323 + setClipEditingMudulesEnabled(tempData.enableClipEditing);
  324 + subTitleSpecialOuter.setChecked(tempData.enableTitlingAndSpecialEffectOuter);
  325 + }
  326 +
  327 + OnCheckedChangeListener UICheckListener = new OnCheckedChangeListener() {
  328 +
  329 + @Override
  330 + public void onCheckedChanged(CompoundButton buttonView,
  331 + boolean isChecked) {
  332 + int id = buttonView.getId();
  333 +
  334 + // 片段编辑
  335 + if (id == R.id.imageDurationControl) {
  336 + tempData.enableImageDuration = isChecked;
  337 + } else if (id == R.id.edit) {
  338 + tempData.enableEdit = isChecked;
  339 + } else if (id == R.id.trim) {
  340 + tempData.enableTrim = isChecked;
  341 + } else if (id == R.id.videoSpeedControl) {
  342 + tempData.enableVideoSpeed = isChecked;
  343 + } else if (id == R.id.split) {
  344 + tempData.enableSplit = isChecked;
  345 + } else if (id == R.id.copy) {
  346 + tempData.enableCopy = isChecked;
  347 + } else if (id == R.id.proportion) {
  348 + tempData.enableProportion = isChecked;
  349 + } else if (id == R.id.sort) {
  350 + tempData.enableSort = isChecked;
  351 + } else if (id == R.id.text) {
  352 + tempData.enableText = isChecked;
  353 + } else if (id == R.id.reverse) {
  354 + tempData.enableReverse = isChecked;
  355 + } else if (id == R.id.mv) {
  356 + tempData.enableMV = isChecked;
  357 + proportion.setEnabled(!isChecked);
  358 + proportion.setChecked(!isChecked);
  359 + if (!tempData.enableClipEditing) {
  360 + proportion.setEnabled(false);
  361 + }
  362 + rgProportion.check(R.id.rbProportionSquare);
  363 + rbPorportionSquare.setEnabled(!isChecked);
  364 + rbPorportionAuto.setEnabled(!isChecked);
  365 + rbPorportionLandscape.setEnabled(!isChecked);
  366 + }
  367 + // 编辑与导出
  368 + else if (id == R.id.soundTrack) {
  369 + tempData.enableSoundTrack = isChecked;
  370 + if (!isChecked) {
  371 + rgVoice.check(R.id.rbVoiceTrak1);
  372 + }
  373 + } else if (id == R.id.enableLocalMusic) {
  374 + tempData.enableLocalMusic = isChecked;
  375 + } else if (id == R.id.filter) {
  376 + tempData.enableFilter = isChecked;
  377 + View v = (View) buttonView.getParent();
  378 + v.findViewById(R.id.rbFilter1).setEnabled(isChecked);
  379 + v.findViewById(R.id.rbFilter2).setEnabled(isChecked);
  380 +
  381 + } else if (id == R.id.VoiceTrack) {
  382 + tempData.enableDubbing = isChecked;
  383 + } else if (id == R.id.titling) {
  384 + tempData.enableTitling = isChecked;
  385 + } else if (id == R.id.specialEffects) {
  386 + tempData.enableSpecialEffects = isChecked;
  387 + } else if (id == R.id.clipEditing) {
  388 + tempData.enableClipEditing = isChecked;
  389 + setClipEditingMudulesEnabled(isChecked);
  390 + }
  391 + // 视频水印
  392 + else if (id == R.id.watermark) {
  393 + tempData.enableWatermark = isChecked;
  394 + if (tempData.enableWatermark) {
  395 + textWatermark.setChecked(false);
  396 + }
  397 + }
  398 + // 文字水印
  399 + else if (id == R.id.textWatermark) {
  400 + tempData.enableTextWatermark = isChecked;
  401 + if (tempData.enableTextWatermark) {
  402 + watermark.setChecked(false);
  403 + }
  404 + }
  405 + // 片尾水印
  406 + else if (id == R.id.videoTrailer) {
  407 + tempData.enableVideoTrailer = isChecked;
  408 + } else if (id == R.id.subTitleSpecialEffectOuter) {
  409 + tempData.enableTitlingAndSpecialEffectOuter = isChecked;
  410 + }
  411 + }
  412 + };
  413 +
  414 + private void setClipEditingMudulesEnabled(boolean enable) {
  415 + imageDuration.setEnabled(enable);
  416 + edit.setEnabled(enable);
  417 + trim.setEnabled(enable);
  418 + videoSpeed.setEnabled(enable);
  419 + split.setEnabled(enable);
  420 + copy.setEnabled(enable);
  421 + proportion.setEnabled(enable);
  422 + sort.setEnabled(enable);
  423 + text.setEnabled(enable);
  424 + reverse.setEnabled(enable);
  425 + if (tempData.enableMV) {
  426 + proportion.setEnabled(false);
  427 + }
  428 + }
  429 +
  430 + /**
  431 + * 保存UI设置对话框的参数
  432 + */
  433 + private void saveUIConfigData() {
  434 + // 读取导出时间限制
  435 + if (etExportDuration != null) {
  436 + if (!TextUtils.isEmpty(etExportDuration.getText())) {
  437 + tempData.exportVideoDuration = Float.valueOf(etExportDuration
  438 + .getText().toString());
  439 + } else {
  440 + tempData.exportVideoDuration = 0;
  441 + }
  442 + }
  443 + // 水印显示位置
  444 + if (etWatermarkXAxis != null) {
  445 + float left, top, right, bottom;
  446 + if (!TextUtils.isEmpty(etWatermarkXAxis.getText())) {
  447 + left = Float.valueOf(etWatermarkXAxis.getText().toString());
  448 + } else {
  449 + left = 0;
  450 + }
  451 + if (!TextUtils.isEmpty(etWatermarkYAxis.getText())) {
  452 + top = Float.valueOf(etWatermarkYAxis.getText().toString());
  453 + } else {
  454 + top = 0;
  455 + }
  456 + if (!TextUtils.isEmpty(etWatermarkXZoom.getText())) {
  457 + right = Float.valueOf(etWatermarkXZoom.getText().toString());
  458 + } else {
  459 + right = 0;
  460 + }
  461 + if (!TextUtils.isEmpty(etWatermarkYZoom.getText())) {
  462 + bottom = Float.valueOf(etWatermarkYZoom.getText().toString());
  463 + } else {
  464 + bottom = 0;
  465 + }
  466 + tempData.watermarkShowRectF.set(left, top, right, bottom);
  467 + }
  468 + if (tempData.enableVideoTrailer) {
  469 + // TODO:构造片尾
  470 + tempData.videoTrailerPath = SDKUtils.createVideoTrailerImage(
  471 + mActitivy, "秀友", 480, 50, 50);
  472 + } else {
  473 + tempData.videoTrailerPath = null;
  474 + }
  475 + }
  476 +}
... ...
app/src/main/java/com/rd/ve/demo/dialog/OsdConfigDialog.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/dialog/OsdConfigDialog.java
  1 +package com.rd.ve.demo.dialog;
  2 +
  3 +import android.app.Activity;
  4 +import android.app.AlertDialog;
  5 +import android.content.DialogInterface;
  6 +import android.content.DialogInterface.OnClickListener;
  7 +import android.text.TextUtils;
  8 +import android.view.View;
  9 +import android.widget.EditText;
  10 +
  11 +import com.rd.ve.demo.R;
  12 +
  13 +/**
  14 + * 相册设置对话框
  15 + */
  16 +public class OsdConfigDialog {
  17 + private AlertDialog dialog;
  18 + private ConfigData tempData;
  19 + private EditText etOsd;
  20 +
  21 + /**
  22 + * 构造函数
  23 + */
  24 + public OsdConfigDialog(Activity activity,
  25 + final ConfigDialogListener listener, ConfigData configData) {
  26 + tempData = new ConfigData();
  27 + tempData.setConfig(configData);
  28 + View view = activity.getLayoutInflater().inflate(R.layout.osd_dialog,
  29 + null);
  30 + dialog = new AlertDialog.Builder(activity).setView(view)
  31 + .setPositiveButton("返回", null)
  32 + .setNegativeButton("保存", new OnClickListener() {
  33 +
  34 + @Override
  35 + public void onClick(DialogInterface dialog, int which) {
  36 + saveConfigData();
  37 + listener.onSaveConfigData(tempData);
  38 + }
  39 + }).show();
  40 + dialog.setOnDismissListener(listener);
  41 + initDialogView(view);
  42 + }
  43 +
  44 + /**
  45 + * 初始化拍摄设置对话框
  46 + *
  47 + * @param view
  48 + */
  49 + private void initDialogView(View view) {
  50 +
  51 + etOsd = (EditText) view.findViewById(R.id.etOsdContent);
  52 + if (!TextUtils.isEmpty(tempData.antiChangeText)) {
  53 + etOsd.setText(tempData.antiChangeText);
  54 + }
  55 + }
  56 +
  57 + /**
  58 + * 保存设置对话框的参数
  59 + */
  60 + private void saveConfigData() {
  61 + tempData.antiChangeText = etOsd.getText().toString();
  62 + }
  63 +}
... ...
app/src/main/java/com/rd/ve/demo/dialog/VideoTrimConfigDialog.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/dialog/VideoTrimConfigDialog.java
  1 +package com.rd.ve.demo.dialog;
  2 +
  3 +import android.app.Activity;
  4 +import android.app.AlertDialog;
  5 +import android.content.DialogInterface;
  6 +import android.content.DialogInterface.OnClickListener;
  7 +import android.text.TextUtils;
  8 +import android.view.View;
  9 +import android.widget.EditText;
  10 +import android.widget.RadioButton;
  11 +import android.widget.RadioGroup;
  12 +
  13 +import com.cnlive.veuisdk.manager.CNTrimConfiguration;
  14 +import com.rd.ve.demo.R;
  15 +
  16 +
  17 +/**
  18 + * 截取设置对话框
  19 + */
  20 +public class VideoTrimConfigDialog {
  21 + private AlertDialog dialog;
  22 + private ConfigData tempData;
  23 + private RadioGroup rgTrimReturnMode, rgTrimType, rgTrimCropMode;
  24 + private RadioButton rbTrimNormal, rbTrim1x1, rbTrimNormalWithItem,
  25 + rbTrim1x1WithItem;
  26 + private EditText etSingleFixedTrimTime, etTrimTime1, etTrimTime2;
  27 +
  28 + /**
  29 + * 构造函数
  30 + */
  31 + public VideoTrimConfigDialog(Activity activity,
  32 + final ConfigDialogListener listener, ConfigData configData) {
  33 + tempData = new ConfigData();
  34 + tempData.setConfig(configData);
  35 + View view = activity.getLayoutInflater().inflate(
  36 + R.layout.trim_config_dialog, null);
  37 + initDialogView(view);
  38 + dialog = new AlertDialog.Builder(activity).setView(view)
  39 + .setPositiveButton("返回", null)
  40 + .setNegativeButton("保存", new OnClickListener() {
  41 +
  42 + @Override
  43 + public void onClick(DialogInterface dialog, int which) {
  44 + saveConfigData();
  45 + listener.onSaveConfigData(tempData);
  46 + }
  47 + }).show();
  48 + dialog.setOnDismissListener(listener);
  49 + }
  50 +
  51 + /**
  52 + * 初始化拍摄设置对话框
  53 + *
  54 + * @param view
  55 + */
  56 + private void initDialogView(final View view) {
  57 + rbTrimNormal = (RadioButton) view.findViewById(R.id.rbTrimNormal);
  58 + rbTrim1x1 = (RadioButton) view.findViewById(R.id.rbTrim1x1);
  59 + rbTrimNormalWithItem = (RadioButton) view.findViewById(R.id.rbTrimNormalWithItem);
  60 + rbTrim1x1WithItem = (RadioButton) view.findViewById(R.id.rbTrim1x1WithItem);
  61 +
  62 + rgTrimReturnMode = (RadioGroup) view.findViewById(R.id.rgTrimReturnMode);
  63 + rgTrimType = (RadioGroup) view.findViewById(R.id.rgTrimType);
  64 + rgTrimCropMode = (RadioGroup) view.findViewById(R.id.rgTrimCropMode);
  65 +
  66 +
  67 + rgTrimReturnMode
  68 + .setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  69 +
  70 + @Override
  71 + public void onCheckedChanged(RadioGroup group, int checkedId) {
  72 +
  73 + if (checkedId == R.id.rbTrimReturnMedia) {
  74 + tempData.mTrimReturnMode = CNTrimConfiguration.TRIM_RETURN_MEDIA;
  75 + } else if (checkedId == R.id.rbTrimReturnTime) {
  76 + tempData.mTrimReturnMode = CNTrimConfiguration.TRIM_RETURN_TIME;
  77 + } else {
  78 + tempData.mTrimReturnMode = CNTrimConfiguration.TRIM_DYNAMIC_RETURN;
  79 + }
  80 + }
  81 + });
  82 + rgTrimType
  83 + .setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  84 +
  85 + @Override
  86 + public void onCheckedChanged(RadioGroup group, int checkedId) {
  87 +
  88 + if (checkedId == R.id.rbTrimTypeFree) {
  89 + tempData.mTrimType = CNTrimConfiguration.TRIM_TYPE_FREE;
  90 + view.findViewById(R.id.llSingleFixedTrimTime).setVisibility(View.GONE);
  91 + view.findViewById(R.id.llTrimTime1).setVisibility(View.GONE);
  92 + view.findViewById(R.id.llTrimTime2).setVisibility(View.GONE);
  93 + } else if (checkedId == R.id.rbTrimSingleFixed) {
  94 + tempData.mTrimType = CNTrimConfiguration.TRIM_TYPE_SINGLE_FIXED;
  95 + view.findViewById(R.id.llSingleFixedTrimTime).setVisibility(View.VISIBLE);
  96 + view.findViewById(R.id.llTrimTime1).setVisibility(View.GONE);
  97 + view.findViewById(R.id.llTrimTime2).setVisibility(View.GONE);
  98 + } else {
  99 + tempData.mTrimType = CNTrimConfiguration.TRIM_TYPE_DOUBLE_FIXED;
  100 + view.findViewById(R.id.llSingleFixedTrimTime).setVisibility(View.GONE);
  101 + view.findViewById(R.id.llTrimTime1).setVisibility(View.VISIBLE);
  102 + view.findViewById(R.id.llTrimTime2).setVisibility(View.VISIBLE);
  103 + }
  104 + }
  105 + });
  106 + rgTrimCropMode
  107 + .setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
  108 +
  109 + @Override
  110 + public void onCheckedChanged(RadioGroup group, int checkedId) {
  111 +
  112 + if (checkedId == R.id.rbTrimNormal) {
  113 + tempData.enable1x1 = false;
  114 + tempData.default1x1CropMode = false;
  115 + } else if (checkedId == R.id.rbTrim1x1) {
  116 + tempData.enable1x1 = false;
  117 + tempData.default1x1CropMode = true;
  118 + } else if (checkedId == R.id.rbTrimNormalWithItem) {
  119 + tempData.enable1x1 = true;
  120 + tempData.default1x1CropMode = false;
  121 + } else {
  122 + tempData.enable1x1 = true;
  123 + tempData.default1x1CropMode = true;
  124 + }
  125 + }
  126 + });
  127 +
  128 + etSingleFixedTrimTime = (EditText) view.findViewById(R.id.etSingleFixedTrimTime);
  129 + if (tempData.trimSingleFixedDuration != 0) {
  130 + etSingleFixedTrimTime.setText("" + tempData.trimSingleFixedDuration);
  131 + }
  132 +
  133 + etTrimTime1 = (EditText) view.findViewById(R.id.etTrimTime1);
  134 + if (tempData.trimTime1 != 0) {
  135 + etTrimTime1.setText("" + tempData.trimTime1);
  136 + }
  137 +
  138 + etTrimTime2 = (EditText) view.findViewById(R.id.etTrimTime2);
  139 + if (tempData.trimTime2 != 0) {
  140 + etTrimTime2.setText("" + tempData.trimTime2);
  141 + }
  142 +
  143 + initdata();
  144 + }
  145 +
  146 +
  147 + /***
  148 + * 重置各配置项的默认value
  149 + */
  150 + private void initdata() {
  151 +
  152 + if (tempData.mTrimReturnMode == CNTrimConfiguration.TRIM_RETURN_MEDIA) {
  153 + rgTrimReturnMode.check(R.id.rbTrimReturnMedia);
  154 + } else if (tempData.mTrimReturnMode == CNTrimConfiguration.TRIM_RETURN_TIME) {
  155 + rgTrimReturnMode.check(R.id.rbTrimReturnTime);
  156 + } else {
  157 + rgTrimReturnMode.check(R.id.rbTrimDynamicReturn);
  158 + }
  159 + if (tempData.mTrimType == CNTrimConfiguration.TRIM_TYPE_FREE) {
  160 + rgTrimType.check(R.id.rbTrimTypeFree);
  161 + } else if (tempData.mTrimType == CNTrimConfiguration.TRIM_TYPE_SINGLE_FIXED) {
  162 + rgTrimType.check(R.id.rbTrimSingleFixed);
  163 + } else {
  164 + rgTrimType.check(R.id.rbTrimDoubleFixed);
  165 + }
  166 + if (tempData.default1x1CropMode) {
  167 + if (tempData.enable1x1) {
  168 + rgTrimCropMode.check(R.id.rbTrim1x1WithItem);
  169 + } else {
  170 + rgTrimCropMode.check(R.id.rbTrim1x1);
  171 + }
  172 + } else {
  173 + if (tempData.enable1x1) {
  174 + rgTrimCropMode.check(R.id.rbTrimNormalWithItem);
  175 + } else {
  176 + rgTrimCropMode.check(R.id.rbTrimNormal);
  177 + }
  178 + }
  179 + }
  180 +
  181 +
  182 + /**
  183 + * 保存录制设置对话框的参数
  184 + */
  185 + private void saveConfigData() {
  186 +
  187 + // 读取单定长截取时间
  188 + if (etSingleFixedTrimTime != null) {
  189 + if (!TextUtils.isEmpty(etSingleFixedTrimTime.getText())) {
  190 + tempData.trimSingleFixedDuration = Integer.valueOf(etSingleFixedTrimTime
  191 + .getText().toString());
  192 + } else {
  193 + tempData.trimSingleFixedDuration = 0;
  194 + }
  195 + }
  196 + // 读取两定长截取时间1
  197 + if (etTrimTime1 != null) {
  198 + if (!TextUtils.isEmpty(etTrimTime1.getText())) {
  199 + tempData.trimTime1 = Integer.valueOf(etTrimTime1
  200 + .getText().toString());
  201 + } else {
  202 + tempData.trimTime1 = 0;
  203 + }
  204 + }
  205 + // 读取两定长截取时间2
  206 + if (etTrimTime2 != null) {
  207 + if (!TextUtils.isEmpty(etTrimTime2.getText())) {
  208 + tempData.trimTime2 = Integer.valueOf(etTrimTime2
  209 + .getText().toString());
  210 + } else {
  211 + tempData.trimTime2 = 0;
  212 + }
  213 + }
  214 + }
  215 +}
... ...
app/src/main/java/com/rd/ve/demo/utils/SDKUtils.java 0 → 100644
  1 +++ a/app/src/main/java/com/rd/ve/demo/utils/SDKUtils.java
  1 +package com.rd.ve.demo.utils;
  2 +
  3 +import android.app.Activity;
  4 +import android.content.Context;
  5 +import android.content.Intent;
  6 +import android.content.res.AssetManager;
  7 +import android.graphics.Bitmap;
  8 +import android.graphics.BitmapFactory;
  9 +import android.graphics.Canvas;
  10 +import android.graphics.Paint;
  11 +import android.os.Environment;
  12 +import android.text.TextUtils;
  13 +
  14 +import com.rd.ve.demo.R;
  15 +import com.rd.ve.demo.VideoPlayerActivity;
  16 +
  17 +import java.io.File;
  18 +import java.io.FileNotFoundException;
  19 +import java.io.FileOutputStream;
  20 +import java.io.IOException;
  21 +import java.io.InputStream;
  22 +import java.io.OutputStream;
  23 +import java.io.UnsupportedEncodingException;
  24 +import java.text.SimpleDateFormat;
  25 +
  26 +public class SDKUtils {
  27 +
  28 + /**
  29 + * 是否为有效文件
  30 + *
  31 + * @param checkPath 文件
  32 + * @return 返回true文件有效
  33 + */
  34 + public static boolean isValidFile(String checkPath) {
  35 + if (!TextUtils.isEmpty(checkPath)) {
  36 + File file = new File(checkPath);
  37 + return file.exists() && file.length() > 0;
  38 + } else {
  39 + return false;
  40 + }
  41 + }
  42 +
  43 + /**
  44 + * 将asset文件保存为指定文件
  45 + */
  46 + public static boolean assetRes2File(AssetManager am, String assetFile,
  47 + String dstFile) {
  48 + if (isValidFile(dstFile)) {
  49 + return false;
  50 + }
  51 + if (TextUtils.isEmpty(dstFile)) {
  52 + return false;
  53 + }
  54 + OutputStream os = null;
  55 + try {
  56 + os = new FileOutputStream(dstFile);
  57 + byte[] pBuffer = new byte[1024];
  58 + int nReadLen;
  59 + if (null == am) {
  60 + return false;
  61 + }
  62 + InputStream is = am.open(assetFile);
  63 + while ((nReadLen = is.read(pBuffer)) != -1) {
  64 + os.write(pBuffer, 0, nReadLen);
  65 + }
  66 + os.flush();
  67 + os.close();
  68 + is.close();
  69 + } catch (FileNotFoundException e) {
  70 + e.printStackTrace();
  71 + new File(dstFile).delete();
  72 + return false;
  73 + } catch (IOException e) {
  74 + e.printStackTrace();
  75 + new File(dstFile).delete();
  76 + return false;
  77 + } finally {
  78 + try {
  79 + if (os != null) {
  80 + os.close();
  81 + }
  82 + } catch (IOException e) {
  83 + e.printStackTrace();
  84 + }
  85 + }
  86 + return true;
  87 + }
  88 +
  89 + /**
  90 + * 绘制片尾图片 并将其保存为临时文件
  91 + *
  92 + * @param author 作者名字
  93 + * @param videoHeight 视频高度
  94 + * @return 图片路径
  95 + */
  96 + public static String createVideoTrailerImage(Activity context,
  97 + String author, int videoHeight, int horiPadding, int dataWidth) {
  98 + String path = Environment.getExternalStorageDirectory()
  99 + + "/trailer_logo.png";
  100 +
  101 + Bitmap bmpLogo = BitmapFactory.decodeResource(context.getResources(),
  102 + R.drawable.logo_test);
  103 + Bitmap bmpDate = BitmapFactory.decodeResource(context.getResources(),
  104 + R.drawable.video_trailer_date);
  105 + Bitmap bmpAuthor = BitmapFactory.decodeResource(context.getResources(),
  106 + R.drawable.video_trailer_author);
  107 +
  108 + Paint bmpPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
  109 + bmpPaint.setFilterBitmap(true);
  110 + Paint textPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
  111 + Paint linePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
  112 + linePaint.setARGB(255, 175, 171, 170);
  113 + linePaint.setStrokeWidth(2);
  114 +
  115 + textPaint.setARGB(255, 232, 232, 232);
  116 +
  117 + SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy.MM.dd");
  118 + String date = sDateFormat.format(new java.util.Date());
  119 +
  120 + int textSize = 150;
  121 + while (true) {
  122 + textPaint.setTextSize(textSize);
  123 + float textHeight = textPaint.getFontMetrics().descent
  124 + - textPaint.getFontMetrics().ascent;
  125 +
  126 + if (textHeight > bmpDate.getHeight()) {
  127 + textSize -= 1;
  128 + } else {
  129 + break;
  130 + }
  131 + }
  132 +
  133 + try {
  134 + int authorLength = author.length();
  135 + int authorByte = author.getBytes("GBK").length;
  136 + while (authorByte > 16) {
  137 + authorLength -= 1;
  138 + author = author.substring(0, authorLength) + "...";
  139 + authorByte = author.getBytes("GBK").length;
  140 + }
  141 +
  142 + } catch (UnsupportedEncodingException e1) {
  143 + e1.printStackTrace();
  144 + }
  145 +
  146 + int logoWidth = bmpLogo.getWidth();
  147 + int messageWidth = (int) (bmpDate.getWidth() + bmpAuthor.getWidth()
  148 + + dataWidth + 40 + textPaint.measureText(date) + textPaint
  149 + .measureText(author));
  150 +
  151 + int logoDateHeight = (bmpDate.getHeight() + bmpLogo.getHeight() + 80);
  152 +
  153 + float scale = (float) videoHeight / (logoDateHeight * 2);
  154 +
  155 + int bmpWidth;
  156 + int logoLeft = 0;
  157 + int top = (int) ((videoHeight - logoDateHeight * scale) / (2 * scale));
  158 + int messageLeft = 0;
  159 + if (logoWidth >= messageWidth) {
  160 + bmpWidth = (int) (logoWidth * scale);
  161 + messageLeft = (logoWidth - messageWidth) / 2;
  162 + } else {
  163 + bmpWidth = (int) (messageWidth * scale);
  164 + logoLeft = (messageWidth - logoWidth) / 2;
  165 + }
  166 +
  167 + Bitmap bmp = Bitmap.createBitmap(bmpWidth + 2 * horiPadding,
  168 + videoHeight, Bitmap.Config.ARGB_8888);
  169 +
  170 + Canvas canvas = new Canvas(bmp);
  171 + canvas.scale(scale, scale);
  172 + logoLeft += horiPadding / scale;
  173 + messageLeft += horiPadding / scale;
  174 + canvas.drawBitmap(bmpLogo, logoLeft, top, bmpPaint);
  175 +
  176 + top = top + bmpLogo.getHeight() + 40;
  177 + canvas.drawLine(logoLeft, top, logoLeft + bmpLogo.getWidth(), top,
  178 + linePaint);
  179 + top = top + 40;
  180 + int baseline = (int) ((bmpDate.getHeight()
  181 + - textPaint.getFontMetrics().bottom - textPaint
  182 + .getFontMetrics().top) / 2);
  183 + int textTop = top + baseline;
  184 +
  185 + canvas.drawBitmap(bmpDate, messageLeft, top, bmpPaint);
  186 + messageLeft = messageLeft + bmpDate.getWidth() + 20;
  187 +
  188 + canvas.drawText(date, messageLeft, textTop, textPaint);
  189 +
  190 + messageLeft = (int) (messageLeft + textPaint.measureText(date) + dataWidth);
  191 + canvas.drawBitmap(bmpAuthor, messageLeft, top, bmpPaint);
  192 +
  193 + messageLeft = messageLeft + bmpAuthor.getWidth() + 20;
  194 + canvas.drawText(author, messageLeft, textTop, textPaint);
  195 + File file = new File(path);
  196 + if (file.exists()) {
  197 + try {
  198 + file.createNewFile();
  199 + } catch (IOException e) {
  200 + e.printStackTrace();
  201 + }
  202 + }
  203 +
  204 + try {
  205 + FileOutputStream out = new FileOutputStream(file);
  206 + bmp.compress(Bitmap.CompressFormat.PNG, 100, out);
  207 + out.flush();
  208 + out.close();
  209 + } catch (Exception e) {
  210 + e.printStackTrace();
  211 + }
  212 + bmp.recycle();
  213 + bmp = null;
  214 + return path;
  215 + }
  216 +
  217 + /**
  218 + * 播放视频
  219 + *
  220 + * @param path
  221 + */
  222 + public static void onPlayVideo(Context context, String path) {
  223 + Intent intent = new Intent(context, VideoPlayerActivity.class);
  224 + intent.putExtra(VideoPlayerActivity.ACTION_PATH, path);
  225 + context.startActivity(intent);
  226 + }
  227 +}
... ...
app/src/main/res/drawable-xhdpi/ic_launcher.png 0 → 100644

12.6 KB

app/src/main/res/drawable-xhdpi/logo_test.png 0 → 100644

41.3 KB

app/src/main/res/drawable-xhdpi/video_trailer_author.png 0 → 100644

3.2 KB

app/src/main/res/drawable-xhdpi/video_trailer_date.png 0 → 100644

2.46 KB

app/src/main/res/drawable-xhdpi/video_trailer_logo.png 0 → 100644

35.1 KB

app/src/main/res/drawable-xxhdpi/ic_launcher.png 0 → 100644

20.7 KB

app/src/main/res/drawable/layout_stroke.xml 0 → 100644
  1 +++ a/app/src/main/res/drawable/layout_stroke.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android" >
  3 +
  4 + <stroke
  5 + android:width="1dp"
  6 + android:color="#ffffff" />
  7 +
  8 + <corners android:radius="5dp" />
  9 +
  10 +</shape>
0 11 \ No newline at end of file
... ...
app/src/main/res/drawable/switch_thumb.xml 0 → 100644
  1 +++ a/app/src/main/res/drawable/switch_thumb.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:shape="oval" >
  4 +
  5 + <size
  6 + android:height="30dp"
  7 + android:width="30dp" >
  8 + </size>
  9 +
  10 + <solid android:color="#ffffff" >
  11 + </solid>
  12 +
  13 +</shape>
0 14 \ No newline at end of file
... ...
app/src/main/res/drawable/switch_track.xml 0 → 100644
  1 +++ a/app/src/main/res/drawable/switch_track.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <item android:drawable="@drawable/switch_track_on" android:state_checked="true"></item>
  5 + <item android:drawable="@drawable/switch_track_off" android:state_checked="false"></item>
  6 +
  7 +</selector>
0 8 \ No newline at end of file
... ...
app/src/main/res/drawable/switch_track_off.xml 0 → 100644
  1 +++ a/app/src/main/res/drawable/switch_track_off.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:shape="rectangle" >
  4 +
  5 + <solid android:color="#AAAAAA" >
  6 + </solid>
  7 +
  8 + <size
  9 + android:height="30dp"
  10 + android:width="50dp" />
  11 +
  12 + <corners android:radius="30dp" >
  13 + </corners>
  14 +
  15 +</shape>
0 16 \ No newline at end of file
... ...
app/src/main/res/drawable/switch_track_on.xml 0 → 100644
  1 +++ a/app/src/main/res/drawable/switch_track_on.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:shape="rectangle" >
  4 +
  5 + <solid android:color="#ff99cc00" >
  6 + </solid>
  7 +
  8 + <size
  9 + android:height="30dp"
  10 + android:width="50dp" />
  11 +
  12 + <corners android:radius="30dp" >
  13 + </corners>
  14 +
  15 +</shape>
0 16 \ No newline at end of file
... ...
app/src/main/res/layout/activity_dialog.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/activity_dialog.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:gravity="center_horizontal"
  6 + android:orientation="vertical" >
  7 +
  8 + <TextView
  9 + android:id="@+id/tvTitle"
  10 + android:layout_width="wrap_content"
  11 + android:layout_height="wrap_content"
  12 + android:padding="10dp"
  13 + android:text="请选择截取后返回类型"
  14 + android:textSize="18dp" />
  15 +
  16 + <LinearLayout
  17 + android:layout_width="wrap_content"
  18 + android:layout_height="wrap_content"
  19 + android:gravity="center_horizontal"
  20 + android:orientation="horizontal" >
  21 +
  22 + <Button
  23 + android:id="@+id/btnTrimVideo"
  24 + android:layout_width="wrap_content"
  25 + android:layout_height="wrap_content"
  26 + android:onClick="onClick"
  27 + android:text="截取视频" />
  28 +
  29 + <Button
  30 + android:id="@+id/btnTrimVideoTime"
  31 + android:layout_width="wrap_content"
  32 + android:layout_height="wrap_content"
  33 + android:onClick="onClick"
  34 + android:text="截取时间" />
  35 + </LinearLayout>
  36 +
  37 +</LinearLayout>
0 38 \ No newline at end of file
... ...
app/src/main/res/layout/activity_main_layout.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/activity_main_layout.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:background="#33333b"
  6 + android:orientation="vertical">
  7 +
  8 + <TextView
  9 + android:layout_width="match_parent"
  10 + android:layout_height="wrap_content"
  11 + android:background="#000000"
  12 + android:gravity="center"
  13 + android:padding="10dp"
  14 + android:text="短视频编辑DEMO"
  15 + android:textColor="#ffffff"
  16 + android:textSize="18dp"/>
  17 +
  18 + <ScrollView
  19 + android:layout_width="match_parent"
  20 + android:layout_height="wrap_content">
  21 +
  22 + <LinearLayout
  23 + android:layout_width="match_parent"
  24 + android:layout_height="wrap_content"
  25 + android:orientation="vertical"
  26 + android:paddingBottom="10dp"
  27 + android:paddingTop="10dp">
  28 +
  29 + <RelativeLayout
  30 + android:layout_width="match_parent"
  31 + android:layout_height="wrap_content"
  32 + android:layout_marginBottom="10dp"
  33 + android:layout_marginLeft="10dp"
  34 + android:layout_marginTop="20dp">
  35 +
  36 + <TextView
  37 + style="@style/txtStyle"
  38 + android:layout_width="wrap_content"
  39 + android:layout_height="wrap_content"
  40 + android:layout_centerVertical="true"
  41 + android:text="录制/拍摄"
  42 + android:textColor="#88ffffff"/>
  43 +
  44 + <Button
  45 + android:id="@+id/camera_config"
  46 + style="@style/buttonStyle"
  47 + android:layout_width="wrap_content"
  48 + android:layout_height="wrap_content"
  49 + android:layout_alignParentRight="true"
  50 + android:layout_marginRight="10dp"
  51 + android:background="@drawable/layout_stroke"
  52 + android:onClick="onVideo"
  53 + android:padding="5dp"
  54 + android:text="设置"/>
  55 + </RelativeLayout>
  56 +
  57 + <View
  58 + android:layout_width="match_parent"
  59 + android:layout_height="0.5dp"
  60 + android:background="#88ffffff"/>
  61 +
  62 + <Button
  63 + android:id="@+id/record_square"
  64 + style="@style/buttonStyle"
  65 + android:onClick="onVideo"
  66 + android:text="(1)正方形录制"/>
  67 +
  68 + <View
  69 + android:layout_width="match_parent"
  70 + android:layout_height="0.5dp"
  71 + android:layout_marginLeft="10dp"
  72 + android:background="#88ffffff"/>
  73 +
  74 + <Button
  75 + android:id="@+id/record_wide"
  76 + style="@style/buttonStyle"
  77 + android:onClick="onVideo"
  78 + android:text="(2)全屏录制"/>
  79 +
  80 + <View
  81 + android:layout_width="match_parent"
  82 + android:layout_height="0.5dp"
  83 + android:layout_marginLeft="10dp"
  84 + android:background="#88ffffff"/>
  85 +
  86 + <Button
  87 + android:id="@+id/record"
  88 + style="@style/buttonStyle"
  89 + android:onClick="onVideo"
  90 + android:text="(3)正方形,全屏可切换录制"/>
  91 +
  92 + <View
  93 + android:layout_width="match_parent"
  94 + android:layout_height="0.5dp"
  95 + android:background="#88ffffff"/>
  96 +
  97 + <RelativeLayout
  98 + android:layout_width="match_parent"
  99 + android:layout_height="wrap_content"
  100 + android:layout_marginBottom="10dp"
  101 + android:layout_marginLeft="10dp"
  102 + android:layout_marginTop="20dp">
  103 +
  104 + <TextView
  105 + style="@style/txtStyle"
  106 + android:layout_width="wrap_content"
  107 + android:layout_height="wrap_content"
  108 + android:layout_centerVertical="true"
  109 + android:text="视频编辑"
  110 + android:textColor="#88ffffff"/>
  111 +
  112 + <Button
  113 + android:id="@+id/ui_config"
  114 + style="@style/buttonStyle"
  115 + android:layout_width="wrap_content"
  116 + android:layout_height="wrap_content"
  117 + android:layout_alignParentRight="true"
  118 + android:layout_marginRight="10dp"
  119 + android:background="@drawable/layout_stroke"
  120 + android:onClick="onVideo"
  121 + android:padding="5dp"
  122 + android:text="设置"/>
  123 + </RelativeLayout>
  124 +
  125 + <View
  126 + android:layout_width="match_parent"
  127 + android:layout_height="0.5dp"
  128 + android:background="#88ffffff"/>
  129 +
  130 + <Button
  131 + android:id="@+id/directEdit"
  132 + style="@style/buttonStyle"
  133 + android:onClick="onVideo"
  134 + android:text="(1)无相册选择,进入编辑"/>
  135 +
  136 + <View
  137 + android:layout_width="match_parent"
  138 + android:layout_height="0.5dp"
  139 + android:layout_marginLeft="10dp"
  140 + android:background="#88ffffff"/>
  141 +
  142 + <Button
  143 + android:id="@+id/selectMediaAndEdit"
  144 + style="@style/buttonStyle"
  145 + android:onClick="onVideo"
  146 + android:text="(2)从相册选择后进入编辑"/>
  147 +
  148 + <View
  149 + android:layout_width="match_parent"
  150 + android:layout_height="0.5dp"
  151 + android:background="#88ffffff"/>
  152 +
  153 + <RelativeLayout
  154 + android:layout_width="match_parent"
  155 + android:layout_height="wrap_content"
  156 + android:layout_marginBottom="10dp"
  157 + android:layout_marginLeft="10dp"
  158 + android:layout_marginTop="20dp">
  159 +
  160 + <TextView
  161 + style="@style/txtStyle"
  162 + android:layout_width="wrap_content"
  163 + android:layout_height="wrap_content"
  164 + android:layout_centerVertical="true"
  165 + android:text="短视频(由视频编辑配置而成)"
  166 + android:textColor="#88ffffff"/>
  167 + </RelativeLayout>
  168 +
  169 + <View
  170 + android:layout_width="match_parent"
  171 + android:layout_height="0.5dp"
  172 + android:background="#88ffffff"/>
  173 +
  174 +
  175 + <Button
  176 + android:id="@+id/shortVideoEdit"
  177 + style="@style/buttonStyle"
  178 + android:onClick="onVideo"
  179 + android:text="(1)15秒短视频"/>
  180 +
  181 +
  182 + <View
  183 + android:layout_width="match_parent"
  184 + android:layout_height="0.5dp"
  185 + android:background="#88ffffff"/>
  186 +
  187 + <RelativeLayout
  188 + android:layout_width="match_parent"
  189 + android:layout_height="wrap_content"
  190 + android:layout_marginBottom="10dp"
  191 + android:layout_marginLeft="10dp"
  192 + android:layout_marginTop="20dp"
  193 + android:visibility="gone">
  194 +
  195 + <TextView
  196 + style="@style/txtStyle"
  197 + android:layout_width="wrap_content"
  198 + android:layout_height="wrap_content"
  199 + android:layout_centerVertical="true"
  200 + android:text="画中画"
  201 + android:textColor="#88ffffff"/>
  202 + </RelativeLayout>
  203 +
  204 + <View
  205 + android:layout_width="match_parent"
  206 + android:layout_height="0.5dp"
  207 + android:background="#88ffffff"/>
  208 +
  209 + <Button
  210 + android:id="@+id/mixVideoEdit"
  211 + style="@style/buttonStyle"
  212 + android:onClick="onVideo"
  213 + android:text="画中画"
  214 + android:visibility="gone"/>
  215 +
  216 +
  217 + <View
  218 + android:layout_width="match_parent"
  219 + android:layout_height="0.5dp"
  220 + android:background="#88ffffff"/>
  221 +
  222 +
  223 + <RelativeLayout
  224 + android:layout_width="match_parent"
  225 + android:layout_height="wrap_content"
  226 + android:layout_marginBottom="10dp"
  227 + android:layout_marginLeft="10dp"
  228 + android:layout_marginTop="20dp">
  229 +
  230 + <TextView
  231 + style="@style/txtStyle"
  232 + android:layout_width="wrap_content"
  233 + android:layout_height="wrap_content"
  234 + android:layout_centerVertical="true"
  235 + android:text="视频截取"
  236 + android:textColor="#88ffffff"/>
  237 +
  238 + <Button
  239 + android:id="@+id/trimConfig"
  240 + style="@style/buttonStyle"
  241 + android:layout_width="wrap_content"
  242 + android:layout_height="wrap_content"
  243 + android:layout_alignParentRight="true"
  244 + android:layout_marginRight="10dp"
  245 + android:background="@drawable/layout_stroke"
  246 + android:onClick="onVideo"
  247 + android:padding="5dp"
  248 + android:text="设置"/>
  249 + </RelativeLayout>
  250 +
  251 + <View
  252 + android:layout_width="match_parent"
  253 + android:layout_height="0.5dp"
  254 + android:background="#88ffffff"/>
  255 +
  256 + <Button
  257 + android:id="@+id/trim_l"
  258 + style="@style/buttonStyle"
  259 + android:onClick="onVideo"
  260 + android:text="(1)横屏视频"/>
  261 +
  262 + <View
  263 + android:layout_width="match_parent"
  264 + android:layout_height="0.5dp"
  265 + android:layout_marginLeft="10dp"
  266 + android:background="#88ffffff"/>
  267 +
  268 + <Button
  269 + android:id="@+id/trim_p"
  270 + style="@style/buttonStyle"
  271 + android:onClick="onVideo"
  272 + android:text="(2)竖屏视频"/>
  273 +
  274 + <View
  275 + android:layout_width="match_parent"
  276 + android:layout_height="0.5dp"
  277 + android:layout_marginLeft="10dp"
  278 + android:background="#88ffffff"/>
  279 +
  280 + <Button
  281 + android:id="@+id/trim_s"
  282 + style="@style/buttonStyle"
  283 + android:onClick="onVideo"
  284 + android:text="(3)正方形视频"/>
  285 +
  286 + <View
  287 + android:layout_width="match_parent"
  288 + android:layout_height="0.5dp"
  289 + android:background="#88ffffff"/>
  290 +
  291 + <Button
  292 + android:id="@+id/trim_alum"
  293 + style="@style/buttonStyle"
  294 + android:onClick="onVideo"
  295 + android:text="(4)相册视频"/>
  296 +
  297 + <View
  298 + android:layout_width="match_parent"
  299 + android:layout_height="0.5dp"
  300 + android:background="#88ffffff"/>
  301 +
  302 + <RelativeLayout
  303 + android:layout_width="match_parent"
  304 + android:layout_height="wrap_content"
  305 + android:layout_marginBottom="10dp"
  306 + android:layout_marginLeft="10dp"
  307 + android:layout_marginTop="20dp">
  308 +
  309 + <TextView
  310 + style="@style/txtStyle"
  311 + android:layout_width="wrap_content"
  312 + android:layout_height="wrap_content"
  313 + android:layout_centerVertical="true"
  314 + android:text="相册"
  315 + android:textColor="#88ffffff"/>
  316 +
  317 + <Button
  318 + android:id="@+id/album_config"
  319 + style="@style/buttonStyle"
  320 + android:layout_width="wrap_content"
  321 + android:layout_height="wrap_content"
  322 + android:layout_alignParentRight="true"
  323 + android:layout_marginRight="10dp"
  324 + android:background="@drawable/layout_stroke"
  325 + android:onClick="onVideo"
  326 + android:padding="5dp"
  327 + android:text="设置"/>
  328 + </RelativeLayout>
  329 +
  330 + <View
  331 + android:layout_width="match_parent"
  332 + android:layout_height="0.5dp"
  333 + android:background="#88ffffff"/>
  334 +
  335 + <Button
  336 + android:id="@+id/default_album"
  337 + style="@style/buttonStyle"
  338 + android:onClick="onVideo"
  339 + android:text="(1)图片+视频"/>
  340 +
  341 + <View
  342 + android:layout_width="match_parent"
  343 + android:layout_height="0.5dp"
  344 + android:layout_marginLeft="10dp"
  345 + android:background="#88ffffff"/>
  346 +
  347 + <Button
  348 + android:id="@+id/only_video"
  349 + style="@style/buttonStyle"
  350 + android:onClick="onVideo"
  351 + android:text="(2)仅显示视频"/>
  352 +
  353 + <View
  354 + android:layout_width="match_parent"
  355 + android:layout_height="0.5dp"
  356 + android:layout_marginLeft="10dp"
  357 + android:background="#88ffffff"/>
  358 +
  359 + <Button
  360 + android:id="@+id/only_photo"
  361 + style="@style/buttonStyle"
  362 + android:onClick="onVideo"
  363 + android:text="(3)仅显示图片"/>
  364 +
  365 + <View
  366 + android:layout_width="match_parent"
  367 + android:layout_height="0.5dp"
  368 + android:background="#88ffffff"/>
  369 +
  370 + <RelativeLayout
  371 + android:layout_width="match_parent"
  372 + android:layout_height="wrap_content"
  373 + android:layout_marginBottom="10dp"
  374 + android:layout_marginLeft="10dp"
  375 + android:layout_marginTop="20dp">
  376 +
  377 + <TextView
  378 + style="@style/txtStyle"
  379 + android:layout_width="wrap_content"
  380 + android:layout_height="wrap_content"
  381 + android:layout_centerVertical="true"
  382 + android:text="压缩"
  383 + android:textColor="#88ffffff"/>
  384 +
  385 + <Button
  386 + android:id="@+id/compress_config"
  387 + style="@style/buttonStyle"
  388 + android:layout_width="wrap_content"
  389 + android:layout_height="wrap_content"
  390 + android:layout_alignParentRight="true"
  391 + android:layout_marginRight="10dp"
  392 + android:background="@drawable/layout_stroke"
  393 + android:onClick="onVideo"
  394 + android:padding="5dp"
  395 + android:text="设置"/>
  396 + </RelativeLayout>
  397 +
  398 + <View
  399 + android:layout_width="match_parent"
  400 + android:layout_height="0.5dp"
  401 + android:background="#88ffffff"/>
  402 +
  403 + <Button
  404 + android:id="@+id/compress"
  405 + style="@style/buttonStyle"
  406 + android:onClick="onVideo"
  407 + android:text="压缩视频"/>
  408 +
  409 + <View
  410 + android:layout_width="match_parent"
  411 + android:layout_height="0.5dp"
  412 + android:background="#88ffffff"/>
  413 +
  414 + <RelativeLayout
  415 + android:layout_width="match_parent"
  416 + android:layout_height="wrap_content"
  417 + android:layout_marginBottom="10dp"
  418 + android:layout_marginLeft="10dp"
  419 + android:layout_marginTop="20dp">
  420 +
  421 + <TextView
  422 + style="@style/txtStyle"
  423 + android:layout_width="wrap_content"
  424 + android:layout_height="wrap_content"
  425 + android:layout_centerVertical="true"
  426 + android:text="防篡改录制"
  427 + android:textColor="#88ffffff"/>
  428 +
  429 +
  430 + <Button
  431 + android:id="@+id/AntiChange_config"
  432 + style="@style/buttonStyle"
  433 + android:layout_width="wrap_content"
  434 + android:layout_height="wrap_content"
  435 + android:layout_alignParentRight="true"
  436 + android:layout_marginRight="10dp"
  437 + android:background="@drawable/layout_stroke"
  438 + android:onClick="onVideo"
  439 + android:padding="5dp"
  440 + android:text="设置"/>
  441 + </RelativeLayout>
  442 +
  443 + <View
  444 + android:layout_width="match_parent"
  445 + android:layout_height="0.5dp"
  446 + android:background="#88ffffff"/>
  447 +
  448 + <Button
  449 + android:id="@+id/recordAntiChange"
  450 + style="@style/buttonStyle"
  451 + android:onClick="onVideo"
  452 + android:text="全屏录制"/>
  453 +
  454 + <View
  455 + android:layout_width="match_parent"
  456 + android:layout_height="0.5dp"
  457 + android:background="#88ffffff"/>
  458 +
  459 + <RelativeLayout
  460 + android:layout_width="match_parent"
  461 + android:layout_height="wrap_content"
  462 + android:layout_marginBottom="10dp"
  463 + android:layout_marginLeft="10dp"
  464 + android:layout_marginTop="20dp">
  465 +
  466 + <TextView
  467 + style="@style/txtStyle"
  468 + android:layout_width="wrap_content"
  469 + android:layout_height="wrap_content"
  470 + android:layout_centerVertical="true"
  471 + android:text="其它"
  472 + android:textColor="#88ffffff"/>
  473 + </RelativeLayout>
  474 +
  475 + <View
  476 + android:layout_width="match_parent"
  477 + android:layout_height="0.5dp"
  478 + android:background="#88ffffff"/>
  479 +
  480 + <Button
  481 + android:id="@+id/player"
  482 + style="@style/buttonStyle"
  483 + android:onClick="onVideo"
  484 + android:text="播 放 器"/>
  485 +
  486 + <View
  487 + android:layout_width="match_parent"
  488 + android:layout_height="0.5dp"
  489 + android:layout_marginLeft="10dp"
  490 + android:background="#88ffffff"/>
  491 +
  492 + <RelativeLayout
  493 + android:layout_width="wrap_content"
  494 + android:layout_height="wrap_content">
  495 +
  496 + <Button
  497 + android:id="@+id/export"
  498 + style="@style/buttonStyle"
  499 + android:onClick="onVideo"
  500 + android:text="导出(支持片尾、水印)"/>
  501 +
  502 +
  503 + <Button
  504 + android:id="@+id/audio_config"
  505 + style="@style/buttonStyle"
  506 + android:layout_width="wrap_content"
  507 + android:layout_height="wrap_content"
  508 + android:layout_alignParentRight="true"
  509 + android:layout_marginRight="10dp"
  510 + android:layout_centerVertical="true"
  511 + android:background="@drawable/layout_stroke"
  512 + android:onClick="onVideo"
  513 + android:padding="5dp"
  514 + android:text="设置"/>
  515 +
  516 + </RelativeLayout>
  517 +
  518 +
  519 + <View
  520 + android:layout_width="match_parent"
  521 + android:layout_height="0.5dp"
  522 + android:layout_marginLeft="10dp"
  523 + android:background="#88ffffff"/>
  524 +
  525 + <Button
  526 + android:id="@+id/reset_config"
  527 + style="@style/buttonStyle"
  528 + android:onClick="onVideo"
  529 + android:text="重置设置"/>
  530 +
  531 + <View
  532 + android:layout_width="match_parent"
  533 + android:layout_height="0.5dp"
  534 + android:background="#88ffffff"/>
  535 + </LinearLayout>
  536 + </ScrollView>
  537 +
  538 +</LinearLayout>
0 539 \ No newline at end of file
... ...
app/src/main/res/layout/activity_test_preview_layout.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/activity_test_preview_layout.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent" >
  5 +
  6 + <com.rd.xpk.editor.EnhancePlaybackView
  7 + android:id="@+id/epvPreview"
  8 + android:layout_width="match_parent"
  9 + android:layout_height="match_parent"
  10 + android:clickable="true"
  11 + android:onClick="onPublicViewClick" />
  12 +
  13 + <RelativeLayout
  14 + android:layout_width="match_parent"
  15 + android:layout_height="wrap_content"
  16 + android:layout_gravity="bottom"
  17 + android:layout_marginBottom="20dp"
  18 + android:orientation="horizontal"
  19 + android:padding="10dp" >
  20 +
  21 + <TextView
  22 + android:id="@+id/tvVideoCurrentPos"
  23 + android:layout_width="wrap_content"
  24 + android:layout_height="wrap_content"
  25 + android:layout_centerVertical="true"
  26 + android:shadowColor="@android:color/black"
  27 + android:shadowRadius="2"
  28 + android:text="" />
  29 +
  30 + <SeekBar
  31 + android:id="@+id/sbVideoDetailPlayer"
  32 + android:layout_width="match_parent"
  33 + android:layout_height="wrap_content"
  34 + android:layout_centerVertical="true"
  35 + android:layout_toLeftOf="@+id/tvVideoDuration"
  36 + android:layout_toRightOf="@+id/tvVideoCurrentPos"
  37 + android:paddingLeft="4dp"
  38 + android:paddingRight="4dp"
  39 + android:progressDrawable="@drawable/video_detail_player_progress"
  40 + android:thumb="@drawable/video_detail_player_progress_drag" />
  41 +
  42 + <TextView
  43 + android:id="@+id/tvVideoDuration"
  44 + android:layout_width="wrap_content"
  45 + android:layout_height="wrap_content"
  46 + android:layout_alignParentRight="true"
  47 + android:layout_centerVertical="true"
  48 + android:shadowColor="@android:color/black"
  49 + android:shadowRadius="2" />
  50 + </RelativeLayout>
  51 +
  52 + <LinearLayout
  53 + android:layout_width="wrap_content"
  54 + android:layout_height="wrap_content"
  55 + android:layout_marginRight="5dp"
  56 + android:layout_marginTop="5dp"
  57 + android:orientation="horizontal" >
  58 +
  59 + <ImageView
  60 + android:id="@+id/ivSnapshot1"
  61 + android:layout_width="176px"
  62 + android:layout_height="99px" />
  63 +
  64 + <ImageView
  65 + android:id="@+id/ivSnapshot2"
  66 + android:layout_width="176px"
  67 + android:layout_height="99px" />
  68 +
  69 + <ImageView
  70 + android:id="@+id/ivSnapshot3"
  71 + android:layout_width="176px"
  72 + android:layout_height="99px" />
  73 +
  74 + <ImageView
  75 + android:id="@+id/ivSnapshot4"
  76 + android:layout_width="176px"
  77 + android:layout_height="99px" />
  78 + </LinearLayout>
  79 +
  80 + <LinearLayout
  81 + android:layout_width="wrap_content"
  82 + android:layout_height="wrap_content"
  83 + android:layout_gravity="right"
  84 + android:layout_marginRight="5dp"
  85 + android:layout_marginTop="5dp"
  86 + android:orientation="vertical" >
  87 +
  88 + <Button
  89 + android:id="@+id/btnSave"
  90 + android:layout_width="wrap_content"
  91 + android:layout_height="wrap_content"
  92 + android:onClick="onPublicViewClick"
  93 + android:text="保存" />
  94 +
  95 + <Button
  96 + android:id="@+id/btnSwitchSoundTrack"
  97 + android:layout_width="wrap_content"
  98 + android:layout_height="wrap_content"
  99 + android:layout_marginTop="5dp"
  100 + android:onClick="onPublicViewClick"
  101 + android:text="切换配乐" />
  102 +
  103 + <Button
  104 + android:id="@+id/btnSwitchSoundTrackFactor"
  105 + android:layout_width="wrap_content"
  106 + android:layout_height="wrap_content"
  107 + android:layout_marginTop="5dp"
  108 + android:onClick="onPublicViewClick"
  109 + android:text="快速切换配乐占比" />
  110 +
  111 + <Button
  112 + android:id="@+id/btnAddRecord"
  113 + android:layout_width="wrap_content"
  114 + android:layout_height="wrap_content"
  115 + android:layout_marginTop="5dp"
  116 + android:onClick="onPublicViewClick"
  117 + android:text="添加配音" />
  118 +
  119 + <Button
  120 + android:id="@+id/btnSwitchFilter"
  121 + android:layout_width="wrap_content"
  122 + android:layout_height="wrap_content"
  123 + android:layout_marginTop="10dp"
  124 + android:onClick="onPublicViewClick"
  125 + android:text="切换滤镜" />
  126 + </LinearLayout>
  127 +
  128 +</FrameLayout>
0 129 \ No newline at end of file
... ...
app/src/main/res/layout/activity_video_player.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/activity_video_player.xml
  1 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2 + xmlns:tools="http://schemas.android.com/tools"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:background="@color/black"
  6 + android:orientation="vertical"
  7 + tools:context="com.rd.xpk.VideoPrieviewActivity">
  8 +
  9 + <RelativeLayout
  10 + android:id="@+id/titlebar_layout"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="wrap_content"
  13 + android:minHeight="50dp"
  14 + android:splitMotionEvents="false">
  15 +
  16 + <ImageView
  17 + android:id="@+id/left"
  18 + android:layout_width="wrap_content"
  19 + android:layout_height="wrap_content"
  20 + android:layout_centerVertical="true"
  21 + android:background="@drawable/normal_back_button_selector"
  22 + android:gravity="left|center_vertical"
  23 + android:textColor="@color/white"
  24 + android:textSize="@dimen/text_size_18" />
  25 +
  26 + <TextView
  27 + android:id="@+id/title"
  28 + android:layout_width="wrap_content"
  29 + android:layout_height="wrap_content"
  30 + android:layout_centerInParent="true"
  31 + android:ellipsize="marquee"
  32 + android:fadingEdge="none"
  33 + android:gravity="center"
  34 + android:paddingBottom="3dp"
  35 + android:paddingTop="3dp"
  36 + android:shadowColor="@color/black"
  37 + android:shadowDx="0"
  38 + android:shadowDy="0"
  39 + android:shadowRadius="0"
  40 + android:text="播放器"
  41 + android:textColor="@color/white"
  42 + android:textSize="@dimen/text_size_18" />
  43 + </RelativeLayout>
  44 +
  45 + <RelativeLayout
  46 + android:layout_width="match_parent"
  47 + android:layout_height="0dip"
  48 + android:layout_weight="1">
  49 +
  50 + <RelativeLayout
  51 + android:layout_width="match_parent"
  52 + android:layout_height="match_parent">
  53 +
  54 + <!-- java 代码addview 一个textview 提示防篡改视频 -->
  55 + <FrameLayout
  56 + android:id="@+id/videoParentGroup"
  57 + android:layout_width="match_parent"
  58 + android:layout_height="match_parent"
  59 + android:layout_centerInParent="true">
  60 +
  61 + <RelativeLayout
  62 + android:layout_width="match_parent"
  63 + android:layout_height="match_parent">
  64 +
  65 + <com.cnlive.veuisdk.CNVideoView
  66 + android:id="@+id/svpriview"
  67 + android:layout_width="match_parent"
  68 + android:layout_height="match_parent"
  69 + android:layout_centerInParent="true" />
  70 + </RelativeLayout>
  71 + </FrameLayout>
  72 + </RelativeLayout>
  73 +
  74 + <ImageView
  75 + android:id="@+id/ivPlayerState"
  76 + android:layout_width="wrap_content"
  77 + android:layout_height="wrap_content"
  78 + android:layout_centerInParent="true"
  79 + android:contentDescription="@string/empty"
  80 + android:onClick="clickView"
  81 + android:scaleType="center"
  82 + android:src="@drawable/btn_play" />
  83 + </RelativeLayout>
  84 +
  85 + <RelativeLayout
  86 + android:layout_width="match_parent"
  87 + android:layout_height="wrap_content"
  88 + android:layout_gravity="bottom"
  89 + android:layout_marginBottom="20dp"
  90 + android:orientation="horizontal"
  91 + android:padding="10dp">
  92 +
  93 + <TextView
  94 + android:id="@+id/tvEditorCurrentPos"
  95 + android:layout_width="wrap_content"
  96 + android:layout_height="wrap_content"
  97 + android:layout_centerVertical="true"
  98 + android:text="" />
  99 +
  100 + <SeekBar
  101 + android:id="@+id/sbEditor"
  102 + android:layout_width="match_parent"
  103 + android:layout_height="wrap_content"
  104 + android:layout_centerVertical="true"
  105 + android:layout_toLeftOf="@+id/tvEditorDuration"
  106 + android:layout_toRightOf="@+id/tvEditorCurrentPos"
  107 + android:progressDrawable="@drawable/video_detail_player_progress"
  108 + android:thumb="@null" />
  109 +
  110 + <TextView
  111 + android:id="@+id/tvEditorDuration"
  112 + android:layout_width="wrap_content"
  113 + android:layout_height="wrap_content"
  114 + android:layout_alignParentRight="true"
  115 + android:layout_centerVertical="true"
  116 + android:text="" />
  117 + </RelativeLayout>
  118 +
  119 +</LinearLayout>
0 120 \ No newline at end of file
... ...
app/src/main/res/layout/album_config_dialog.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/album_config_dialog.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical">
  6 +
  7 + <LinearLayout
  8 + android:layout_width="match_parent"
  9 + android:layout_height="wrap_content"
  10 + android:orientation="vertical">
  11 +
  12 + <TextView
  13 + android:layout_width="wrap_content"
  14 + android:layout_height="wrap_content"
  15 + android:layout_margin="10dp"
  16 + android:text="相册设置"
  17 + android:textColor="#ffffff"
  18 + android:textSize="17dp"/>
  19 +
  20 + <LinearLayout
  21 + android:layout_width="match_parent"
  22 + android:layout_height="wrap_content"
  23 + android:orientation="horizontal"
  24 + android:padding="10dp">
  25 +
  26 + <Switch
  27 + android:id="@+id/swEnableAlbumCamera"
  28 + android:layout_width="wrap_content"
  29 + android:layout_height="wrap_content"
  30 + android:textOff="  "
  31 + android:textOn="  "
  32 + android:thumb="@drawable/switch_thumb"
  33 + android:track="@drawable/switch_track"/>
  34 +
  35 + <TextView
  36 + android:layout_width="wrap_content"
  37 + android:layout_height="wrap_content"
  38 + android:layout_centerInParent="true"
  39 + android:text="启用跳转拍摄按钮"
  40 + android:textColor="#ffffff"
  41 + android:textSize="17dp"/>
  42 + </LinearLayout>
  43 +
  44 + <LinearLayout
  45 + android:layout_width="match_parent"
  46 + android:layout_height="wrap_content"
  47 + android:orientation="horizontal">
  48 +
  49 + <TextView
  50 + android:layout_width="wrap_content"
  51 + android:layout_height="wrap_content"
  52 + android:layout_margin="10dp"
  53 + android:text="媒体选择数量上限:"
  54 + android:textColor="#ffffff"
  55 + android:textSize="17dp"/>
  56 +
  57 + <EditText
  58 + android:id="@+id/etAlbumMediaCountLimit"
  59 + android:layout_width="wrap_content"
  60 + android:layout_height="wrap_content"
  61 + android:layout_gravity="center_vertical"
  62 + android:layout_marginRight="5dp"
  63 + android:background="@drawable/layout_stroke"
  64 + android:gravity="center"
  65 + android:hint="默认0为不限制"
  66 + android:inputType="number"
  67 + android:padding="5dp"
  68 + android:textColor="#ffffff"/>
  69 + </LinearLayout>
  70 + </LinearLayout>
  71 +
  72 +</ScrollView>
0 73 \ No newline at end of file
... ...
app/src/main/res/layout/audio_config_dialog.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/audio_config_dialog.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical">
  6 +
  7 + <LinearLayout
  8 + android:layout_width="match_parent"
  9 + android:layout_height="wrap_content"
  10 + android:orientation="vertical">
  11 +
  12 + <TextView
  13 + android:layout_width="wrap_content"
  14 + android:layout_height="wrap_content"
  15 + android:layout_margin="10dp"
  16 + android:text="音频设置"
  17 + android:textColor="#ffffff"
  18 + android:textSize="17dp"/>
  19 +
  20 +
  21 + <LinearLayout
  22 + android:layout_width="match_parent"
  23 + android:layout_height="wrap_content"
  24 + android:orientation="horizontal">
  25 +
  26 + <TextView
  27 + android:layout_width="wrap_content"
  28 + android:layout_height="wrap_content"
  29 + android:layout_margin="10dp"
  30 + android:text="音频声道数:"
  31 + android:textColor="#ffffff"
  32 + android:textSize="17dp"/>
  33 +
  34 + <EditText
  35 + android:id="@+id/etNumChannels"
  36 + android:layout_width="wrap_content"
  37 + android:layout_height="wrap_content"
  38 + android:layout_gravity="center_vertical"
  39 + android:layout_marginRight="5dp"
  40 + android:background="@drawable/layout_stroke"
  41 + android:gravity="center"
  42 + android:hint="不设置为默认值"
  43 + android:inputType="number"
  44 + android:padding="5dp"
  45 + android:textColor="#ffffff"/>
  46 + </LinearLayout>
  47 +
  48 + <LinearLayout
  49 + android:layout_width="match_parent"
  50 + android:layout_height="wrap_content"
  51 + android:orientation="horizontal">
  52 +
  53 + <TextView
  54 + android:layout_width="wrap_content"
  55 + android:layout_height="wrap_content"
  56 + android:layout_margin="10dp"
  57 + android:text="音频采样率:"
  58 + android:textColor="#ffffff"
  59 + android:textSize="17dp"/>
  60 +
  61 + <EditText
  62 + android:id="@+id/etSampleRate"
  63 + android:layout_width="wrap_content"
  64 + android:layout_height="wrap_content"
  65 + android:layout_gravity="center_vertical"
  66 + android:layout_marginRight="5dp"
  67 + android:background="@drawable/layout_stroke"
  68 + android:gravity="center"
  69 + android:hint="不设置为默认值"
  70 + android:inputType="number"
  71 + android:padding="5dp"
  72 + android:textColor="#ffffff"/>
  73 + </LinearLayout>
  74 +
  75 + <LinearLayout
  76 + android:layout_width="match_parent"
  77 + android:layout_height="wrap_content"
  78 + android:orientation="horizontal">
  79 +
  80 + <TextView
  81 + android:layout_width="wrap_content"
  82 + android:layout_height="wrap_content"
  83 + android:layout_margin="10dp"
  84 + android:text="音频码率:"
  85 + android:textColor="#ffffff"
  86 + android:textSize="17dp"/>
  87 +
  88 + <EditText
  89 + android:id="@+id/etAudioBitRate"
  90 + android:layout_width="wrap_content"
  91 + android:layout_height="wrap_content"
  92 + android:layout_gravity="center_vertical"
  93 + android:layout_marginRight="5dp"
  94 + android:background="@drawable/layout_stroke"
  95 + android:gravity="center"
  96 + android:hint="不设置为默认值"
  97 + android:inputType="number"
  98 + android:padding="5dp"
  99 + android:textColor="#ffffff"/>
  100 + </LinearLayout>
  101 + </LinearLayout>
  102 +
  103 +</ScrollView>
0 104 \ No newline at end of file
... ...
app/src/main/res/layout/camera_config_dialog.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/camera_config_dialog.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical" >
  6 +
  7 + <LinearLayout
  8 + android:layout_width="match_parent"
  9 + android:layout_height="wrap_content"
  10 + android:orientation="vertical" >
  11 +
  12 + <TextView
  13 + android:layout_width="wrap_content"
  14 + android:layout_height="wrap_content"
  15 + android:layout_margin="10dp"
  16 + android:text="UI方向设置(仅全屏录制模式时有效)"
  17 + android:textColor="#ffffff"
  18 + android:textSize="17dp" />
  19 +
  20 + <RadioGroup
  21 + android:id="@+id/rgOrientation"
  22 + android:layout_width="match_parent"
  23 + android:layout_height="wrap_content"
  24 + android:background="@drawable/layout_stroke"
  25 + android:orientation="horizontal" >
  26 +
  27 + <RadioButton
  28 + android:id="@+id/rbOrientationPortrait"
  29 + android:layout_width="wrap_content"
  30 + android:layout_height="wrap_content"
  31 + android:layout_weight="1"
  32 + android:text="锁定竖屏" />
  33 +
  34 + <RadioButton
  35 + android:id="@+id/rbOrientationLandscape"
  36 + android:layout_width="wrap_content"
  37 + android:layout_height="wrap_content"
  38 + android:layout_weight="1"
  39 + android:text="锁定横屏" />
  40 +
  41 + <RadioButton
  42 + android:id="@+id/rbOrientationAuto"
  43 + android:layout_width="wrap_content"
  44 + android:layout_height="wrap_content"
  45 + android:layout_weight="1"
  46 + android:text="自动切换" />
  47 + </RadioGroup>
  48 +
  49 + <RelativeLayout
  50 + android:layout_width="match_parent"
  51 + android:layout_height="wrap_content"
  52 + android:layout_marginTop="5dp"
  53 + android:background="@drawable/layout_stroke"
  54 + android:padding="10dp" >
  55 +
  56 + <CheckBox
  57 + android:id="@+id/cbRecordSupportPlayMusic"
  58 + android:layout_width="wrap_content"
  59 + android:layout_height="40dp"
  60 + android:layout_marginLeft="10dp"
  61 + android:background="#000000"
  62 + android:text="录制时播放音乐" />
  63 + </RelativeLayout>
  64 +
  65 + <RelativeLayout
  66 + android:layout_width="match_parent"
  67 + android:layout_height="wrap_content" >
  68 +
  69 + <LinearLayout
  70 + android:layout_width="match_parent"
  71 + android:layout_height="wrap_content"
  72 + android:layout_below="@+id/tvCameraSupport"
  73 + android:layout_marginTop="-20dp"
  74 + android:background="@drawable/layout_stroke"
  75 + android:orientation="vertical"
  76 + android:paddingLeft="5dp"
  77 + android:paddingRight="5dp"
  78 + android:paddingTop="20dp" >
  79 +
  80 + <!-- 视频 -->
  81 +
  82 + <RelativeLayout
  83 + android:layout_width="match_parent"
  84 + android:layout_height="wrap_content" >
  85 +
  86 + <LinearLayout
  87 + android:layout_width="match_parent"
  88 + android:layout_height="wrap_content"
  89 + android:layout_below="@+id/cbRec"
  90 + android:layout_marginTop="-20dp"
  91 + android:background="@drawable/layout_stroke"
  92 + android:orientation="vertical"
  93 + android:paddingTop="20dp" >
  94 +
  95 + <LinearLayout
  96 + android:layout_width="match_parent"
  97 + android:layout_height="wrap_content"
  98 + android:orientation="horizontal" >
  99 +
  100 + <TextView
  101 + android:id="@+id/textView"
  102 + android:layout_width="wrap_content"
  103 + android:layout_height="wrap_content"
  104 + android:layout_margin="10dp"
  105 + android:text="录制最小时长:"
  106 + android:textColor="#ffffff"
  107 + android:textSize="17dp" />
  108 +
  109 + <EditText
  110 + android:id="@+id/etCameraMinTime"
  111 + android:layout_width="wrap_content"
  112 + android:layout_height="wrap_content"
  113 + android:layout_gravity="center_vertical"
  114 + android:layout_marginRight="5dp"
  115 + android:background="@drawable/layout_stroke"
  116 + android:gravity="center"
  117 + android:hint="默认0为不限制,单位秒"
  118 + android:inputType="number"
  119 + android:padding="5dp"
  120 + android:textColor="#ffffff" />
  121 + </LinearLayout>
  122 +
  123 + <LinearLayout
  124 + android:id="@+id/llCameraMaxTime"
  125 + android:layout_width="match_parent"
  126 + android:layout_height="wrap_content"
  127 + android:layout_marginBottom="5dp"
  128 + android:layout_marginTop="5dp"
  129 + android:orientation="horizontal" >
  130 +
  131 + <TextView
  132 + android:layout_width="wrap_content"
  133 + android:layout_height="wrap_content"
  134 + android:layout_margin="10dp"
  135 + android:text="录制最大时长:"
  136 + android:textColor="#ffffff"
  137 + android:textSize="17dp" />
  138 +
  139 + <EditText
  140 + android:id="@+id/etCameraMaxTime"
  141 + android:layout_width="wrap_content"
  142 + android:layout_height="wrap_content"
  143 + android:layout_gravity="center_vertical"
  144 + android:layout_marginRight="5dp"
  145 + android:background="@drawable/layout_stroke"
  146 + android:gravity="center"
  147 + android:hint="默认0为不限制,单位秒"
  148 + android:inputType="number"
  149 + android:padding="5dp"
  150 + android:textColor="#ffffff" />
  151 + </LinearLayout>
  152 + </LinearLayout>
  153 +
  154 + <CheckBox
  155 + android:id="@+id/cbRec"
  156 + android:layout_width="wrap_content"
  157 + android:layout_height="40dp"
  158 + android:layout_alignParentLeft="true"
  159 + android:layout_alignParentStart="true"
  160 + android:layout_alignParentTop="true"
  161 + android:layout_marginLeft="10dp"
  162 + android:background="#000000"
  163 + android:text="视频" />
  164 + </RelativeLayout>
  165 +
  166 + <!-- MV -->
  167 +
  168 + <RelativeLayout
  169 + android:layout_width="match_parent"
  170 + android:layout_height="wrap_content" >
  171 +
  172 + <LinearLayout
  173 + android:layout_width="match_parent"
  174 + android:layout_height="wrap_content"
  175 + android:layout_below="@+id/cbMV"
  176 + android:layout_marginTop="-20dp"
  177 + android:background="@drawable/layout_stroke"
  178 + android:orientation="vertical"
  179 + android:paddingTop="20dp" >
  180 +
  181 + <LinearLayout
  182 + android:layout_width="match_parent"
  183 + android:layout_height="wrap_content"
  184 + android:orientation="horizontal" >
  185 +
  186 + <TextView
  187 + android:layout_width="wrap_content"
  188 + android:layout_height="wrap_content"
  189 + android:layout_margin="10dp"
  190 + android:text="MV最小时长:"
  191 + android:textColor="#ffffff"
  192 + android:textSize="17dp" />
  193 +
  194 + <EditText
  195 + android:id="@+id/etCameraMVMinTime"
  196 + android:layout_width="wrap_content"
  197 + android:layout_height="wrap_content"
  198 + android:layout_gravity="center_vertical"
  199 + android:layout_marginRight="5dp"
  200 + android:background="@drawable/layout_stroke"
  201 + android:gravity="center"
  202 + android:hint="默认为不限制,单位秒"
  203 + android:inputType="number"
  204 + android:padding="5dp"
  205 + android:textColor="#ffffff" />
  206 + </LinearLayout>
  207 +
  208 + <LinearLayout
  209 + android:layout_width="match_parent"
  210 + android:layout_height="wrap_content"
  211 + android:orientation="horizontal" >
  212 +
  213 + <TextView
  214 + android:layout_width="wrap_content"
  215 + android:layout_height="wrap_content"
  216 + android:layout_margin="10dp"
  217 + android:text="MV最大时长:"
  218 + android:textColor="#ffffff"
  219 + android:textSize="17dp" />
  220 +
  221 + <EditText
  222 + android:id="@+id/etCameraMVMaxTime"
  223 + android:layout_width="wrap_content"
  224 + android:layout_height="wrap_content"
  225 + android:layout_gravity="center_vertical"
  226 + android:layout_marginRight="5dp"
  227 + android:background="@drawable/layout_stroke"
  228 + android:gravity="center"
  229 + android:hint="默认为15秒,单位秒"
  230 + android:inputType="number"
  231 + android:padding="5dp"
  232 + android:textColor="#ffffff" />
  233 + </LinearLayout>
  234 + </LinearLayout>
  235 +
  236 + <CheckBox
  237 + android:id="@+id/cbMV"
  238 + android:layout_width="wrap_content"
  239 + android:layout_height="40dp"
  240 + android:layout_alignParentLeft="true"
  241 + android:layout_alignParentStart="true"
  242 + android:layout_alignParentTop="true"
  243 + android:layout_marginLeft="10dp"
  244 + android:background="#000000"
  245 + android:text="短视频MV" />
  246 + </RelativeLayout>
  247 +
  248 + <!-- 照片 -->
  249 +
  250 + <CheckBox
  251 + android:id="@+id/cbPhoto"
  252 + android:layout_width="wrap_content"
  253 + android:layout_height="40dp"
  254 + android:layout_marginLeft="10dp"
  255 + android:text="照片" />
  256 + </LinearLayout>
  257 +
  258 + <TextView
  259 + android:id="@+id/tvCameraSupport"
  260 + android:layout_width="wrap_content"
  261 + android:layout_height="40dp"
  262 + android:layout_marginLeft="10dp"
  263 + android:background="#000000"
  264 + android:gravity="center"
  265 + android:text="拍摄支持模式"
  266 + android:textColor="#ffffff"
  267 + android:textSize="17dp" />
  268 + </RelativeLayout>
  269 +
  270 + <TextView
  271 + android:layout_width="wrap_content"
  272 + android:layout_height="wrap_content"
  273 + android:layout_margin="10dp"
  274 + android:text="摄像头默认设置:"
  275 + android:textColor="#ffffff"
  276 + android:textSize="17dp" />
  277 +
  278 + <RadioGroup
  279 + android:id="@+id/rgIsRearCamera"
  280 + android:layout_width="match_parent"
  281 + android:layout_height="wrap_content"
  282 + android:background="@drawable/layout_stroke"
  283 + android:orientation="horizontal" >
  284 +
  285 + <RadioButton
  286 + android:id="@+id/rbFrontCamera"
  287 + android:layout_width="wrap_content"
  288 + android:layout_height="wrap_content"
  289 + android:layout_weight="1"
  290 + android:text="前置" />
  291 +
  292 + <RadioButton
  293 + android:id="@+id/rbRearCamera"
  294 + android:layout_width="wrap_content"
  295 + android:layout_height="wrap_content"
  296 + android:layout_weight="1"
  297 + android:text="后置" />
  298 + </RadioGroup>
  299 +
  300 + <TextView
  301 + android:layout_width="wrap_content"
  302 + android:layout_height="wrap_content"
  303 + android:layout_margin="10dp"
  304 + android:text="拍摄模式设置:"
  305 + android:textColor="#ffffff"
  306 + android:textSize="17dp" />
  307 +
  308 + <RadioGroup
  309 + android:id="@+id/rgCameraMode"
  310 + android:layout_width="match_parent"
  311 + android:layout_height="wrap_content"
  312 + android:background="@drawable/layout_stroke"
  313 + android:orientation="horizontal" >
  314 +
  315 + <RadioButton
  316 + android:id="@+id/rbSingleShoot"
  317 + android:layout_width="wrap_content"
  318 + android:layout_height="wrap_content"
  319 + android:layout_weight="1"
  320 + android:text="单次拍摄" />
  321 +
  322 + <RadioButton
  323 + android:id="@+id/rbMultiShoot"
  324 + android:layout_width="wrap_content"
  325 + android:layout_height="wrap_content"
  326 + android:layout_weight="1"
  327 + android:text="多次拍摄" />
  328 + </RadioGroup>
  329 +
  330 + <RelativeLayout
  331 + android:layout_width="match_parent"
  332 + android:layout_height="wrap_content"
  333 + android:padding="10dp" >
  334 +
  335 + <Switch
  336 + android:id="@+id/swIsSaveToAlbum"
  337 + android:layout_width="wrap_content"
  338 + android:layout_height="wrap_content"
  339 + android:textOff="  "
  340 + android:textOn="  "
  341 + android:thumb="@drawable/switch_thumb"
  342 + android:track="@drawable/switch_track" />
  343 +
  344 + <TextView
  345 + android:layout_width="wrap_content"
  346 + android:layout_height="wrap_content"
  347 + android:layout_centerVertical="true"
  348 + android:layout_marginLeft="15dp"
  349 + android:layout_toRightOf="@+id/swIsSaveToAlbum"
  350 + android:text="单次拍摄是否保存至相册"
  351 + android:textColor="#ffffff"
  352 + android:textSize="17dp" />
  353 + </RelativeLayout>
  354 +
  355 + <RelativeLayout
  356 + android:layout_width="match_parent"
  357 + android:layout_height="wrap_content"
  358 + android:padding="10dp" >
  359 +
  360 + <Switch
  361 + android:id="@+id/swEnableAlbum"
  362 + android:layout_width="wrap_content"
  363 + android:layout_height="wrap_content"
  364 + android:textOff="  "
  365 + android:textOn="  "
  366 + android:thumb="@drawable/switch_thumb"
  367 + android:track="@drawable/switch_track" />
  368 +
  369 + <TextView
  370 + android:layout_width="wrap_content"
  371 + android:layout_height="wrap_content"
  372 + android:layout_centerVertical="true"
  373 + android:layout_marginLeft="15dp"
  374 + android:layout_toRightOf="@+id/swEnableAlbum"
  375 + android:text="是否显示相册按钮"
  376 + android:textColor="#ffffff"
  377 + android:textSize="17dp" />
  378 + </RelativeLayout>
  379 +
  380 + <RelativeLayout
  381 + android:layout_width="match_parent"
  382 + android:layout_height="wrap_content"
  383 + android:padding="10dp" >
  384 +
  385 + <Switch
  386 + android:id="@+id/swUseCustomAlbum"
  387 + android:layout_width="wrap_content"
  388 + android:layout_height="wrap_content"
  389 + android:textOff="  "
  390 + android:textOn="  "
  391 + android:thumb="@drawable/switch_thumb"
  392 + android:track="@drawable/switch_track" />
  393 +
  394 + <TextView
  395 + android:layout_width="wrap_content"
  396 + android:layout_height="wrap_content"
  397 + android:layout_centerVertical="true"
  398 + android:layout_marginLeft="15dp"
  399 + android:layout_toRightOf="@+id/swUseCustomAlbum"
  400 + android:text="是否使用自定义相册"
  401 + android:textColor="#ffffff"
  402 + android:textSize="17dp" />
  403 + </RelativeLayout>
  404 +
  405 + <LinearLayout
  406 + android:layout_width="match_parent"
  407 + android:layout_height="wrap_content"
  408 + android:orientation="vertical" >
  409 +
  410 + <TextView
  411 + android:layout_width="wrap_content"
  412 + android:layout_height="wrap_content"
  413 + android:layout_gravity="left"
  414 + android:layout_margin="10dp"
  415 + android:text="是否启用人脸识别及贴纸(android4.3及以上支持):"
  416 + android:textColor="#ffffff"
  417 + android:textSize="17dp" />
  418 +
  419 + <RadioGroup
  420 + android:id="@+id/rgCameraFaceGroup"
  421 + android:layout_width="match_parent"
  422 + android:layout_height="wrap_content"
  423 + android:background="@drawable/layout_stroke"
  424 + android:orientation="horizontal" >
  425 +
  426 + <RadioButton
  427 + android:id="@+id/rbEnableFace"
  428 + android:layout_width="wrap_content"
  429 + android:layout_height="wrap_content"
  430 + android:layout_weight="1"
  431 + android:text="开启" />
  432 +
  433 + <RadioButton
  434 + android:id="@+id/rbUnableFace"
  435 + android:layout_width="wrap_content"
  436 + android:layout_height="wrap_content"
  437 + android:layout_weight="1"
  438 + android:text="关闭" />
  439 + </RadioGroup>
  440 + </LinearLayout>
  441 +
  442 + <!-- 水印 -->
  443 +
  444 + <RelativeLayout
  445 + android:layout_width="match_parent"
  446 + android:layout_height="wrap_content" >
  447 +
  448 + <LinearLayout
  449 + android:layout_width="match_parent"
  450 + android:layout_height="wrap_content"
  451 + android:layout_below="@+id/cbOsd"
  452 + android:layout_marginTop="-20dp"
  453 + android:background="@drawable/layout_stroke"
  454 + android:orientation="vertical"
  455 + android:paddingTop="20dp" >
  456 +
  457 + <LinearLayout
  458 + android:layout_width="match_parent"
  459 + android:layout_height="wrap_content"
  460 + android:orientation="horizontal" >
  461 +
  462 + <TextView
  463 + android:layout_width="wrap_content"
  464 + android:layout_height="wrap_content"
  465 + android:layout_margin="10dp"
  466 + android:text="水印片尾时长:"
  467 + android:textColor="#ffffff"
  468 + android:textSize="17dp" />
  469 +
  470 + <EditText
  471 + android:id="@+id/etOsdEnd"
  472 + android:layout_width="wrap_content"
  473 + android:layout_height="wrap_content"
  474 + android:layout_gravity="center_vertical"
  475 + android:layout_marginRight="5dp"
  476 + android:background="@drawable/layout_stroke"
  477 + android:gravity="center"
  478 + android:hint="范围(0-1.0f),单位秒"
  479 + android:inputType="numberDecimal"
  480 + android:padding="5dp"
  481 + android:textColor="#ffffff" />
  482 + </LinearLayout>
  483 + </LinearLayout>
  484 +
  485 + <CheckBox
  486 + android:id="@+id/cbOsd"
  487 + android:layout_width="wrap_content"
  488 + android:layout_height="40dp"
  489 + android:layout_alignParentLeft="true"
  490 + android:layout_alignParentStart="true"
  491 + android:layout_alignParentTop="true"
  492 + android:layout_marginLeft="10dp"
  493 + android:background="#000000"
  494 + android:text="相机水印" />
  495 + </RelativeLayout>
  496 +
  497 + <RelativeLayout
  498 + android:layout_width="match_parent"
  499 + android:layout_height="wrap_content"
  500 + android:layout_marginTop="5dp"
  501 + android:background="@drawable/layout_stroke"
  502 + android:padding="10dp" >
  503 +
  504 + <CheckBox
  505 + android:id="@+id/cbAntiChange"
  506 + android:layout_width="wrap_content"
  507 + android:layout_height="40dp"
  508 + android:layout_marginLeft="10dp"
  509 + android:background="#000000"
  510 + android:text="启用防篡改录制" />
  511 + </RelativeLayout>
  512 +
  513 + <RelativeLayout
  514 + android:layout_width="match_parent"
  515 + android:layout_height="wrap_content"
  516 + android:layout_marginTop="5dp"
  517 + android:background="@drawable/layout_stroke"
  518 + android:padding="10dp" >
  519 +
  520 + <CheckBox
  521 + android:id="@+id/cbEnableBeauty"
  522 + android:layout_width="wrap_content"
  523 + android:layout_height="40dp"
  524 + android:layout_marginLeft="10dp"
  525 + android:background="#000000"
  526 + android:text="是否启用美颜" />
  527 + </RelativeLayout>
  528 +
  529 + <RelativeLayout
  530 + android:layout_width="match_parent"
  531 + android:layout_height="wrap_content"
  532 + android:layout_marginTop="5dp"
  533 + android:background="@drawable/layout_stroke"
  534 + android:padding="10dp" >
  535 +
  536 + <CheckBox
  537 + android:id="@+id/cbFrontMirror"
  538 + android:layout_width="wrap_content"
  539 + android:layout_height="40dp"
  540 + android:layout_marginLeft="10dp"
  541 + android:background="#000000"
  542 + android:text="启用前置输出镜像(4.3以上有效)" />
  543 + </RelativeLayout>
  544 +
  545 + </LinearLayout>
  546 +
  547 +</ScrollView>
0 548 \ No newline at end of file
... ...
app/src/main/res/layout/camera_watermark_layout.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/camera_watermark_layout.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical" >
  6 +
  7 + <TextView
  8 + android:id="@+id/osdInfo"
  9 + android:layout_width="match_parent"
  10 + android:layout_height="match_parent"
  11 + android:layout_gravity="center"
  12 + android:background="@color/transparent_white"
  13 + android:gravity="center"
  14 + android:marqueeRepeatLimit="marquee_forever"
  15 + android:singleLine="false"
  16 + android:textColor="@color/black"
  17 + android:textSize="@dimen/text_size_16" >
  18 + </TextView>
  19 +
  20 +</LinearLayout>
0 21 \ No newline at end of file
... ...
app/src/main/res/layout/compress_config_dialog.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/compress_config_dialog.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical">
  6 +
  7 + <LinearLayout
  8 + android:layout_width="match_parent"
  9 + android:layout_height="wrap_content"
  10 + android:orientation="vertical">
  11 +
  12 + <LinearLayout
  13 + android:layout_width="match_parent"
  14 + android:layout_height="wrap_content"
  15 + android:orientation="horizontal"
  16 + android:padding="10dp">
  17 +
  18 + <Switch
  19 + android:id="@+id/swEnableHWcode"
  20 + android:layout_width="wrap_content"
  21 + android:layout_height="wrap_content"
  22 + android:textOff="  "
  23 + android:textOn="  "
  24 + android:thumb="@drawable/switch_thumb"
  25 + android:track="@drawable/switch_track"/>
  26 +
  27 + <TextView
  28 + android:layout_width="wrap_content"
  29 + android:layout_height="wrap_content"
  30 + android:layout_centerInParent="true"
  31 + android:text="使用硬件加速"
  32 + android:textColor="#ffffff"
  33 + android:textSize="17dp"/>
  34 + </LinearLayout>
  35 +
  36 + <RelativeLayout
  37 + android:layout_width="match_parent"
  38 + android:layout_height="wrap_content"
  39 + android:layout_marginBottom="5dp">
  40 +
  41 + <LinearLayout
  42 + android:layout_width="match_parent"
  43 + android:layout_height="wrap_content"
  44 + android:layout_below="@+id/compressWatermark"
  45 + android:layout_marginTop="-20dp"
  46 + android:background="@drawable/layout_stroke"
  47 + android:orientation="vertical"
  48 + android:paddingTop="20dp">
  49 +
  50 + <LinearLayout
  51 + android:layout_width="match_parent"
  52 + android:layout_height="wrap_content"
  53 + android:orientation="horizontal">
  54 +
  55 + <TextView
  56 + android:layout_width="wrap_content"
  57 + android:layout_height="wrap_content"
  58 + android:layout_margin="10dp"
  59 + android:text="x轴:"
  60 + android:textColor="#ffffff"
  61 + android:textSize="17dp"/>
  62 +
  63 + <EditText
  64 + android:id="@+id/etCompressWatermarkXAxis"
  65 + android:layout_width="wrap_content"
  66 + android:layout_height="wrap_content"
  67 + android:layout_gravity="center_vertical"
  68 + android:layout_marginRight="5dp"
  69 + android:background="@drawable/layout_stroke"
  70 + android:gravity="center"
  71 + android:hint="范围0-1.0"
  72 + android:inputType="numberDecimal"
  73 + android:padding="5dp"
  74 + android:textColor="#ffffff"/>
  75 +
  76 + <TextView
  77 + android:layout_width="wrap_content"
  78 + android:layout_height="wrap_content"
  79 + android:layout_margin="10dp"
  80 + android:text="y轴:"
  81 + android:textColor="#ffffff"
  82 + android:textSize="17dp"/>
  83 +
  84 + <EditText
  85 + android:id="@+id/etCompressWatermarkYAxis"
  86 + android:layout_width="wrap_content"
  87 + android:layout_height="wrap_content"
  88 + android:layout_gravity="center_vertical"
  89 + android:layout_marginRight="5dp"
  90 + android:background="@drawable/layout_stroke"
  91 + android:gravity="center"
  92 + android:hint="范围0-1.0"
  93 + android:inputType="numberDecimal"
  94 + android:padding="5dp"
  95 + android:textColor="#ffffff"/>
  96 + </LinearLayout>
  97 +
  98 + <LinearLayout
  99 + android:layout_width="match_parent"
  100 + android:layout_height="wrap_content"
  101 + android:orientation="horizontal">
  102 +
  103 + <TextView
  104 + android:layout_width="wrap_content"
  105 + android:layout_height="wrap_content"
  106 + android:layout_margin="10dp"
  107 + android:text="x轴缩放比例:"
  108 + android:textColor="#ffffff"
  109 + android:textSize="17dp"/>
  110 +
  111 + <EditText
  112 + android:id="@+id/etCompressWatermarkXZoom"
  113 + android:layout_width="wrap_content"
  114 + android:layout_height="wrap_content"
  115 + android:layout_gravity="center_vertical"
  116 + android:layout_marginRight="5dp"
  117 + android:background="@drawable/layout_stroke"
  118 + android:gravity="center"
  119 + android:hint="默认为1"
  120 + android:inputType="numberDecimal"
  121 + android:padding="5dp"
  122 + android:textColor="#ffffff"/>
  123 + </LinearLayout>
  124 +
  125 + <LinearLayout
  126 + android:layout_width="match_parent"
  127 + android:layout_height="wrap_content"
  128 + android:orientation="horizontal">
  129 +
  130 + <TextView
  131 + android:layout_width="wrap_content"
  132 + android:layout_height="wrap_content"
  133 + android:layout_margin="10dp"
  134 + android:text="y轴缩放比例:"
  135 + android:textColor="#ffffff"
  136 + android:textSize="17dp"/>
  137 +
  138 + <EditText
  139 + android:id="@+id/etCompressWatermarkYZoom"
  140 + android:layout_width="wrap_content"
  141 + android:layout_height="wrap_content"
  142 + android:layout_gravity="center_vertical"
  143 + android:layout_marginRight="5dp"
  144 + android:background="@drawable/layout_stroke"
  145 + android:gravity="center"
  146 + android:hint="默认为1"
  147 + android:inputType="numberDecimal"
  148 + android:padding="5dp"
  149 + android:textColor="#ffffff"/>
  150 + </LinearLayout>
  151 + </LinearLayout>
  152 +
  153 + <CheckBox
  154 + android:id="@+id/compressWatermark"
  155 + android:layout_width="wrap_content"
  156 + android:layout_height="40dp"
  157 + android:layout_marginLeft="10dp"
  158 + android:background="#000000"
  159 + android:text="视频水印"/>
  160 + </RelativeLayout>
  161 +
  162 + <LinearLayout
  163 + android:layout_width="match_parent"
  164 + android:layout_height="wrap_content"
  165 + android:orientation="horizontal">
  166 +
  167 + <TextView
  168 + android:layout_width="wrap_content"
  169 + android:layout_height="wrap_content"
  170 + android:layout_margin="10dp"
  171 + android:text="码率:"
  172 + android:textColor="#ffffff"
  173 + android:textSize="17dp"/>
  174 +
  175 + <EditText
  176 + android:id="@+id/etCompressBitRate"
  177 + android:layout_width="wrap_content"
  178 + android:layout_height="wrap_content"
  179 + android:layout_gravity="center_vertical"
  180 + android:layout_marginRight="5dp"
  181 + android:background="@drawable/layout_stroke"
  182 + android:gravity="center"
  183 + android:hint="默认为4M,单位M"
  184 + android:inputType="numberDecimal"
  185 + android:padding="5dp"
  186 + android:textColor="#ffffff"/>
  187 + </LinearLayout>
  188 +
  189 + <LinearLayout
  190 + android:layout_width="match_parent"
  191 + android:layout_height="wrap_content"
  192 + android:layout_marginTop="10dp"
  193 + android:orientation="horizontal">
  194 +
  195 + <TextView
  196 + android:layout_width="wrap_content"
  197 + android:layout_height="wrap_content"
  198 + android:layout_margin="10dp"
  199 + android:text="视频宽度:"
  200 + android:textColor="#ffffff"
  201 + android:textSize="17dp"/>
  202 +
  203 + <EditText
  204 + android:id="@+id/etCompressVideoWidth"
  205 + android:layout_width="wrap_content"
  206 + android:layout_height="wrap_content"
  207 + android:layout_gravity="center_vertical"
  208 + android:layout_marginRight="5dp"
  209 + android:background="@drawable/layout_stroke"
  210 + android:gravity="center"
  211 + android:hint="默认为原始宽高"
  212 + android:numeric="integer"
  213 + android:padding="5dp"
  214 + android:textColor="#ffffff"/>
  215 + </LinearLayout>
  216 +
  217 + <LinearLayout
  218 + android:layout_width="match_parent"
  219 + android:layout_height="wrap_content"
  220 + android:layout_marginTop="10dp"
  221 + android:orientation="horizontal">
  222 +
  223 + <TextView
  224 + android:layout_width="wrap_content"
  225 + android:layout_height="wrap_content"
  226 + android:layout_margin="10dp"
  227 + android:text="视频高度:"
  228 + android:textColor="#ffffff"
  229 + android:textSize="17dp"/>
  230 +
  231 + <EditText
  232 + android:id="@+id/etCompressVideoHeight"
  233 + android:layout_width="wrap_content"
  234 + android:layout_height="wrap_content"
  235 + android:layout_gravity="center_vertical"
  236 + android:layout_marginRight="5dp"
  237 + android:background="@drawable/layout_stroke"
  238 + android:gravity="center"
  239 + android:hint="默认为原始宽高"
  240 + android:numeric="integer"
  241 + android:padding="5dp"
  242 + android:textColor="#ffffff"/>
  243 + </LinearLayout>
  244 + </LinearLayout>
  245 +
  246 +</ScrollView>
0 247 \ No newline at end of file
... ...
app/src/main/res/layout/osd_dialog.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/osd_dialog.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical" >
  6 +
  7 + <LinearLayout
  8 + android:layout_width="match_parent"
  9 + android:layout_height="wrap_content"
  10 + android:orientation="vertical" >
  11 +
  12 + <LinearLayout
  13 + android:layout_width="match_parent"
  14 + android:layout_height="wrap_content"
  15 + android:orientation="horizontal" >
  16 +
  17 + <TextView
  18 + android:layout_width="wrap_content"
  19 + android:layout_height="wrap_content"
  20 + android:layout_margin="10dp"
  21 + android:text="@string/osd_title"
  22 + android:textColor="#ffffff"
  23 + android:textSize="17dp" />
  24 +
  25 + <EditText
  26 + android:id="@+id/etOsdContent"
  27 + android:layout_width="wrap_content"
  28 + android:layout_height="100dp"
  29 + android:layout_gravity="center_vertical"
  30 + android:layout_marginRight="5dp"
  31 + android:background="@drawable/layout_stroke"
  32 + android:gravity="center"
  33 + android:hint="@string/osd_hint"
  34 + android:maxLines="8"
  35 + android:padding="5dp"
  36 + android:text="@string/osd_content"
  37 + android:textColor="#ffffff" />
  38 + </LinearLayout>
  39 + </LinearLayout>
  40 +
  41 +</ScrollView>
0 42 \ No newline at end of file
... ...
app/src/main/res/layout/progress_view.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/progress_view.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:gravity="center_horizontal"
  6 + android:orientation="vertical">
  7 +
  8 + <TextView
  9 + android:layout_width="wrap_content"
  10 + android:layout_height="wrap_content"
  11 + android:textColor="#ffffff"
  12 + android:textSize="15dp"
  13 + android:id="@+id/tvTitle"
  14 + android:text="正在压缩视频..."/>
  15 +
  16 + <ProgressBar
  17 + android:id="@+id/pbCompress"
  18 + style="@android:style/Widget.ProgressBar.Horizontal"
  19 + android:layout_width="170dp"
  20 + android:layout_height="5dp"
  21 + android:layout_marginTop="5dp"
  22 + android:layout_marginLeft="5dp"
  23 + android:layout_marginRight="5dp"
  24 + android:verticalScrollbarPosition="defaultPosition"/>
  25 +
  26 + <Button
  27 + android:id="@+id/btnCancelCompress"
  28 + android:layout_width="wrap_content"
  29 + android:layout_height="wrap_content"
  30 + android:layout_marginTop="10dp"
  31 + android:padding="5dp"
  32 + android:background="@drawable/layout_stroke"
  33 + android:textColor="#ffffff"
  34 + android:text="取消"/>
  35 +
  36 +</LinearLayout>
0 37 \ No newline at end of file
... ...
app/src/main/res/layout/trim_config_dialog.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/trim_config_dialog.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical">
  6 +
  7 + <LinearLayout
  8 + android:layout_width="match_parent"
  9 + android:layout_height="wrap_content"
  10 + android:orientation="vertical">
  11 +
  12 + <LinearLayout
  13 + android:layout_width="match_parent"
  14 + android:layout_height="wrap_content"
  15 + android:orientation="vertical">
  16 +
  17 + <TextView
  18 + android:layout_width="wrap_content"
  19 + android:layout_height="wrap_content"
  20 + android:layout_margin="10dp"
  21 + android:text="视频截取设置"
  22 + android:textColor="#ffffff"
  23 + android:textSize="17dp"/>
  24 +
  25 + </LinearLayout>
  26 +
  27 + <RelativeLayout
  28 + android:layout_width="match_parent"
  29 + android:layout_height="wrap_content"
  30 + android:layout_marginTop="5dp">
  31 +
  32 + <RadioGroup
  33 + android:id="@+id/rgTrimReturnMode"
  34 + android:layout_width="match_parent"
  35 + android:layout_height="wrap_content"
  36 + android:layout_below="@+id/tvTrimReturnType"
  37 + android:layout_marginTop="-20dp"
  38 + android:background="@drawable/layout_stroke"
  39 + android:clickable="false"
  40 + android:orientation="vertical"
  41 + android:paddingBottom="10dp"
  42 + android:paddingLeft="10dp"
  43 + android:paddingRight="10dp"
  44 + android:paddingTop="20dp">
  45 +
  46 + <RadioButton
  47 + android:id="@+id/rbTrimReturnMedia"
  48 + android:layout_width="wrap_content"
  49 + android:layout_height="wrap_content"
  50 + android:text="真实截取"/>
  51 +
  52 + <RadioButton
  53 + android:id="@+id/rbTrimReturnTime"
  54 + android:layout_width="wrap_content"
  55 + android:layout_height="wrap_content"
  56 + android:text="返回时间段"/>
  57 +
  58 + <RadioButton
  59 + android:id="@+id/rbTrimDynamicReturn"
  60 + android:layout_width="wrap_content"
  61 + android:layout_height="wrap_content"
  62 + android:text="动态截取"/>
  63 + </RadioGroup>
  64 +
  65 + <TextView
  66 + android:id="@+id/tvTrimReturnType"
  67 + android:layout_width="wrap_content"
  68 + android:layout_height="40dp"
  69 + android:layout_marginLeft="10dp"
  70 + android:background="#000000"
  71 + android:gravity="center"
  72 + android:text="截取行为"
  73 + android:textColor="#ffffff"
  74 + android:textSize="17dp"/>
  75 + </RelativeLayout>
  76 +
  77 + <RelativeLayout
  78 + android:layout_width="match_parent"
  79 + android:layout_height="wrap_content"
  80 + android:layout_marginTop="5dp">
  81 +
  82 + <RadioGroup
  83 + android:id="@+id/rgTrimType"
  84 + android:layout_width="match_parent"
  85 + android:layout_height="wrap_content"
  86 + android:layout_below="@+id/tvTrimType"
  87 + android:layout_marginTop="-20dp"
  88 + android:background="@drawable/layout_stroke"
  89 + android:clickable="false"
  90 + android:orientation="vertical"
  91 + android:paddingBottom="10dp"
  92 + android:paddingLeft="10dp"
  93 + android:paddingRight="10dp"
  94 + android:paddingTop="20dp">
  95 +
  96 + <RadioButton
  97 + android:id="@+id/rbTrimTypeFree"
  98 + android:layout_width="wrap_content"
  99 + android:layout_height="wrap_content"
  100 + android:text="自由截取"/>
  101 +
  102 + <RadioButton
  103 + android:id="@+id/rbTrimSingleFixed"
  104 + android:layout_width="wrap_content"
  105 + android:layout_height="wrap_content"
  106 + android:text="单个定长截取"/>
  107 +
  108 + <LinearLayout
  109 + android:id="@+id/llSingleFixedTrimTime"
  110 + android:layout_width="match_parent"
  111 + android:layout_height="wrap_content"
  112 + android:orientation="horizontal"
  113 + android:visibility="gone">
  114 +
  115 + <TextView
  116 + android:layout_width="wrap_content"
  117 + android:layout_height="wrap_content"
  118 + android:layout_margin="10dp"
  119 + android:text="截取时间:"
  120 + android:textColor="#ffffff"
  121 + android:textSize="17dp"/>
  122 +
  123 + <EditText
  124 + android:id="@+id/etSingleFixedTrimTime"
  125 + android:layout_width="wrap_content"
  126 + android:layout_height="wrap_content"
  127 + android:layout_gravity="center_vertical"
  128 + android:layout_marginRight="5dp"
  129 + android:background="@drawable/layout_stroke"
  130 + android:gravity="center"
  131 + android:hint="默认为15秒,单位秒"
  132 + android:inputType="number"
  133 + android:padding="5dp"
  134 + android:textColor="#ffffff"/>
  135 + </LinearLayout>
  136 +
  137 + <RadioButton
  138 + android:id="@+id/rbTrimDoubleFixed"
  139 + android:layout_width="wrap_content"
  140 + android:layout_height="wrap_content"
  141 + android:text="两定长截取"/>
  142 +
  143 + <LinearLayout
  144 + android:id="@+id/llTrimTime1"
  145 + android:layout_width="match_parent"
  146 + android:layout_height="wrap_content"
  147 + android:orientation="horizontal"
  148 + android:visibility="gone">
  149 +
  150 + <TextView
  151 + android:layout_width="wrap_content"
  152 + android:layout_height="wrap_content"
  153 + android:layout_margin="10dp"
  154 + android:text="截取时间1:"
  155 + android:textColor="#ffffff"
  156 + android:textSize="17dp"/>
  157 +
  158 + <EditText
  159 + android:id="@+id/etTrimTime1"
  160 + android:layout_width="wrap_content"
  161 + android:layout_height="wrap_content"
  162 + android:layout_gravity="center_vertical"
  163 + android:layout_marginRight="5dp"
  164 + android:background="@drawable/layout_stroke"
  165 + android:gravity="center"
  166 + android:hint="默认为8秒,单位秒"
  167 + android:inputType="number"
  168 + android:padding="5dp"
  169 + android:textColor="#ffffff"/>
  170 + </LinearLayout>
  171 +
  172 + <LinearLayout
  173 + android:id="@+id/llTrimTime2"
  174 + android:layout_width="match_parent"
  175 + android:layout_height="wrap_content"
  176 + android:orientation="horizontal"
  177 + android:visibility="gone">
  178 +
  179 + <TextView
  180 + android:layout_width="wrap_content"
  181 + android:layout_height="wrap_content"
  182 + android:layout_margin="10dp"
  183 + android:text="截取时间2:"
  184 + android:textColor="#ffffff"
  185 + android:textSize="17dp"/>
  186 +
  187 + <EditText
  188 + android:id="@+id/etTrimTime2"
  189 + android:layout_width="wrap_content"
  190 + android:layout_height="wrap_content"
  191 + android:layout_gravity="center_vertical"
  192 + android:layout_marginRight="5dp"
  193 + android:background="@drawable/layout_stroke"
  194 + android:gravity="center"
  195 + android:hint="默认为16秒,单位秒"
  196 + android:inputType="number"
  197 + android:padding="5dp"
  198 + android:textColor="#ffffff"/>
  199 + </LinearLayout>
  200 + </RadioGroup>
  201 +
  202 + <TextView
  203 + android:id="@+id/tvTrimType"
  204 + android:layout_width="wrap_content"
  205 + android:layout_height="40dp"
  206 + android:layout_marginLeft="10dp"
  207 + android:background="#000000"
  208 + android:gravity="center"
  209 + android:text="截取时间"
  210 + android:textColor="#ffffff"
  211 + android:textSize="17dp"/>
  212 + </RelativeLayout>
  213 +
  214 + <RelativeLayout
  215 + android:layout_width="match_parent"
  216 + android:layout_height="wrap_content"
  217 + android:layout_marginTop="5dp">
  218 +
  219 + <RadioGroup
  220 + android:id="@+id/rgTrimCropMode"
  221 + android:layout_width="match_parent"
  222 + android:layout_height="wrap_content"
  223 + android:layout_below="@+id/tvTrimCropMode"
  224 + android:layout_marginTop="-20dp"
  225 + android:background="@drawable/layout_stroke"
  226 + android:clickable="false"
  227 + android:orientation="vertical"
  228 + android:paddingBottom="10dp"
  229 + android:paddingLeft="10dp"
  230 + android:paddingRight="10dp"
  231 + android:paddingTop="20dp">
  232 +
  233 + <RadioButton
  234 + android:id="@+id/rbTrimNormal"
  235 + android:layout_width="wrap_content"
  236 + android:layout_height="wrap_content"
  237 + android:text="原始"/>
  238 +
  239 + <RadioButton
  240 + android:id="@+id/rbTrim1x1"
  241 + android:layout_width="wrap_content"
  242 + android:layout_height="wrap_content"
  243 + android:text="1比1"/>
  244 +
  245 + <RadioButton
  246 + android:id="@+id/rbTrimNormalWithItem"
  247 + android:layout_width="wrap_content"
  248 + android:layout_height="wrap_content"
  249 + android:text="默认为原始,可切换"/>
  250 +
  251 + <RadioButton
  252 + android:id="@+id/rbTrim1x1WithItem"
  253 + android:layout_width="wrap_content"
  254 + android:layout_height="wrap_content"
  255 + android:text="默认为1比1,可切换"/>
  256 + </RadioGroup>
  257 +
  258 + <TextView
  259 + android:id="@+id/tvTrimCropMode"
  260 + android:layout_width="wrap_content"
  261 + android:layout_height="40dp"
  262 + android:layout_marginLeft="10dp"
  263 + android:background="#000000"
  264 + android:gravity="center"
  265 + android:text="视频裁剪比例"
  266 + android:textColor="#ffffff"
  267 + android:textSize="17dp"/>
  268 + </RelativeLayout>
  269 + </LinearLayout>
  270 +
  271 +</ScrollView>
0 272 \ No newline at end of file
... ...
app/src/main/res/layout/ui_config_dialog.xml 0 → 100644
  1 +++ a/app/src/main/res/layout/ui_config_dialog.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:orientation="vertical">
  6 +
  7 + <LinearLayout
  8 + android:layout_width="match_parent"
  9 + android:layout_height="wrap_content"
  10 + android:orientation="vertical">
  11 +
  12 + <TextView
  13 + android:layout_width="wrap_content"
  14 + android:layout_height="wrap_content"
  15 + android:layout_margin="10dp"
  16 + android:text="UI设置"
  17 + android:textColor="#ffffff"
  18 + android:textSize="17dp"/>
  19 +
  20 +
  21 + <LinearLayout
  22 + android:layout_width="match_parent"
  23 + android:layout_height="wrap_content"
  24 + android:gravity="center_vertical"
  25 + android:orientation="horizontal"
  26 + android:padding="10dp">
  27 +
  28 + <Switch
  29 + android:id="@+id/swWizard"
  30 + android:layout_width="wrap_content"
  31 + android:layout_height="wrap_content"
  32 + android:textOff="  "
  33 + android:textOn="  "
  34 + android:thumb="@drawable/switch_thumb"
  35 + android:track="@drawable/switch_track"/>
  36 +
  37 + <TextView
  38 + android:id="@+id/tvWizard"
  39 + android:layout_width="wrap_content"
  40 + android:layout_height="wrap_content"
  41 + android:layout_marginLeft="15dp"
  42 + android:text="关闭向导模式"
  43 + android:textColor="#ffffff"
  44 + android:textSize="17dp"/>
  45 + </LinearLayout>
  46 +
  47 + <LinearLayout
  48 + android:layout_width="match_parent"
  49 + android:layout_height="wrap_content"
  50 + android:gravity="center_vertical"
  51 + android:orientation="horizontal"
  52 + android:padding="10dp">
  53 +
  54 + <Switch
  55 + android:id="@+id/swAutoRepeat"
  56 + android:layout_width="wrap_content"
  57 + android:layout_height="wrap_content"
  58 + android:textOff="  "
  59 + android:textOn="  "
  60 + android:thumb="@drawable/switch_thumb"
  61 + android:track="@drawable/switch_track"/>
  62 +
  63 + <TextView
  64 + android:id="@+id/tvAutoRepeat"
  65 + android:layout_width="wrap_content"
  66 + android:layout_height="wrap_content"
  67 + android:layout_marginLeft="15dp"
  68 + android:text="关闭自动重播"
  69 + android:textColor="#ffffff"
  70 + android:textSize="17dp"/>
  71 + </LinearLayout>
  72 +
  73 + <RelativeLayout
  74 + android:layout_width="match_parent"
  75 + android:layout_height="wrap_content">
  76 +
  77 +
  78 + <CheckBox
  79 + android:id="@+id/soundTrack"
  80 + android:layout_width="wrap_content"
  81 + android:layout_height="40dp"
  82 + android:layout_marginLeft="10dp"
  83 + android:background="#000000"
  84 + android:text="配乐"/>
  85 + </RelativeLayout>
  86 +
  87 + <RelativeLayout
  88 + android:layout_width="match_parent"
  89 + android:layout_height="wrap_content">
  90 +
  91 +
  92 + <CheckBox
  93 + android:id="@+id/enableLocalMusic"
  94 + android:layout_width="wrap_content"
  95 + android:layout_height="40dp"
  96 + android:layout_marginLeft="10dp"
  97 + android:background="#000000"
  98 + android:text="本地音乐"/>
  99 + </RelativeLayout>
  100 +
  101 + <RelativeLayout
  102 + android:layout_width="match_parent"
  103 + android:layout_height="wrap_content">
  104 +
  105 + <RadioGroup
  106 + android:id="@+id/rgVoiceTrack"
  107 + android:layout_width="match_parent"
  108 + android:layout_height="wrap_content"
  109 + android:layout_below="@+id/VoiceTrack"
  110 + android:layout_marginTop="-20dp"
  111 + android:background="@drawable/layout_stroke"
  112 + android:clickable="false"
  113 + android:orientation="vertical"
  114 + android:paddingBottom="10dp"
  115 + android:paddingLeft="10dp"
  116 + android:paddingRight="10dp"
  117 + android:paddingTop="20dp">
  118 +
  119 + <RadioButton
  120 + android:id="@+id/rbVoiceTrak1"
  121 + android:layout_width="wrap_content"
  122 + android:layout_height="45dp"
  123 + android:text="配音一"/>
  124 +
  125 + <RadioButton
  126 + android:id="@+id/rbVoiceTrak2"
  127 + android:layout_width="wrap_content"
  128 + android:layout_height="45dp"
  129 + android:text="配音二(只能在配乐开启时有效)"/>
  130 + </RadioGroup>
  131 +
  132 + <CheckBox
  133 + android:id="@+id/VoiceTrack"
  134 + android:layout_width="wrap_content"
  135 + android:layout_height="40dp"
  136 + android:layout_marginLeft="10dp"
  137 + android:background="#000000"
  138 + android:text="配音"/>
  139 + </RelativeLayout>
  140 +
  141 + <RelativeLayout
  142 + android:layout_width="match_parent"
  143 + android:layout_height="wrap_content">
  144 +
  145 + <RadioGroup
  146 + android:id="@+id/rgFilter"
  147 + android:layout_width="match_parent"
  148 + android:layout_height="wrap_content"
  149 + android:layout_below="@+id/filter"
  150 + android:layout_marginTop="-20dp"
  151 + android:background="@drawable/layout_stroke"
  152 + android:orientation="horizontal"
  153 + android:paddingBottom="10dp"
  154 + android:paddingLeft="10dp"
  155 + android:paddingRight="10dp"
  156 + android:paddingTop="20dp">
  157 +
  158 + <RadioButton
  159 + android:id="@+id/rbFilter1"
  160 + android:layout_width="0dp"
  161 + android:layout_height="wrap_content"
  162 + android:layout_weight="1"
  163 + android:text="滤镜一"/>
  164 +
  165 + <RadioButton
  166 + android:id="@+id/rbFilter2"
  167 + android:layout_width="0dp"
  168 + android:layout_height="wrap_content"
  169 + android:layout_weight="1"
  170 + android:text="滤镜二"/>
  171 + </RadioGroup>
  172 +
  173 + <CheckBox
  174 + android:id="@+id/filter"
  175 + android:layout_width="wrap_content"
  176 + android:layout_height="40dp"
  177 + android:layout_marginLeft="10dp"
  178 + android:background="#000000"
  179 + android:text="滤镜"/>
  180 + </RelativeLayout>
  181 +
  182 + <LinearLayout
  183 + android:layout_width="match_parent"
  184 + android:layout_height="wrap_content"
  185 + android:orientation="horizontal">
  186 +
  187 + <CheckBox
  188 + android:id="@+id/mv"
  189 + style="@style/checkboxStyle"
  190 + android:text="MV"/>
  191 +
  192 + <CheckBox
  193 + android:id="@+id/specialEffects"
  194 + style="@style/checkboxStyle"
  195 + android:text="特效"/>
  196 +
  197 + <CheckBox
  198 + android:id="@+id/titling"
  199 + style="@style/checkboxStyle"
  200 + android:text="字幕"/>
  201 + </LinearLayout>
  202 +
  203 + <RelativeLayout
  204 + android:layout_width="match_parent"
  205 + android:layout_height="wrap_content">
  206 +
  207 + <LinearLayout
  208 + android:layout_width="match_parent"
  209 + android:layout_height="wrap_content"
  210 + android:layout_below="@+id/clipEditing"
  211 + android:layout_marginTop="-20dp"
  212 + android:background="@drawable/layout_stroke"
  213 + android:orientation="vertical"
  214 + android:paddingTop="20dp">
  215 +
  216 + <LinearLayout
  217 + android:layout_width="match_parent"
  218 + android:layout_height="wrap_content"
  219 + android:orientation="horizontal">
  220 +
  221 + <CheckBox
  222 + android:id="@+id/edit"
  223 + style="@style/checkboxStyle"
  224 + android:text="编辑"/>
  225 +
  226 + <CheckBox
  227 + android:id="@+id/trim"
  228 + style="@style/checkboxStyle"
  229 + android:text="截取"/>
  230 +
  231 + <CheckBox
  232 + android:id="@+id/split"
  233 + style="@style/checkboxStyle"
  234 + android:text="分割"/>
  235 + </LinearLayout>
  236 +
  237 + <LinearLayout
  238 + android:layout_width="match_parent"
  239 + android:layout_height="wrap_content"
  240 + android:orientation="horizontal">
  241 +
  242 + <CheckBox
  243 + android:id="@+id/sort"
  244 + style="@style/checkboxStyle"
  245 + android:text="调序"/>
  246 +
  247 + <CheckBox
  248 + android:id="@+id/copy"
  249 + style="@style/checkboxStyle"
  250 + android:text="复制"/>
  251 +
  252 + <CheckBox
  253 + android:id="@+id/imageDurationControl"
  254 + style="@style/checkboxStyle"
  255 + android:text="图片时长"/>
  256 + </LinearLayout>
  257 +
  258 + <LinearLayout
  259 + android:layout_width="match_parent"
  260 + android:layout_height="wrap_content"
  261 + android:orientation="horizontal"
  262 + android:weightSum="3">
  263 +
  264 + <CheckBox
  265 + android:id="@+id/videoSpeedControl"
  266 + style="@style/checkboxStyle"
  267 + android:text="视频调速"/>
  268 +
  269 + <CheckBox
  270 + android:id="@+id/text"
  271 + style="@style/checkboxStyle"
  272 + android:text="文字板"/>
  273 +
  274 + <CheckBox
  275 + android:id="@+id/reverse"
  276 + style="@style/checkboxStyle"
  277 + android:text="倒序"/>
  278 + </LinearLayout>
  279 +
  280 + <RelativeLayout
  281 + android:layout_width="match_parent"
  282 + android:layout_height="wrap_content"
  283 + android:layout_marginBottom="5dp">
  284 +
  285 + <RadioGroup
  286 + android:id="@+id/rgProportion"
  287 + android:layout_width="match_parent"
  288 + android:layout_height="wrap_content"
  289 + android:layout_below="@+id/proportion"
  290 + android:layout_marginLeft="5dp"
  291 + android:layout_marginRight="5dp"
  292 + android:layout_marginTop="-20dp"
  293 + android:background="@drawable/layout_stroke"
  294 + android:orientation="horizontal"
  295 + android:paddingTop="20dp">
  296 +
  297 + <RadioButton
  298 + android:id="@+id/rbProportionAuto"
  299 + android:layout_width="wrap_content"
  300 + android:layout_height="wrap_content"
  301 + android:layout_weight="1"
  302 + android:text="自动"/>
  303 +
  304 + <RadioButton
  305 + android:id="@+id/rbProportionSquare"
  306 + android:layout_width="wrap_content"
  307 + android:layout_height="wrap_content"
  308 + android:layout_weight="1"
  309 + android:text="1:1"/>
  310 +
  311 + <RadioButton
  312 + android:id="@+id/rbProportionLandscape"
  313 + android:layout_width="wrap_content"
  314 + android:layout_height="wrap_content"
  315 + android:layout_weight="1"
  316 + android:text="16:9"/>
  317 + </RadioGroup>
  318 +
  319 + <CheckBox
  320 + android:id="@+id/proportion"
  321 + android:layout_width="wrap_content"
  322 + android:layout_height="40dp"
  323 + android:layout_marginLeft="10dp"
  324 + android:background="#000000"
  325 + android:text="画面比例"/>
  326 + </RelativeLayout>
  327 + </LinearLayout>
  328 +
  329 + <CheckBox
  330 + android:id="@+id/clipEditing"
  331 + android:layout_width="wrap_content"
  332 + android:layout_height="40dp"
  333 + android:layout_marginLeft="10dp"
  334 + android:background="#000000"
  335 + android:text="片段编辑"/>
  336 + </RelativeLayout>
  337 +
  338 + <TextView
  339 + android:layout_width="wrap_content"
  340 + android:layout_height="wrap_content"
  341 + android:layout_margin="10dp"
  342 + android:text="编辑支持的文件类型:"
  343 + android:textColor="#ffffff"
  344 + android:textSize="17dp"/>
  345 +
  346 + <RadioGroup
  347 + android:id="@+id/rgSupportFormat"
  348 + android:layout_width="match_parent"
  349 + android:layout_height="wrap_content"
  350 + android:background="@drawable/layout_stroke"
  351 + android:orientation="horizontal">
  352 +
  353 + <RadioButton
  354 + android:id="@+id/rbSupportVideoOnly"
  355 + android:layout_width="wrap_content"
  356 + android:layout_height="wrap_content"
  357 + android:layout_weight="1"
  358 + android:text="仅视频"/>
  359 +
  360 + <RadioButton
  361 + android:id="@+id/rbSupportImageOnly"
  362 + android:layout_width="wrap_content"
  363 + android:layout_height="wrap_content"
  364 + android:layout_weight="1"
  365 + android:text="仅图片"/>
  366 +
  367 + <RadioButton
  368 + android:id="@+id/rbSupportDefault"
  369 + android:layout_width="wrap_content"
  370 + android:layout_height="wrap_content"
  371 + android:layout_weight="1"
  372 + android:text="视频+图片"/>
  373 + </RadioGroup>
  374 +
  375 + <TextView
  376 + android:layout_width="wrap_content"
  377 + android:layout_height="wrap_content"
  378 + android:layout_margin="10dp"
  379 + android:text="导出设置"
  380 + android:textColor="#ffffff"
  381 + android:textSize="17dp"/>
  382 +
  383 + <LinearLayout
  384 + android:layout_width="match_parent"
  385 + android:layout_height="wrap_content"
  386 + android:orientation="horizontal">
  387 +
  388 + <TextView
  389 + android:layout_width="wrap_content"
  390 + android:layout_height="wrap_content"
  391 + android:layout_margin="10dp"
  392 + android:text="限制导出视频时间:"
  393 + android:textColor="#ffffff"
  394 + android:textSize="17dp"/>
  395 +
  396 + <EditText
  397 + android:id="@+id/etTimeLimit"
  398 + android:layout_width="wrap_content"
  399 + android:layout_height="wrap_content"
  400 + android:layout_gravity="center_vertical"
  401 + android:layout_marginRight="5dp"
  402 + android:background="@drawable/layout_stroke"
  403 + android:gravity="center"
  404 + android:hint="默认0为不限制,单位秒"
  405 + android:numeric="integer"
  406 + android:textColor="#ffffff"/>
  407 + </LinearLayout>
  408 +
  409 + <CheckBox
  410 + android:id="@+id/videoTrailer"
  411 + android:layout_width="wrap_content"
  412 + android:layout_height="40dp"
  413 + android:text="片尾水印"/>
  414 +
  415 + <RelativeLayout
  416 + android:layout_width="match_parent"
  417 + android:layout_height="wrap_content"
  418 + android:layout_marginBottom="5dp">
  419 +
  420 + <LinearLayout
  421 + android:layout_width="match_parent"
  422 + android:layout_height="wrap_content"
  423 + android:layout_below="@+id/watermark"
  424 + android:layout_marginTop="-20dp"
  425 + android:background="@drawable/layout_stroke"
  426 + android:orientation="vertical"
  427 + android:paddingTop="20dp">
  428 +
  429 + <LinearLayout
  430 + android:layout_width="match_parent"
  431 + android:layout_height="wrap_content"
  432 + android:orientation="horizontal">
  433 +
  434 + <TextView
  435 + android:layout_width="wrap_content"
  436 + android:layout_height="wrap_content"
  437 + android:layout_margin="10dp"
  438 + android:text="x轴:"
  439 + android:textColor="#ffffff"
  440 + android:textSize="17dp"/>
  441 +
  442 + <EditText
  443 + android:id="@+id/etWatermarkXAxis"
  444 + android:layout_width="wrap_content"
  445 + android:layout_height="wrap_content"
  446 + android:layout_gravity="center_vertical"
  447 + android:layout_marginRight="5dp"
  448 + android:background="@drawable/layout_stroke"
  449 + android:gravity="center"
  450 + android:hint="范围0-1.0"
  451 + android:inputType="numberDecimal"
  452 + android:padding="5dp"
  453 + android:textColor="#ffffff"/>
  454 +
  455 + <TextView
  456 + android:layout_width="wrap_content"
  457 + android:layout_height="wrap_content"
  458 + android:layout_margin="10dp"
  459 + android:text="y轴:"
  460 + android:textColor="#ffffff"
  461 + android:textSize="17dp"/>
  462 +
  463 + <EditText
  464 + android:id="@+id/etWatermarkYAxis"
  465 + android:layout_width="wrap_content"
  466 + android:layout_height="wrap_content"
  467 + android:layout_gravity="center_vertical"
  468 + android:layout_marginRight="5dp"
  469 + android:background="@drawable/layout_stroke"
  470 + android:gravity="center"
  471 + android:hint="范围0-1.0"
  472 + android:inputType="numberDecimal"
  473 + android:padding="5dp"
  474 + android:textColor="#ffffff"/>
  475 + </LinearLayout>
  476 +
  477 + <LinearLayout
  478 + android:layout_width="match_parent"
  479 + android:layout_height="wrap_content"
  480 + android:orientation="horizontal">
  481 +
  482 + <TextView
  483 + android:layout_width="wrap_content"
  484 + android:layout_height="wrap_content"
  485 + android:layout_margin="10dp"
  486 + android:text="x轴缩放比例:"
  487 + android:textColor="#ffffff"
  488 + android:textSize="17dp"/>
  489 +
  490 + <EditText
  491 + android:id="@+id/etWatermarkXZoom"
  492 + android:layout_width="wrap_content"
  493 + android:layout_height="wrap_content"
  494 + android:layout_gravity="center_vertical"
  495 + android:layout_marginRight="5dp"
  496 + android:background="@drawable/layout_stroke"
  497 + android:gravity="center"
  498 + android:hint="默认为1"
  499 + android:inputType="numberDecimal"
  500 + android:padding="5dp"
  501 + android:textColor="#ffffff"/>
  502 + </LinearLayout>
  503 +
  504 + <LinearLayout
  505 + android:layout_width="match_parent"
  506 + android:layout_height="wrap_content"
  507 + android:orientation="horizontal">
  508 +
  509 + <TextView
  510 + android:layout_width="wrap_content"
  511 + android:layout_height="wrap_content"
  512 + android:layout_margin="10dp"
  513 + android:text="y轴缩放比例:"
  514 + android:textColor="#ffffff"
  515 + android:textSize="17dp"/>
  516 +
  517 + <EditText
  518 + android:id="@+id/etWatermarkYZoom"
  519 + android:layout_width="wrap_content"
  520 + android:layout_height="wrap_content"
  521 + android:layout_gravity="center_vertical"
  522 + android:layout_marginRight="5dp"
  523 + android:background="@drawable/layout_stroke"
  524 + android:gravity="center"
  525 + android:hint="默认为1"
  526 + android:inputType="numberDecimal"
  527 + android:padding="5dp"
  528 + android:textColor="#ffffff"/>
  529 + </LinearLayout>
  530 + </LinearLayout>
  531 +
  532 + <CheckBox
  533 + android:id="@+id/watermark"
  534 + android:layout_width="wrap_content"
  535 + android:layout_height="40dp"
  536 + android:layout_marginLeft="10dp"
  537 + android:background="#000000"
  538 + android:text="视频水印"/>
  539 +
  540 + <CheckBox
  541 + android:id="@+id/textWatermark"
  542 + android:layout_width="wrap_content"
  543 + android:layout_height="40dp"
  544 + android:layout_marginLeft="30dp"
  545 + android:layout_toRightOf="@id/watermark"
  546 + android:background="#000000"
  547 + android:text="文字水印"/>
  548 + </RelativeLayout>
  549 +
  550 +
  551 + <CheckBox
  552 + android:id="@+id/subTitleSpecialEffectOuter"
  553 + android:layout_width="wrap_content"
  554 + android:layout_height="40dp"
  555 + android:layout_marginLeft="10dp"
  556 + android:background="#000000"
  557 + android:text="字幕、特效在MV之外显示"/>
  558 +
  559 +
  560 + </LinearLayout>
  561 +
  562 +</ScrollView>
0 563 \ No newline at end of file
... ...
app/src/main/res/values/strings.xml 0 → 100644
  1 +++ a/app/src/main/res/values/strings.xml
  1 +<?xml version="1.0" encoding="utf-8" standalone="no"?>
  2 +<resources>
  3 + <string name="app_name">RDVEDemo</string>
  4 + <string name="video_isAntiChang">该视频是防篡改视频</string>
  5 + <string name="osd_title">"水印内容:</string>
  6 + <string name="osd_hint">"请输入水印内容</string>
  7 + <string name="osd_content">"×××营业厅 ×××业务员 \n业务员编号:0001 \n业务名称:xxxx \n客户身份证号:500233yyyymmddxxxx</string>
  8 +
  9 +</resources>
0 10 \ No newline at end of file
... ...
app/src/main/res/values/styles.xml 0 → 100644
  1 +++ a/app/src/main/res/values/styles.xml
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
  3 +
  4 + <style name="txtStyle">
  5 + <item name="android:textSize">20dp</item>
  6 + <item name="android:background">#33333b</item>
  7 + <item name="android:textColor">#FFFFFF</item>
  8 + </style>
  9 +
  10 + <style name="buttonStyle">
  11 + <item name="android:textColor">#ffffff</item>
  12 + <item name="android:layout_width">match_parent</item>
  13 + <item name="android:layout_height">wrap_content</item>
  14 + <item name="android:background">#33333b</item>
  15 + <item name="android:gravity">left</item>
  16 + <item name="android:textSize">16dp</item>
  17 + <item name="android:padding">10dp</item>
  18 + </style>
  19 +
  20 + <style name="checkboxStyle">
  21 + <item name="android:layout_weight">1</item>
  22 + <item name="android:layout_width">0dp</item>
  23 + <item name="android:layout_height">40dp</item>
  24 + </style>
  25 +
  26 + <style name="dialogActivityStyle" parent="@android:Theme.Dialog">
  27 + <item name="android:windowFrame">@null</item>
  28 + <item name="android:windowNoTitle">true</item>
  29 + <item name="android:windowIsFloating">true</item>
  30 + <item name="android:windowContentOverlay">@null</item>
  31 + </style>
  32 +
  33 + <style name="AppBaseTheme" parent="@android:style/Theme.Holo.Light">
  34 + </style>
  35 +
  36 +</resources>
0 37 \ No newline at end of file
... ...
build.gradle 0 → 100644
  1 +++ a/build.gradle
  1 +// Top-level build file where you can add configuration options common to all sub-projects/modules.
  2 +
  3 +buildscript {
  4 +
  5 + repositories {
  6 + google()
  7 + jcenter()
  8 + }
  9 + dependencies {
  10 + classpath 'com.android.tools.build:gradle:3.0.0'
  11 +
  12 +
  13 + // NOTE: Do not place your application dependencies here; they belong
  14 + // in the individual module build.gradle files
  15 + }
  16 +}
  17 +
  18 +allprojects {
  19 + repositories {
  20 + google()
  21 + jcenter()
  22 + }
  23 +}
  24 +
  25 +task clean(type: Delete) {
  26 + delete rootProject.buildDir
  27 +}
... ...
gradle.properties 0 → 100644
  1 +++ a/gradle.properties
  1 +# Project-wide Gradle settings.
  2 +
  3 +# IDE (e.g. Android Studio) users:
  4 +# Gradle settings configured through the IDE *will override*
  5 +# any settings specified in this file.
  6 +
  7 +# For more details on how to configure your build environment visit
  8 +# http://www.gradle.org/docs/current/userguide/build_environment.html
  9 +
  10 +# Specifies the JVM arguments used for the daemon process.
  11 +# The setting is particularly useful for tweaking memory settings.
  12 +org.gradle.jvmargs=-Xmx1536m
  13 +
  14 +# When configured, Gradle will run in incubating parallel mode.
  15 +# This option should only be used with decoupled projects. More details, visit
  16 +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
  17 +# org.gradle.parallel=true
... ...
gradle/wrapper/gradle-wrapper.jar 0 → 100644
No preview for this file type
gradle/wrapper/gradle-wrapper.properties 0 → 100644
  1 +++ a/gradle/wrapper/gradle-wrapper.properties
  1 +#Wed Nov 29 15:38:56 CST 2017
  2 +distributionBase=GRADLE_USER_HOME
  3 +distributionPath=wrapper/dists
  4 +zipStoreBase=GRADLE_USER_HOME
  5 +zipStorePath=wrapper/dists
  6 +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
... ...
gradlew 0 → 100644
  1 +++ a/gradlew
  1 +#!/usr/bin/env bash
  2 +
  3 +##############################################################################
  4 +##
  5 +## Gradle start up script for UN*X
  6 +##
  7 +##############################################################################
  8 +
  9 +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
  10 +DEFAULT_JVM_OPTS=""
  11 +
  12 +APP_NAME="Gradle"
  13 +APP_BASE_NAME=`basename "$0"`
  14 +
  15 +# Use the maximum available, or set MAX_FD != -1 to use that value.
  16 +MAX_FD="maximum"
  17 +
  18 +warn ( ) {
  19 + echo "$*"
  20 +}
  21 +
  22 +die ( ) {
  23 + echo
  24 + echo "$*"
  25 + echo
  26 + exit 1
  27 +}
  28 +
  29 +# OS specific support (must be 'true' or 'false').
  30 +cygwin=false
  31 +msys=false
  32 +darwin=false
  33 +case "`uname`" in
  34 + CYGWIN* )
  35 + cygwin=true
  36 + ;;
  37 + Darwin* )
  38 + darwin=true
  39 + ;;
  40 + MINGW* )
  41 + msys=true
  42 + ;;
  43 +esac
  44 +
  45 +# Attempt to set APP_HOME
  46 +# Resolve links: $0 may be a link
  47 +PRG="$0"
  48 +# Need this for relative symlinks.
  49 +while [ -h "$PRG" ] ; do
  50 + ls=`ls -ld "$PRG"`
  51 + link=`expr "$ls" : '.*-> \(.*\)$'`
  52 + if expr "$link" : '/.*' > /dev/null; then
  53 + PRG="$link"
  54 + else
  55 + PRG=`dirname "$PRG"`"/$link"
  56 + fi
  57 +done
  58 +SAVED="`pwd`"
  59 +cd "`dirname \"$PRG\"`/" >/dev/null
  60 +APP_HOME="`pwd -P`"
  61 +cd "$SAVED" >/dev/null
  62 +
  63 +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
  64 +
  65 +# Determine the Java command to use to start the JVM.
  66 +if [ -n "$JAVA_HOME" ] ; then
  67 + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
  68 + # IBM's JDK on AIX uses strange locations for the executables
  69 + JAVACMD="$JAVA_HOME/jre/sh/java"
  70 + else
  71 + JAVACMD="$JAVA_HOME/bin/java"
  72 + fi
  73 + if [ ! -x "$JAVACMD" ] ; then
  74 + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
  75 +
  76 +Please set the JAVA_HOME variable in your environment to match the
  77 +location of your Java installation."
  78 + fi
  79 +else
  80 + JAVACMD="java"
  81 + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
  82 +
  83 +Please set the JAVA_HOME variable in your environment to match the
  84 +location of your Java installation."
  85 +fi
  86 +
  87 +# Increase the maximum file descriptors if we can.
  88 +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
  89 + MAX_FD_LIMIT=`ulimit -H -n`
  90 + if [ $? -eq 0 ] ; then
  91 + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
  92 + MAX_FD="$MAX_FD_LIMIT"
  93 + fi
  94 + ulimit -n $MAX_FD
  95 + if [ $? -ne 0 ] ; then
  96 + warn "Could not set maximum file descriptor limit: $MAX_FD"
  97 + fi
  98 + else
  99 + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
  100 + fi
  101 +fi
  102 +
  103 +# For Darwin, add options to specify how the application appears in the dock
  104 +if $darwin; then
  105 + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
  106 +fi
  107 +
  108 +# For Cygwin, switch paths to Windows format before running java
  109 +if $cygwin ; then
  110 + APP_HOME=`cygpath --path --mixed "$APP_HOME"`
  111 + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
  112 + JAVACMD=`cygpath --unix "$JAVACMD"`
  113 +
  114 + # We build the pattern for arguments to be converted via cygpath
  115 + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
  116 + SEP=""
  117 + for dir in $ROOTDIRSRAW ; do
  118 + ROOTDIRS="$ROOTDIRS$SEP$dir"
  119 + SEP="|"
  120 + done
  121 + OURCYGPATTERN="(^($ROOTDIRS))"
  122 + # Add a user-defined pattern to the cygpath arguments
  123 + if [ "$GRADLE_CYGPATTERN" != "" ] ; then
  124 + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
  125 + fi
  126 + # Now convert the arguments - kludge to limit ourselves to /bin/sh
  127 + i=0
  128 + for arg in "$@" ; do
  129 + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
  130 + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
  131 +
  132 + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
  133 + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
  134 + else
  135 + eval `echo args$i`="\"$arg\""
  136 + fi
  137 + i=$((i+1))
  138 + done
  139 + case $i in
  140 + (0) set -- ;;
  141 + (1) set -- "$args0" ;;
  142 + (2) set -- "$args0" "$args1" ;;
  143 + (3) set -- "$args0" "$args1" "$args2" ;;
  144 + (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
  145 + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
  146 + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
  147 + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
  148 + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
  149 + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
  150 + esac
  151 +fi
  152 +
  153 +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
  154 +function splitJvmOpts() {
  155 + JVM_OPTS=("$@")
  156 +}
  157 +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
  158 +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
  159 +
  160 +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
... ...
gradlew.bat 0 → 100644
  1 +++ a/gradlew.bat
  1 +@if "%DEBUG%" == "" @echo off
  2 +@rem ##########################################################################
  3 +@rem
  4 +@rem Gradle startup script for Windows
  5 +@rem
  6 +@rem ##########################################################################
  7 +
  8 +@rem Set local scope for the variables with windows NT shell
  9 +if "%OS%"=="Windows_NT" setlocal
  10 +
  11 +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
  12 +set DEFAULT_JVM_OPTS=
  13 +
  14 +set DIRNAME=%~dp0
  15 +if "%DIRNAME%" == "" set DIRNAME=.
  16 +set APP_BASE_NAME=%~n0
  17 +set APP_HOME=%DIRNAME%
  18 +
  19 +@rem Find java.exe
  20 +if defined JAVA_HOME goto findJavaFromJavaHome
  21 +
  22 +set JAVA_EXE=java.exe
  23 +%JAVA_EXE% -version >NUL 2>&1
  24 +if "%ERRORLEVEL%" == "0" goto init
  25 +
  26 +echo.
  27 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
  28 +echo.
  29 +echo Please set the JAVA_HOME variable in your environment to match the
  30 +echo location of your Java installation.
  31 +
  32 +goto fail
  33 +
  34 +:findJavaFromJavaHome
  35 +set JAVA_HOME=%JAVA_HOME:"=%
  36 +set JAVA_EXE=%JAVA_HOME%/bin/java.exe
  37 +
  38 +if exist "%JAVA_EXE%" goto init
  39 +
  40 +echo.
  41 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
  42 +echo.
  43 +echo Please set the JAVA_HOME variable in your environment to match the
  44 +echo location of your Java installation.
  45 +
  46 +goto fail
  47 +
  48 +:init
  49 +@rem Get command-line arguments, handling Windowz variants
  50 +
  51 +if not "%OS%" == "Windows_NT" goto win9xME_args
  52 +if "%@eval[2+2]" == "4" goto 4NT_args
  53 +
  54 +:win9xME_args
  55 +@rem Slurp the command line arguments.
  56 +set CMD_LINE_ARGS=
  57 +set _SKIP=2
  58 +
  59 +:win9xME_args_slurp
  60 +if "x%~1" == "x" goto execute
  61 +
  62 +set CMD_LINE_ARGS=%*
  63 +goto execute
  64 +
  65 +:4NT_args
  66 +@rem Get arguments from the 4NT Shell from JP Software
  67 +set CMD_LINE_ARGS=%$
  68 +
  69 +:execute
  70 +@rem Setup the command line
  71 +
  72 +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
  73 +
  74 +@rem Execute Gradle
  75 +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
  76 +
  77 +:end
  78 +@rem End local scope for the variables with windows NT shell
  79 +if "%ERRORLEVEL%"=="0" goto mainEnd
  80 +
  81 +:fail
  82 +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
  83 +rem the _cmd.exe /c_ return code!
  84 +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
  85 +exit /b 1
  86 +
  87 +:mainEnd
  88 +if "%OS%"=="Windows_NT" endlocal
  89 +
  90 +:omega
... ...
settings.gradle 0 → 100644
  1 +++ a/settings.gradle
  1 +include ':app'
... ...