> directories);
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/base_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/ll_play_video_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/createVideoByVoice/interfaces/IGetVideoDbCallBackListener.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.createVideoByVoice.interfaces;
2 |
3 | /**
4 | * 功能:
5 | *
6 | * @author aserbao
7 | * @date : On 2019/1/8 4:22 PM
8 | * @email: 1142803753@qq.com
9 | * @project:AndroidCamera
10 | * @package:com.aserbao.androidcustomcamera.whole.createVideoByVoice
11 | * @Copyright: 个人版权所有
12 | */
13 | public interface IGetVideoDbCallBackListener {
14 | void cuurentFrequenty(boolean isEnd, double volume, float cuurTime);
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/focusview_show.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_record_camera_open_gl.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/decoder_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/nashville.glsl:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying mediump vec2 textureCoordinate;
4 |
5 | uniform sampler2D inputImageTexture;
6 | uniform sampler2D inputImageTexture2;
7 |
8 | void main()
9 | {
10 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;
11 | texel = vec3(
12 | texture2D(inputImageTexture2, vec2(texel.r, .16666)).r,
13 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g,
14 | texture2D(inputImageTexture2, vec2(texel.b, .83333)).b);
15 | gl_FragColor = vec4(texel, 1.0);
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/createVideoByVoice/interfaces/IEncoderVideoCallBackListener.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.createVideoByVoice.interfaces;
2 |
3 | /**
4 | * 功能:
5 | *
6 | * @author aserbao
7 | * @date : On 2019/1/8 4:23 PM
8 | * @email: 1142803753@qq.com
9 | * @project:AndroidCamera
10 | * @package:com.aserbao.androidcustomcamera.whole.createVideoByVoice.interfaces
11 | * @Copyright: 个人版权所有
12 | */
13 | public interface IEncoderVideoCallBackListener {
14 | void success(String outputMeidaPath, float finalMediaTime);
15 | void failed();
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/n1977.glsl:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying mediump vec2 textureCoordinate;
4 |
5 | uniform sampler2D inputImageTexture;
6 | uniform sampler2D inputImageTexture2;
7 |
8 | void main()
9 | {
10 |
11 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;
12 |
13 | texel = vec3(
14 | texture2D(inputImageTexture2, vec2(texel.r, .16666)).r,
15 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g,
16 | texture2D(inputImageTexture2, vec2(texel.b, .83333)).b);
17 |
18 | gl_FragColor = vec4(texel, 1.0);
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/blocks/mediaCodec/recordCameraOpenGl/RecordCameraOpenGlActivity.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.blocks.mediaCodec.recordCameraOpenGl;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | import com.aserbao.androidcustomcamera.R;
7 |
8 | public class RecordCameraOpenGlActivity extends AppCompatActivity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_record_camera_open_gl);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/createVideoByVoice/frameData/BaseFrameData.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.createVideoByVoice.frameData;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Paint;
5 |
6 | /**
7 | * 功能:基类
8 | * @author aserbao
9 | * @date : On 2019/1/8 5:37 PM
10 | * @email: 1142803753@qq.com
11 | * @project:AndroidCamera
12 | * @package:com.aserbao.androidcustomcamera.whole.createVideoByVoice.frameData
13 | * @Copyright: 个人版权所有
14 | */
15 | public abstract class BaseFrameData {
16 | abstract void onDraw(Canvas canvas,Paint paint,float volume,int hueColor);
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_audio_record.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/jz_dialog_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 | -
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_video_view_player.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_media_codec.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/blocks/ffmpeg/utils/TEst.kt:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.blocks.ffmpeg.utils
2 |
3 | import VideoHandle.OnEditorListener
4 | import android.view.View
5 | import com.aserbao.androidcustomcamera.base.activity.RVBaseActivity
6 |
7 | class TEst : RVBaseActivity(), OnEditorListener {
8 | override fun onSuccess() {}
9 | override fun onFailure() {}
10 | override fun onProgress(progress: Float) {}
11 | override fun initGetData() {}
12 | override fun itemClickBack(view: View, position: Int, isLongClick: Boolean, comeFrom: Int) {}
13 | override fun onPointerCaptureChanged(hasCapture: Boolean) {}
14 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/bigflake_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_blocks.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/ConstantUtils.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.base.utils;
2 |
3 | import com.aserbao.androidcustomcamera.R;
4 |
5 | import java.util.Random;
6 |
7 | /**
8 | * description:
9 | * Created by aserbao on 2018/1/25.
10 | */
11 |
12 |
13 | public class ConstantUtils {
14 |
15 | public static int getDrawable(){
16 | return drawables[new Random().nextInt(drawables.length)];
17 | }
18 | public static int[] drawables = {
19 | R.drawable.emoji_00,
20 | R.drawable.emoji_01,
21 | R.drawable.emoji_02,
22 | R.drawable.emoji_03,
23 | R.drawable.emoji_04,
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_base.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/kevin_new.glsl:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying mediump vec2 textureCoordinate;
4 |
5 | uniform sampler2D inputImageTexture;
6 | uniform sampler2D inputImageTexture2;
7 |
8 | void main()
9 | {
10 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;
11 |
12 | vec2 lookup;
13 | lookup.y = .5;
14 |
15 | lookup.x = texel.r;
16 | texel.r = texture2D(inputImageTexture2, lookup).r;
17 |
18 | lookup.x = texel.g;
19 | texel.g = texture2D(inputImageTexture2, lookup).g;
20 |
21 | lookup.x = texel.b;
22 | texel.b = texture2D(inputImageTexture2, lookup).b;
23 |
24 | gl_FragColor = vec4(texel, 1.0);
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/createVideoByVoice/frameData/FriendListFrame.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.createVideoByVoice.frameData;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Paint;
5 |
6 | /**
7 | * 功能:
8 | *
9 | * @author aserbao
10 | * @date : On 2019/1/8 6:01 PM
11 | * @email: 1142803753@qq.com
12 | * @project:AndroidCamera
13 | * @package:com.aserbao.androidcustomcamera.whole.createVideoByVoice.frameData
14 | * @Copyright: 个人版权所有
15 | */
16 | public class FriendListFrame extends BaseFrameData {
17 |
18 | @Override
19 | void onDraw(Canvas canvas, Paint paint, float volume, int hueColor) {
20 |
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/createVideoByVoice/localEdit/VideoInfo.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.createVideoByVoice.localEdit;
2 |
3 | /**
4 | * Created by Administrator on 2017/6/29 0029.
5 | * 视频的信息bean
6 | */
7 |
8 | public class VideoInfo {
9 | public String path;//路径
10 | public int rotation;//旋转角度
11 | public int width;//宽
12 | public int height;//高
13 | public int bitRate;//比特率
14 | public int frameRate;//帧率
15 | public int frameInterval;//关键帧间隔
16 | public int duration;//时长
17 |
18 | public int expWidth;//期望宽度
19 | public int expHeight;//期望高度
20 | public int cutPoint;//剪切的开始点
21 | public int cutDuration;//剪切的时长
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/FileUtils.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.base.utils;
2 |
3 | import android.os.Environment;
4 |
5 | import java.io.File;
6 |
7 | /**
8 | * description:
9 | * Created by aserbao on 2018/5/14.
10 | */
11 |
12 |
13 | public class FileUtils {
14 |
15 |
16 | public static String getStorageMp4(String s){
17 | File file;
18 | String parent = Environment.getExternalStorageDirectory().getAbsolutePath() + "/aserbao";
19 | File file1 = new File(parent);
20 | if (!file1.exists()) {
21 | file1.mkdir();
22 | }
23 | file = new File(parent, s + ".mp4");
24 |
25 | return file.getPath();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/createVideoByVoice/frameData/BackgroundFrame.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.createVideoByVoice.frameData;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Color;
5 | import android.graphics.Paint;
6 |
7 | /**
8 | * 功能: 背景绘制
9 | * @author aserbao
10 | * @date : On 2019/1/8 5:37 PM
11 | * @email: 1142803753@qq.com
12 | * @project:AndroidCamera
13 | * @package:com.aserbao.androidcustomcamera.whole.createVideoByVoice.frameData
14 | * @Copyright: 个人版权所有
15 | */
16 | public class BackgroundFrame extends BaseFrameData{
17 | @Override
18 | void onDraw(Canvas canvas, Paint paint,float volume,int changeHueColor) {
19 | canvas.drawColor(changeHueColor);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/pop_paster_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/vw_layout_item_folder_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/blocks/ffmpeg/beans/WaterFilter.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.blocks.ffmpeg.beans;
2 |
3 | public class WaterFilter {
4 | String videoPath;
5 | String picturePath;
6 |
7 | public WaterFilter(String videoPath, String picturePath) {
8 | this.videoPath = videoPath;
9 | this.picturePath = picturePath;
10 | }
11 |
12 | public String getVideoPath() {
13 | return videoPath;
14 | }
15 |
16 | public void setVideoPath(String videoPath) {
17 | this.videoPath = videoPath;
18 | }
19 |
20 | public String getPicturePath() {
21 | return picturePath;
22 | }
23 |
24 | public void setPicturePath(String picturePath) {
25 | this.picturePath = picturePath;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/blocks/audioRecord/AudioRecordActivity.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.blocks.audioRecord;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 |
6 | import com.aserbao.androidcustomcamera.R;
7 |
8 | import butterknife.ButterKnife;
9 | import butterknife.OnClick;
10 |
11 | public class AudioRecordActivity extends AppCompatActivity {
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.activity_audio_record);
17 | ButterKnife.bind(this);
18 | }
19 |
20 | @OnClick(R.id.audio_record_btn)
21 | public void onViewClicked() {
22 | new AudioRecordDemo().getNoiseLevel();
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/loading_video_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/pop_phone_tip.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/jiaozivideo/JZUserAction.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.jiaozivideo;
2 |
3 | /**
4 | * Created by Nathen
5 | * On 2016/04/04 22:13
6 | */
7 | public interface JZUserAction {
8 |
9 | int ON_CLICK_START_ICON = 0;
10 | int ON_CLICK_START_ERROR = 1;
11 | int ON_CLICK_START_AUTO_COMPLETE = 2;
12 |
13 | int ON_CLICK_PAUSE = 3;
14 | int ON_CLICK_RESUME = 4;
15 | int ON_SEEK_POSITION = 5;
16 | int ON_AUTO_COMPLETE = 6;
17 |
18 | int ON_ENTER_FULLSCREEN = 7;
19 | int ON_QUIT_FULLSCREEN = 8;
20 | int ON_ENTER_TINYSCREEN = 9;
21 | int ON_QUIT_TINYSCREEN = 10;
22 |
23 |
24 | int ON_TOUCH_SCREEN_SEEK_VOLUME = 11;
25 | int ON_TOUCH_SCREEN_SEEK_POSITION = 12;
26 |
27 | void onEvent(int type, String url, int screen, Object... objects);
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/lomo.glsl:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying mediump vec2 textureCoordinate;
4 |
5 | uniform sampler2D inputImageTexture;
6 | uniform sampler2D inputImageTexture2;
7 | uniform sampler2D inputImageTexture3;
8 |
9 | uniform float strength;
10 |
11 | void main()
12 | {
13 | vec4 originColor = vec4(0.2,0.6,0.9,1.0);
14 |
15 | vec3 texel;
16 | vec2 tc = (2.0 * textureCoordinate) - 1.0;
17 | float d = dot(tc, tc);
18 | vec2 lookup = vec2(d, originColor.r);
19 | texel.r = texture2D(inputImageTexture3, lookup).r;
20 | lookup.y = originColor.g;
21 | texel.g = texture2D(inputImageTexture3, lookup).g;
22 | lookup.y = originColor.b;
23 | texel.b = texture2D(inputImageTexture3, lookup).b;
24 |
25 | texel.rgb = mix(originColor.rgb, texel.rgb, strength);
26 |
27 | gl_FragColor = vec4(texel,1.0);
28 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/blocks/atestcases/TestCaseActivity.kt:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.blocks.atestcases
2 |
3 | import android.support.v7.app.AppCompatActivity
4 | import android.os.Bundle
5 | import android.view.View
6 | import com.aserbao.androidcustomcamera.base.activity.RVBaseActivity
7 | import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean
8 |
9 | /**
10 | * https://android.googlesource.com/platform/cts/+/b04c81bfc2761b21293f9c095da38c757e570fd3/tests/tests/media/src/android/media
11 | */
12 | class TestCaseActivity : RVBaseActivity() {
13 | override fun itemClickBack(view: View?, position: Int, isLongClick: Boolean, comeFrom: Int) {
14 | when(position){
15 | // 0 -> EncodeDecodeTest
16 | }
17 | }
18 | override fun initGetData() {
19 | mBaseRecyclerBeen.add(BaseRecyclerBean("EncodeDecodeTest",0))
20 | }
21 |
22 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/record/filters/NoFilter.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.record.filters;
2 |
3 | import android.content.res.Resources;
4 | import android.opengl.GLES20;
5 |
6 | /**
7 | * Description:
8 | */
9 | public class NoFilter extends AFilter {
10 |
11 | public NoFilter(Resources res) {
12 | super(res);
13 | }
14 |
15 | @Override
16 | protected void onCreate() {
17 | createProgramByAssetsFile("shader/base_vertex.sh",
18 | "shader/base_fragment.sh");
19 | }
20 |
21 | /**
22 | * 背景默认为黑色
23 | */
24 | @Override
25 | protected void onClear() {
26 | GLES20.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
27 | GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
28 | }
29 |
30 | @Override
31 | protected void onSizeChanged(int width, int height) {
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/createVideoByVoice/beans/MapFriend.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.createVideoByVoice.beans;
2 |
3 | import android.graphics.Bitmap;
4 |
5 | /**
6 | * 功能:
7 | *
8 | * @author aserbao
9 | * @date : On 2019/1/8 5:59 PM
10 | * @email: 1142803753@qq.com
11 | * @project:AndroidCamera
12 | * @package:com.aserbao.androidcustomcamera.whole.createVideoByVoice.beans
13 | * @Copyright: 个人版权所有
14 | */
15 | public class MapFriend {
16 | private float screenX;
17 | private float screenY;
18 | private Bitmap friendHeadBitmap;
19 |
20 | /**
21 | * @param screenX
22 | * @param screenY
23 | * @param friendHeadBitmap
24 | */
25 | public MapFriend(float screenX, float screenY, Bitmap friendHeadBitmap) {
26 | this.screenX = screenX;
27 | this.screenY = screenY;
28 | this.friendHeadBitmap = friendHeadBitmap;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/blocks/others/OthersActivity.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.blocks.others;
2 |
3 | import android.view.View;
4 |
5 | import com.aserbao.androidcustomcamera.base.activity.RVBaseActivity;
6 | import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean;
7 | import com.aserbao.androidcustomcamera.blocks.others.changeHue.ChangeHueActivity;
8 | import com.aserbao.androidcustomcamera.blocks.others.changeVoice.ChangeVoiceActivity;
9 |
10 | public class OthersActivity extends RVBaseActivity {
11 |
12 |
13 | @Override
14 | protected void initGetData() {
15 | mBaseRecyclerBeen.add(new BaseRecyclerBean("修改hue", ChangeHueActivity.class));
16 | mBaseRecyclerBeen.add(new BaseRecyclerBean("变声", ChangeVoiceActivity.class));
17 | }
18 |
19 | @Override
20 | public void itemClickBack(View view, int position, boolean isLongClick, int comeFrom) {
21 |
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/utils/VoiceUtils.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.utils;
2 |
3 | /**
4 | * 功能: 变声器
5 | * 参考demo:https://github.com/AndroidHensen/NDKVoice
6 | * @author aserbao
7 | * @date : On 2020-01-14 19:45
8 | * @project:AndroidCamera
9 | * @package:com.aserbao.androidcustomcamera.utils
10 | */
11 | public class VoiceUtils {
12 |
13 | //音效类型
14 | public static final int MODE_NORMAL = 0;
15 | public static final int MODE_LUOLI = 1;
16 | public static final int MODE_DASHU = 2;
17 | public static final int MODE_JINGSONG = 3;
18 | public static final int MODE_GAOGUAI = 4;
19 | public static final int MODE_KONGLING = 5;
20 |
21 |
22 | /**
23 | * 音效处理传2个值
24 | *
25 | * @param path 音频文件路径
26 | * @param type 音频文件类型
27 | */
28 | public native static void fix(String path, int type);
29 |
30 |
31 | static {
32 | System.loadLibrary("sound");
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/rl_current_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
15 |
16 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_welcome.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
14 |
15 |
16 |
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/WholeActivity.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 | import android.view.View;
6 |
7 | import com.aserbao.androidcustomcamera.R;
8 | import com.aserbao.androidcustomcamera.base.activity.RVBaseActivity;
9 | import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean;
10 | import com.aserbao.androidcustomcamera.whole.createVideoByVoice.CreateVideoByAudioDbActivity;
11 | import com.aserbao.androidcustomcamera.whole.record.RecorderActivity;
12 |
13 | import java.util.List;
14 |
15 | public class WholeActivity extends RVBaseActivity {
16 |
17 | @Override
18 | protected void initGetData() {
19 | mBaseRecyclerBeen.add(new BaseRecyclerBean("视频录制这边走", RecorderActivity.class));
20 | }
21 |
22 | @Override
23 | public void itemClickBack(View view, int position, boolean isLongClick, int comeFrom) {
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/record/filters/NoneFilter.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.record.filters;
2 |
3 | import android.content.res.Resources;
4 | import android.opengl.GLES20;
5 |
6 | /**
7 | * description:显示画面的filter
8 | * Created by aserbao on 2018/5/15.
9 | */
10 |
11 |
12 | public class NoneFilter extends BaseFilter{
13 | public NoneFilter(Resources res) {
14 | super(res);
15 | }
16 |
17 | @Override
18 | protected void onCreate() {
19 | createProgramByAssetsFile("shader/base_vertex.sh",
20 | "shader/base_fragment.sh");
21 | }
22 |
23 | /**
24 | * 背景默认为黑色
25 | */
26 | @Override
27 | protected void onClear() {
28 | GLES20.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
29 | GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
30 | }
31 |
32 | @Override
33 | protected void onSizeChanged(int width, int height) {
34 |
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/edit_bar_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/edit_bar_two_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/vw_layout_folder_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/HomeActivity.kt:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera
2 |
3 | import android.view.View
4 | import com.aserbao.androidcustomcamera.base.activity.RVBaseActivity
5 | import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean
6 | import com.aserbao.androidcustomcamera.blocks.BlocksActivity
7 | import com.aserbao.androidcustomcamera.blocks.ffmpeg.FFmpegActivity
8 | import com.aserbao.androidcustomcamera.blocks.others.changeVoice.ChangeVoiceActivity
9 | import com.aserbao.androidcustomcamera.whole.WholeActivity
10 |
11 | class HomeActivity : RVBaseActivity() {
12 | override fun initGetData() {
13 | mBaseRecyclerBeen.add(BaseRecyclerBean("每个功能点单独代码实现", BlocksActivity::class.java))
14 | mBaseRecyclerBeen.add(BaseRecyclerBean("所有功能点整合代码实现", WholeActivity::class.java))
15 | mBaseRecyclerBeen.add(BaseRecyclerBean("当前调用界面", FFmpegActivity::class.java))
16 | }
17 |
18 | override fun itemClickBack(view: View, position: Int, isLongClick: Boolean, comeFrom: Int) {}
19 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/record/filters/OESFilter.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.record.filters;
2 |
3 | import android.content.res.Resources;
4 | import android.opengl.GLES11Ext;
5 | import android.opengl.GLES20;
6 |
7 | /**
8 | * description:
9 | * Created by aserbao on 2018/5/15.
10 | */
11 |
12 |
13 | public class OESFilter extends BaseFilter {
14 |
15 | public OESFilter(Resources mRes) {
16 | super(mRes);
17 | }
18 |
19 | @Override
20 | protected void onCreate() {
21 | createProgramByAssetsFile("shader/oes_base_vertex.sh","shader/oes_base_fragment.sh");
22 | }
23 | @Override
24 | protected void onBindTexture() {
25 | GLES20.glActiveTexture(GLES20.GL_TEXTURE0+getTextureType());
26 | GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,getTextureId());
27 | GLES20.glUniform1i(mHTexture,getTextureType());
28 | }
29 | @Override
30 | protected void onSizeChanged(int width, int height) {
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/editVideo/beans/SelectViewBean.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.editVideo.beans;
2 |
3 | /**
4 | *
5 | * author : Administrator (Jacket)
6 | * e-mail : 378315764@qq.com
7 | * time : 2018/02/10
8 | * desc :
9 | * version: 3.2
10 | *
11 | */
12 |
13 | public class SelectViewBean {
14 | private long timeStamp;
15 | private long startTime;
16 | private long endTime;
17 |
18 | public long getStartTime() {
19 | return startTime;
20 | }
21 |
22 | public void setStartTime(long startTime) {
23 | this.startTime = startTime;
24 | }
25 |
26 | public long getEndTime() {
27 | return endTime;
28 | }
29 |
30 | public void setEndTime(long endTime) {
31 | this.endTime = endTime;
32 | }
33 |
34 | public long getTimeStamp() {
35 | return timeStamp;
36 | }
37 |
38 | public void setTimeStamp(long timeStamp) {
39 | this.timeStamp = timeStamp;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/jz_bottom_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 | -
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | -
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/jz_bottom_seek_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
8 |
9 |
10 | -
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | -
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/record/interfaces/ICamera.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.record.interfaces;
2 |
3 | import android.graphics.Point;
4 | import android.graphics.SurfaceTexture;
5 |
6 | /**
7 | * description:
8 | * Created by aserbao on 2018/5/15.
9 | */
10 |
11 |
12 | public interface ICamera {
13 | /**open the camera*/
14 | void open(int cameraId);
15 |
16 | void setPreviewTexture(SurfaceTexture texture);
17 | /**set the camera config*/
18 | void setConfig(Config config);
19 |
20 | void setOnPreviewFrameCallback(PreviewFrameCallback callback);
21 |
22 | void preview();
23 |
24 | Point getPreviewSize();
25 |
26 | Point getPictureSize();
27 | /**close the camera*/
28 | boolean close();
29 |
30 | class Config{
31 | public float rate=1.778f; //宽高比
32 | public int minPreviewWidth;
33 | public int minPictureWidth;
34 | }
35 |
36 | interface PreviewFrameCallback{
37 | void onPreviewFrame(byte[] bytes, int width, int height);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/rl_edit_content.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/vw_activity_video_pick.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
9 |
15 |
16 |
22 |
23 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_create_video_by_audio_db.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
16 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_media_muxer.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
16 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/record/filters/gpuFilters/utils/TimeFormatUtils.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.record.filters.gpuFilters.utils;
2 |
3 | /**
4 | * Created by Administrator on 2017/6/30 0030.
5 | */
6 |
7 | public class TimeFormatUtils {
8 | /**
9 | * 00:00:00 时分秒
10 | * @param millisec
11 | * @return
12 | */
13 | public static String formatMillisec(int millisec){
14 | int sec=millisec/1000;
15 | int min=sec/60;
16 | int hour=min/60;
17 | min=min%60;
18 | sec=sec%60;
19 | String t="";
20 | t=hour>=10?t+hour:t+"0"+hour+":";
21 | t=min>=10?t+min:t+"0"+min+":";
22 | t=sec>=10?t+sec:t+"0"+sec;
23 | return t;
24 | }
25 |
26 | /**
27 | * 00:00 分秒
28 | * @param millisec
29 | * @return
30 | */
31 | public static String formatMillisecWithoutHours(int millisec){
32 | int sec=millisec/1000;
33 | int min=sec/60;
34 | sec=sec%60;
35 | String t="";
36 | t=min>=10?t+min:t+"0"+min+":";
37 | t=sec>=10?t+sec:t+"0"+sec;
38 | return t;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/record/filters/CameraFilter.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.record.filters;
2 |
3 | import android.content.res.Resources;
4 |
5 | /**
6 | * description:
7 | * Created by aserbao on 2018/5/15.
8 | */
9 |
10 |
11 | public class CameraFilter extends OESFilter {
12 |
13 | public CameraFilter(Resources mRes) {
14 | super(mRes);
15 | }
16 | @Override
17 | public void setFlag(int flag) {
18 | super.setFlag(flag);
19 | float[] coord;
20 | if(getFlag()==1){ //前置摄像头 顺时针旋转90,并上下颠倒
21 | coord=new float[]{
22 | 1.0f, 1.0f,
23 | 0.0f, 1.0f,
24 | 1.0f, 0.0f,
25 | 0.0f, 0.0f,
26 | };
27 | }else{ //后置摄像头 顺时针旋转90度
28 | coord=new float[]{
29 | 0.0f, 1.0f,
30 | 1.0f, 1.0f,
31 | 0.0f, 0.0f,
32 | 1.0f, 0.0f,
33 | };
34 | }
35 | mTexBuffer.clear();
36 | mTexBuffer.put(coord);
37 | mTexBuffer.position(0);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/walden.glsl:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying mediump vec2 textureCoordinate;
4 |
5 | uniform sampler2D inputImageTexture;
6 | uniform sampler2D inputImageTexture2; //map
7 | uniform sampler2D inputImageTexture3; //vigMap
8 |
9 | uniform float strength;
10 |
11 | void main()
12 | {
13 | vec4 originColor = texture2D(inputImageTexture, textureCoordinate);
14 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;
15 |
16 | texel = vec3(
17 | texture2D(inputImageTexture2, vec2(texel.r, .16666)).r,
18 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g,
19 | texture2D(inputImageTexture2, vec2(texel.b, .83333)).b);
20 |
21 | vec2 tc = (2.0 * textureCoordinate) - 1.0;
22 | float d = dot(tc, tc);
23 | vec2 lookup = vec2(d, texel.r);
24 | texel.r = texture2D(inputImageTexture3, lookup).r;
25 | lookup.y = texel.g;
26 | texel.g = texture2D(inputImageTexture3, lookup).g;
27 | lookup.y = texel.b;
28 | texel.b = texture2D(inputImageTexture3, lookup).b;
29 |
30 | texel.rgb = mix(originColor.rgb, texel.rgb, strength);
31 |
32 | gl_FragColor = vec4(texel, 1.0);
33 | }
--------------------------------------------------------------------------------
/app/src/main/res/raw/amaro.glsl:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying mediump vec2 textureCoordinate;
4 |
5 | uniform sampler2D inputImageTexture;
6 | uniform sampler2D inputImageTexture2; //blowout;
7 | uniform sampler2D inputImageTexture3; //overlay;
8 | uniform sampler2D inputImageTexture4; //map
9 |
10 | uniform float strength;
11 |
12 | void main()
13 | {
14 | vec4 originColor = texture2D(inputImageTexture, textureCoordinate);
15 | vec4 texel = texture2D(inputImageTexture, textureCoordinate);
16 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb;
17 |
18 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r;
19 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g;
20 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b;
21 |
22 | vec4 mapped;
23 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r;
24 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g;
25 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b;
26 | mapped.a = 1.0;
27 |
28 | mapped.rgb = mix(originColor.rgb, mapped.rgb, strength);
29 |
30 | gl_FragColor = mapped;
31 | }
--------------------------------------------------------------------------------
/app/src/main/res/raw/rise.glsl:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying mediump vec2 textureCoordinate;
4 |
5 | uniform sampler2D inputImageTexture;
6 | uniform sampler2D inputImageTexture2; //blowout;
7 | uniform sampler2D inputImageTexture3; //overlay;
8 | uniform sampler2D inputImageTexture4; //map
9 |
10 | uniform float strength;
11 |
12 | void main()
13 | {
14 | vec4 originColor = texture2D(inputImageTexture, textureCoordinate);
15 | vec4 texel = texture2D(inputImageTexture, textureCoordinate);
16 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb;
17 |
18 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r;
19 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g;
20 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b;
21 |
22 | vec4 mapped;
23 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r;
24 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g;
25 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b;
26 | mapped.a = 1.0;
27 |
28 | mapped.rgb = mix(originColor.rgb, mapped.rgb, strength);
29 |
30 | gl_FragColor = mapped;
31 | }
--------------------------------------------------------------------------------
/app/src/main/res/raw/sierra.glsl:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying mediump vec2 textureCoordinate;
4 |
5 | uniform sampler2D inputImageTexture;
6 | uniform sampler2D inputImageTexture2; //blowout;
7 | uniform sampler2D inputImageTexture3; //overlay;
8 | uniform sampler2D inputImageTexture4; //map
9 |
10 | uniform float strength;
11 |
12 | void main()
13 | {
14 | vec4 originColor = texture2D(inputImageTexture, textureCoordinate);
15 | vec4 texel = texture2D(inputImageTexture, textureCoordinate);
16 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb;
17 |
18 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r;
19 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g;
20 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b;
21 |
22 | vec4 mapped;
23 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r;
24 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g;
25 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b;
26 | mapped.a = 1.0;
27 |
28 | mapped.rgb = mix(originColor.rgb, mapped.rgb, strength);
29 | gl_FragColor = mapped;
30 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/base_recycler_view_text_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_change_hue.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
14 |
22 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_primary_media_codec.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
21 |
22 |
23 |
26 |
27 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/hudson.glsl:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying mediump vec2 textureCoordinate;
4 |
5 | uniform sampler2D inputImageTexture;
6 | uniform sampler2D inputImageTexture2; //blowout;
7 | uniform sampler2D inputImageTexture3; //overlay;
8 | uniform sampler2D inputImageTexture4; //map
9 |
10 | uniform float strength;
11 |
12 | void main()
13 | {
14 | vec4 originColor = texture2D(inputImageTexture, textureCoordinate);
15 |
16 | vec4 texel = texture2D(inputImageTexture, textureCoordinate);
17 |
18 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb;
19 |
20 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r;
21 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g;
22 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b;
23 |
24 | vec4 mapped;
25 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r;
26 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g;
27 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b;
28 | mapped.a = 1.0;
29 |
30 | mapped.rgb = mix(originColor.rgb, mapped.rgb, strength);
31 |
32 | gl_FragColor = mapped;
33 | }
--------------------------------------------------------------------------------
/app/src/main/res/raw/sketch.glsl:
--------------------------------------------------------------------------------
1 | varying highp vec2 textureCoordinate;
2 | precision mediump float;
3 |
4 | uniform sampler2D inputImageTexture;
5 | uniform vec2 singleStepOffset;
6 | uniform float strength;
7 |
8 | const highp vec3 W = vec3(0.299,0.587,0.114);
9 |
10 |
11 | void main()
12 | {
13 | float threshold = 0.0;
14 | //pic1
15 | vec4 oralColor = texture2D(inputImageTexture, textureCoordinate);
16 |
17 | //pic2
18 | vec3 maxValue = vec3(0.,0.,0.);
19 |
20 | for(int i = -2; i<=2; i++)
21 | {
22 | for(int j = -2; j<=2; j++)
23 | {
24 | vec4 tempColor = texture2D(inputImageTexture, textureCoordinate+singleStepOffset*vec2(i,j));
25 | maxValue.r = max(maxValue.r,tempColor.r);
26 | maxValue.g = max(maxValue.g,tempColor.g);
27 | maxValue.b = max(maxValue.b,tempColor.b);
28 | threshold += dot(tempColor.rgb, W);
29 | }
30 | }
31 | //pic3
32 | float gray1 = dot(oralColor.rgb, W);
33 |
34 | //pic4
35 | float gray2 = dot(maxValue, W);
36 |
37 | //pic5
38 | float contour = gray1 / gray2;
39 |
40 | threshold = threshold / 25.;
41 | float alpha = max(1.0,gray1>threshold?1.0:(gray1/threshold));
42 |
43 | float result = contour * alpha + (1.0-alpha)*gray1;
44 |
45 | gl_FragColor = vec4(vec3(result,result,result), oralColor.w);
46 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/editVideo/view/StickInfoImageView.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.editVideo.view;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.Nullable;
5 | import android.util.AttributeSet;
6 | import android.widget.ImageView;
7 |
8 | /**
9 | * Created by msi- on 2018/2/7.
10 | */
11 |
12 | public class StickInfoImageView extends ImageView {
13 | private long startTime;
14 | private long endTime;
15 |
16 |
17 |
18 | public StickInfoImageView(Context context) {
19 | super(context);
20 | }
21 |
22 | public StickInfoImageView(Context context, @Nullable AttributeSet attrs) {
23 | super(context, attrs);
24 | }
25 |
26 | public StickInfoImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
27 | super(context, attrs, defStyleAttr);
28 | }
29 |
30 |
31 | public long getStartTime() {
32 | return startTime;
33 | }
34 |
35 | public void setStartTime(long startTime) {
36 | this.startTime = startTime;
37 | }
38 |
39 | public long getEndTime() {
40 | return endTime;
41 | }
42 |
43 | public void setEndTime(long endTime) {
44 | this.endTime = endTime;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/xproii_filter_shader.glsl:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying mediump vec2 textureCoordinate;
4 |
5 | uniform sampler2D inputImageTexture;
6 | uniform sampler2D inputImageTexture2; //map
7 | uniform sampler2D inputImageTexture3; //vigMap
8 |
9 | uniform float strength;
10 |
11 | void main()
12 | {
13 | vec4 originColor = texture2D(inputImageTexture, textureCoordinate);
14 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;
15 |
16 | vec2 tc = (2.0 * textureCoordinate) - 1.0;
17 | float d = dot(tc, tc);
18 | vec2 lookup = vec2(d, texel.r);
19 | texel.r = texture2D(inputImageTexture3, lookup).r;
20 | lookup.y = texel.g;
21 | texel.g = texture2D(inputImageTexture3, lookup).g;
22 | lookup.y = texel.b;
23 | texel.b = texture2D(inputImageTexture3, lookup).b;
24 |
25 | vec2 red = vec2(texel.r, 0.16666);
26 | vec2 green = vec2(texel.g, 0.5);
27 | vec2 blue = vec2(texel.b, .83333);
28 | texel.r = texture2D(inputImageTexture2, red).r;
29 | texel.g = texture2D(inputImageTexture2, green).g;
30 | texel.b = texture2D(inputImageTexture2, blue).b;
31 |
32 | texel.rgb = mix(originColor.rgb, texel.rgb, strength);
33 |
34 | gl_FragColor = vec4(texel, 1.0);
35 |
36 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/base/activity/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.base.activity;
2 |
3 | import android.Manifest;
4 | import android.os.Bundle;
5 | import android.os.PersistableBundle;
6 | import android.support.annotation.Nullable;
7 | import android.support.v4.app.ActivityCompat;
8 | import android.support.v7.app.AppCompatActivity;
9 |
10 | import butterknife.ButterKnife;
11 |
12 | /**
13 | * description:
14 | * Created by aserbao on 2018/5/5.
15 | */
16 |
17 |
18 | public abstract class BaseActivity extends AppCompatActivity {
19 | private final String[] BASIC_PERMISSIONS = new String[]{
20 | Manifest.permission.WRITE_EXTERNAL_STORAGE,
21 | Manifest.permission.CAMERA,
22 | Manifest.permission.RECORD_AUDIO,
23 | };
24 | @Override
25 | public void onCreate(Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | setContentView(setLayoutId());
28 | ButterKnife.bind(this);
29 | startRequestPermission();
30 | initView();
31 | }
32 |
33 | protected void startRequestPermission() {
34 | ActivityCompat.requestPermissions(this,BASIC_PERMISSIONS,123);
35 | }
36 | public void initView(){
37 |
38 | }
39 | protected abstract int setLayoutId();
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_record_camera.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
13 |
18 |
23 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_record_base_camera.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
13 |
14 |
19 |
24 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/videoPlayer/view/CustomVideoView.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.videoPlayer.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.VideoView;
6 |
7 | /**
8 | * date:2017/2/14
9 | * des:自定义VideoView,切换横屏时可以全屏播放
10 | * Create by suqi
11 | */
12 |
13 | public class CustomVideoView extends VideoView {
14 |
15 | private int defaultWidth;
16 | private int defaultHeight;
17 |
18 | public CustomVideoView(Context context) {
19 | this(context, null);
20 | }
21 |
22 | public CustomVideoView(Context context, AttributeSet attrs) {
23 | this(context, attrs, 0);
24 | }
25 |
26 | public CustomVideoView(Context context, AttributeSet attrs, int defStyleAttr) {
27 | super(context, attrs, defStyleAttr);
28 | defaultWidth = context.getResources().getDisplayMetrics().widthPixels;
29 | defaultHeight = context.getResources().getDisplayMetrics().heightPixels;
30 | }
31 |
32 | @Override
33 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
34 | int width = getDefaultSize(defaultWidth, widthMeasureSpec);
35 | int height = getDefaultSize(defaultHeight, heightMeasureSpec);
36 | setMeasuredDimension(width, height);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/base/viewHolder/TextViewHolder.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.base.viewHolder;
2 |
3 | import android.view.View;
4 | import android.widget.TextView;
5 |
6 | import com.aserbao.androidcustomcamera.R;
7 | import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean;
8 |
9 | import butterknife.BindView;
10 | import butterknife.ButterKnife;
11 |
12 | public class TextViewHolder extends BaseClickViewHolder {
13 | @BindView(R.id.base_recycler_view_item_tv)
14 | public TextView mBaseRecyclerViewItemTv;
15 |
16 | public TextViewHolder(View itemView) {
17 | super(itemView);
18 | ButterKnife.bind(this, itemView);
19 | }
20 |
21 | public void setDataSource(BaseRecyclerBean classBean, int position, IBaseRecyclerItemClickListener mIBaseRecyclerItemClickListener){
22 | super.setDataSource(position,mIBaseRecyclerItemClickListener);
23 | int tag = classBean.getTag();
24 | String name = classBean.getName();
25 | if (tag >= 0) {
26 | itemView.setTag(tag);
27 | name = name + String.valueOf(tag);
28 | } else {
29 | name = name + String.valueOf(position);
30 | }
31 | mBaseRecyclerViewItemTv.setText(name);
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/createVideoByVoice/frameData/MapFrame.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.createVideoByVoice.frameData;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.Canvas;
5 | import android.graphics.Paint;
6 | import android.graphics.Rect;
7 |
8 | /**
9 | * 功能:地图
10 | *
11 | * @author aserbao
12 | * @date : On 2019/1/8 5:56 PM
13 | * @email: 1142803753@qq.com
14 | * @project:AndroidCamera
15 | * @package:com.aserbao.androidcustomcamera.whole.createVideoByVoice.frameData
16 | * @Copyright: 个人版权所有
17 | */
18 | public class MapFrame extends BaseFrameData {
19 | private int margainTop = 20;
20 | private int margainLefAndRight = 30;
21 | private int margainBottom = 100;
22 |
23 | private Bitmap mMapBitmap;
24 |
25 | public MapFrame(Bitmap bitmapMap) {
26 | this.mMapBitmap = bitmapMap;
27 | }
28 | @Override
29 | void onDraw(Canvas canvas, Paint paint, float volume, int hueColor) {
30 | int width = canvas.getWidth();
31 | int height = canvas.getHeight();
32 | Rect srcRect = new Rect(0, 0, mMapBitmap.getWidth(), mMapBitmap.getHeight());
33 | Rect decRect = new Rect(margainLefAndRight, margainTop, width - margainLefAndRight, height-margainBottom);
34 | canvas.drawBitmap(mMapBitmap,srcRect,decRect,paint);
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_mp3_translate_aac.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
17 |
22 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/videoPlayer/view/FullScreenVideoView.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.videoPlayer.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 | import android.widget.VideoView;
7 |
8 | /**
9 | * Created by Administrator on 2017/9/13.
10 | */
11 |
12 | public class FullScreenVideoView extends VideoView {
13 | public FullScreenVideoView(Context context, AttributeSet attrs, int defStyle) {
14 | super(context, attrs, defStyle);
15 | }
16 |
17 | public FullScreenVideoView(Context context, AttributeSet attrs) {
18 | super(context, attrs);
19 | }
20 |
21 | public FullScreenVideoView(Context context) {
22 | super(context);
23 | }
24 |
25 | @Override
26 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {//这里重写onMeasure的方法
27 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
28 | int width = getDefaultSize(0, widthMeasureSpec);//得到默认的大小(0,宽度测量规范)
29 | int height = getDefaultSize(0, heightMeasureSpec);//得到默认的大小(0,高度度测量规范)
30 | setMeasuredDimension(width, height); //设置测量尺寸,将高和宽放进去
31 | }
32 |
33 | @Override
34 | public boolean onTouchEvent(MotionEvent ev) { //不执行父类的toggleMediaControlsVisiblity();方法 弹出默认进度条
35 | return true;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/crayon.glsl:
--------------------------------------------------------------------------------
1 | varying highp vec2 textureCoordinate;
2 | precision mediump float;
3 |
4 | uniform sampler2D inputImageTexture;
5 | uniform vec2 singleStepOffset;
6 | uniform float strength;
7 |
8 | const highp vec3 W = vec3(0.299,0.587,0.114);
9 |
10 | const mat3 rgb2yiqMatrix = mat3(
11 | 0.299, 0.587, 0.114,
12 | 0.596,-0.275,-0.321,
13 | 0.212,-0.523, 0.311);
14 |
15 | const mat3 yiq2rgbMatrix = mat3(
16 | 1.0, 0.956, 0.621,
17 | 1.0,-0.272,-1.703,
18 | 1.0,-1.106, 0.0);
19 |
20 |
21 | void main()
22 | {
23 | vec4 oralColor = texture2D(inputImageTexture, textureCoordinate);
24 |
25 | vec3 maxValue = vec3(0.,0.,0.);
26 |
27 | for(int i = -2; i<=2; i++)
28 | {
29 | for(int j = -2; j<=2; j++)
30 | {
31 | vec4 tempColor = texture2D(inputImageTexture, textureCoordinate+singleStepOffset*vec2(i,j));
32 | maxValue.r = max(maxValue.r,tempColor.r);
33 | maxValue.g = max(maxValue.g,tempColor.g);
34 | maxValue.b = max(maxValue.b,tempColor.b);
35 | }
36 | }
37 |
38 | vec3 textureColor = oralColor.rgb / maxValue;
39 |
40 | float gray = dot(textureColor, W);
41 | float k = 0.223529;
42 | float alpha = min(gray,k)/k;
43 |
44 | textureColor = textureColor * alpha + (1.-alpha)*oralColor.rgb;
45 |
46 | vec3 yiqColor = textureColor * rgb2yiqMatrix;
47 |
48 | yiqColor.r = max(0.0,min(1.0,pow(gray,strength)));
49 |
50 | textureColor = yiqColor * yiq2rgbMatrix;
51 |
52 | gl_FragColor = vec4(textureColor, oralColor.w);
53 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_media_codec_show_on_gl_surface_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
12 |
15 |
20 |
25 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/jiaozivideo/JZVideoPlayerManager.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.jiaozivideo;
2 |
3 | /**
4 | * Put JZVideoPlayer into layout
5 | * From a JZVideoPlayer to another JZVideoPlayer
6 | * Created by Nathen on 16/7/26.
7 | */
8 | public class JZVideoPlayerManager {
9 |
10 | public static JZVideoPlayer FIRST_FLOOR_JZVD;
11 | public static JZVideoPlayer SECOND_FLOOR_JZVD;
12 |
13 | public static JZVideoPlayer getFirstFloor() {
14 | return FIRST_FLOOR_JZVD;
15 | }
16 |
17 | public static void setFirstFloor(JZVideoPlayer jzVideoPlayer) {
18 | FIRST_FLOOR_JZVD = jzVideoPlayer;
19 | }
20 |
21 | public static JZVideoPlayer getSecondFloor() {
22 | return SECOND_FLOOR_JZVD;
23 | }
24 |
25 | public static void setSecondFloor(JZVideoPlayer jzVideoPlayer) {
26 | SECOND_FLOOR_JZVD = jzVideoPlayer;
27 | }
28 |
29 | public static JZVideoPlayer getCurrentJzvd() {
30 | if (getSecondFloor() != null) {
31 | return getSecondFloor();
32 | }
33 | return getFirstFloor();
34 | }
35 |
36 | public static void completeAll() {
37 | if (SECOND_FLOOR_JZVD != null) {
38 | SECOND_FLOOR_JZVD.onCompletion();
39 | SECOND_FLOOR_JZVD = null;
40 | }
41 | if (FIRST_FLOOR_JZVD != null) {
42 | FIRST_FLOOR_JZVD.onCompletion();
43 | FIRST_FLOOR_JZVD = null;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/base/utils/APermissionUtils.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.base.utils;
2 |
3 | import android.Manifest;
4 | import android.app.Activity;
5 | import android.content.pm.PackageManager;
6 | import android.support.v4.app.ActivityCompat;
7 | import android.support.v4.content.ContextCompat;
8 | import android.util.Log;
9 |
10 | /**
11 | * 功能:
12 | *
13 | * @author aserbao
14 | * @date : On 2019/1/4 5:37 PM
15 | * @email: 1142803753@qq.com
16 | * @project:AndroidCamera
17 | * @package:com.aserbao.androidcustomcamera.base.utils
18 | * @Copyright: 个人版权所有
19 | */
20 | public class APermissionUtils {
21 |
22 | public static final String[] BASIC_PERMISSIONS = new String[]{
23 | Manifest.permission.WRITE_EXTERNAL_STORAGE,
24 | Manifest.permission.CAMERA,
25 | Manifest.permission.RECORD_AUDIO,
26 | };
27 |
28 | /**
29 | * 检测权限
30 | * @param activity
31 | */
32 | public static void checkPermission(Activity activity) {
33 | ActivityCompat.requestPermissions(activity, BASIC_PERMISSIONS, 1);
34 | // TODO: 2019/1/4 之后再完善权限请求
35 | /*for (String basicPermission : BASIC_PERMISSIONS) {
36 | Log.e("wer", "checkPermission: " );
37 | if (ContextCompat.checkSelfPermission(activity, basicPermission) != PackageManager.PERMISSION_GRANTED) {
38 | ActivityCompat.requestPermissions(activity, new String[]{basicPermission}, 1);
39 | }
40 | }*/
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/base/adapter/CommonViewHolder.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.base.adapter;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.support.v7.widget.RecyclerView;
6 | import android.view.View;
7 | import android.widget.Button;
8 |
9 | import com.aserbao.androidcustomcamera.R;
10 | import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean;
11 |
12 | import butterknife.BindView;
13 | import butterknife.ButterKnife;
14 |
15 | /**
16 | * 功能:
17 | *
18 | * @author aserbao
19 | * @date : On 2020-01-15 17:32
20 | * @project:AndroidCamera
21 | * @package:com.aserbao.androidcustomcamera.base.adapter
22 | */
23 | public class CommonViewHolder extends RecyclerView.ViewHolder {
24 | @BindView(R.id.btn_item_common)
25 | Button mBtnItemCommon;
26 | private Activity mActivity;
27 | private BaseRecyclerBean mClassBean;
28 | public CommonViewHolder(View itemView) {
29 | super(itemView);
30 | ButterKnife.bind(this, itemView);
31 | }
32 |
33 | public void setDataSource(BaseRecyclerBean classBean,Activity activity){
34 | mActivity = activity;
35 | mClassBean = classBean;
36 | mBtnItemCommon.setText(classBean.getName());
37 | mBtnItemCommon.setOnClickListener(new View.OnClickListener() {
38 | @Override
39 | public void onClick(View v) {
40 | mActivity.startActivity(new Intent(mActivity, mClassBean.getClazz()));
41 | }
42 | });
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/cpp/com_aserbao_androidcustomcamera_utils_VoiceUtils.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class com_aserbao_androidcustomcamera_utils_VoiceUtils */
4 |
5 | #ifndef _Included_com_aserbao_androidcustomcamera_utils_VoiceUtils
6 | #define _Included_com_aserbao_androidcustomcamera_utils_VoiceUtils
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | #undef com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_NORMAL
11 | #define com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_NORMAL 0L
12 | #undef com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_LUOLI
13 | #define com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_LUOLI 1L
14 | #undef com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_DASHU
15 | #define com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_DASHU 2L
16 | #undef com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_JINGSONG
17 | #define com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_JINGSONG 3L
18 | #undef com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_GAOGUAI
19 | #define com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_GAOGUAI 4L
20 | #undef com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_KONGLING
21 | #define com_aserbao_androidcustomcamera_utils_VoiceUtils_MODE_KONGLING 5L
22 |
23 | /*
24 | * Class: com_aserbao_androidcustomcamera_utils_VoiceUtils
25 | * Method: fix
26 | * Signature: (Ljava/lang/String;I)V
27 | */
28 | JNIEXPORT void JNICALL Java_com_aserbao_androidcustomcamera_utils_VoiceUtils_fix
29 | (JNIEnv *, jclass, jstring, jint);
30 |
31 | #ifdef __cplusplus
32 | }
33 | #endif
34 | #endif
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/base/MyApplication.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.base;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import android.util.DisplayMetrics;
6 |
7 | import com.danikula.videocache.HttpProxyCacheServer;
8 |
9 | /**
10 | * description:
11 | * Created by aserbao on 2018/5/15.
12 | */
13 |
14 |
15 | public class MyApplication extends Application {
16 | public static boolean DEBUG = true;
17 | private static Context mContext;
18 | public static int screenWidth;
19 | public static int screenHeight;
20 | @Override
21 | public void onCreate() {
22 | super.onCreate();
23 | mContext = this;
24 | DisplayMetrics mDisplayMetrics = getApplicationContext().getResources()
25 | .getDisplayMetrics();
26 | screenWidth = mDisplayMetrics.widthPixels;
27 | screenHeight = mDisplayMetrics.heightPixels;
28 | app = this;
29 | }
30 |
31 | public static Context getContext() {
32 | return mContext;
33 | }
34 |
35 | public static MyApplication app;
36 | public static MyApplication getInstance() {
37 | return app;
38 | }
39 |
40 | //=====================================================缓存区
41 | private HttpProxyCacheServer proxy;
42 |
43 | public static HttpProxyCacheServer getProxy() {
44 | MyApplication app = getInstance();
45 | return app.proxy == null ? (app.proxy = app.newProxy()) : app.proxy;
46 | }
47 |
48 | private HttpProxyCacheServer newProxy() {
49 | return new HttpProxyCacheServer(this);
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/suger_tablets.glsl:
--------------------------------------------------------------------------------
1 | varying mediump vec2 textureCoordinate;
2 | varying mediump vec2 textureCoordinate2; // TODO: This is not used
3 |
4 | uniform sampler2D inputImageTexture;
5 | uniform sampler2D inputImageTexture2; // lookup texture
6 | uniform mediump float strength;
7 |
8 | void main()
9 | {
10 | mediump vec4 originColor = texture2D(inputImageTexture, textureCoordinate);
11 | mediump vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);
12 |
13 | mediump float blueColor = textureColor.b * 63.0;
14 |
15 | mediump vec2 quad1;
16 | quad1.y = floor(floor(blueColor) / 8.0);
17 | quad1.x = floor(blueColor) - (quad1.y * 8.0);
18 |
19 | mediump vec2 quad2;
20 | quad2.y = floor(ceil(blueColor) / 8.0);
21 | quad2.x = ceil(blueColor) - (quad2.y * 8.0);
22 |
23 | mediump vec2 texPos1;
24 | texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.r);
25 | texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.g);
26 |
27 | mediump vec2 texPos2;
28 | texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.r);
29 | texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.g);
30 |
31 | mediump vec4 newColor1 = texture2D(inputImageTexture2, texPos1);
32 | mediump vec4 newColor2 = texture2D(inputImageTexture2, texPos2);
33 |
34 | mediump vec4 newColor = mix(newColor1, newColor2, fract(blueColor));
35 |
36 | newColor.rgb = mix(originColor.rgb, newColor.rgb, strength);
37 |
38 | gl_FragColor = vec4(newColor.rgb, textureColor.w);
39 | }
--------------------------------------------------------------------------------
/app/src/main/res/raw/valencia.glsl:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying mediump vec2 textureCoordinate;
4 |
5 | uniform sampler2D inputImageTexture;
6 | uniform sampler2D inputImageTexture2; //map
7 | uniform sampler2D inputImageTexture3; //gradMap
8 |
9 | mat3 saturateMatrix = mat3(
10 | 1.1402,
11 | -0.0598,
12 | -0.061,
13 | -0.1174,
14 | 1.0826,
15 | -0.1186,
16 | -0.0228,
17 | -0.0228,
18 | 1.1772);
19 |
20 | vec3 lumaCoeffs = vec3(.3, .59, .11);
21 |
22 | uniform float strength;
23 |
24 | void main()
25 | {
26 | vec4 originColor = texture2D(inputImageTexture, textureCoordinate);
27 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;
28 |
29 | texel = vec3(
30 | texture2D(inputImageTexture2, vec2(texel.r, .1666666)).r,
31 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g,
32 | texture2D(inputImageTexture2, vec2(texel.b, .8333333)).b
33 | );
34 |
35 | texel = saturateMatrix * texel;
36 | float luma = dot(lumaCoeffs, texel);
37 | texel = vec3(
38 | texture2D(inputImageTexture3, vec2(luma, texel.r)).r,
39 | texture2D(inputImageTexture3, vec2(luma, texel.g)).g,
40 | texture2D(inputImageTexture3, vec2(luma, texel.b)).b);
41 |
42 | texel.rgb = mix(originColor.rgb, texel.rgb, strength);
43 | gl_FragColor = vec4(texel, 1.0);
44 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/pop_window_beauty_level.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
15 |
21 |
25 |
29 |
33 |
37 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/romance.glsl:
--------------------------------------------------------------------------------
1 | varying highp vec2 textureCoordinate;
2 | precision highp float;
3 |
4 | uniform sampler2D inputImageTexture;
5 | uniform sampler2D curve;
6 |
7 | void main()
8 | {
9 | lowp vec4 textureColor;
10 | lowp vec4 textureColorRes;
11 | lowp vec4 textureColorOri;
12 | vec4 grey1Color;
13 | vec4 layerColor;
14 | mediump float satVal = 115.0 / 100.0;
15 |
16 | float xCoordinate = textureCoordinate.x;
17 | float yCoordinate = textureCoordinate.y;
18 |
19 | highp float redCurveValue;
20 | highp float greenCurveValue;
21 | highp float blueCurveValue;
22 |
23 | textureColor = texture2D( inputImageTexture, vec2(xCoordinate, yCoordinate));
24 | textureColorRes = textureColor;
25 | textureColorOri = textureColor;
26 |
27 | // step1. screen blending
28 | textureColor = 1.0 - ((1.0 - textureColorOri) * (1.0 - textureColorOri));
29 | textureColor = (textureColor - textureColorOri) + textureColorOri;
30 |
31 | // step2. curve
32 | redCurveValue = texture2D(curve, vec2(textureColor.r, 0.0)).r;
33 | greenCurveValue = texture2D(curve, vec2(textureColor.g, 0.0)).g;
34 | blueCurveValue = texture2D(curve, vec2(textureColor.b, 0.0)).b;
35 |
36 | // step3. saturation
37 | highp float G = (redCurveValue + greenCurveValue + blueCurveValue);
38 | G = G / 3.0;
39 |
40 | redCurveValue = ((1.0 - satVal) * G + satVal * redCurveValue);
41 | greenCurveValue = ((1.0 - satVal) * G + satVal * greenCurveValue);
42 | blueCurveValue = ((1.0 - satVal) * G + satVal * blueCurveValue);
43 |
44 | textureColor = vec4(redCurveValue, greenCurveValue, blueCurveValue, 1.0);
45 |
46 | gl_FragColor = vec4(textureColor.r, textureColor.g, textureColor.b, 1.0);
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_video_player.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
13 |
14 |
23 |
24 |
32 |
33 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/createVideoByVoice/MuxerVoiceAndVideo.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.createVideoByVoice;
2 |
3 | import com.aserbao.androidcustomcamera.whole.createVideoByVoice.interfaces.IEncoderVideoCallBackListener;
4 | import com.aserbao.androidcustomcamera.whole.createVideoByVoice.interfaces.IMuxerVideoCallBackListener;
5 |
6 | import VideoHandle.EpEditor;
7 | import VideoHandle.OnEditorListener;
8 |
9 | /**
10 | * 功能:
11 | *
12 | * @author aserbao
13 | * @date : On 2019/1/8 4:25 PM
14 | * @email: 1142803753@qq.com
15 | * @project:AndroidCamera
16 | * @package:com.aserbao.androidcustomcamera.whole.createVideoByVoice
17 | * @Copyright: 个人版权所有
18 | */
19 | public class MuxerVoiceAndVideo {
20 | private IMuxerVideoCallBackListener mIMuxerVideoCallBackListener;
21 |
22 | public MuxerVoiceAndVideo(IMuxerVideoCallBackListener iMuxerVideoCallBackListener) {
23 | mIMuxerVideoCallBackListener = iMuxerVideoCallBackListener;
24 | }
25 |
26 | public void startMuxer(String inputVideoPath, String inputMusicPath, float musicTime, String outputVideoPath){
27 | String cmd = "-y -i "+ inputVideoPath + " -ss 0 -t "+ musicTime + " -i "+ inputMusicPath + " -acodec copy -vcodec copy "+ outputVideoPath;
28 | EpEditor.execCmd(cmd, 10000,new OnEditorListener() {
29 | @Override
30 | public void onSuccess() {
31 | mIMuxerVideoCallBackListener.success();
32 | }
33 |
34 | @Override
35 | public void onFailure() {
36 | mIMuxerVideoCallBackListener.failed();
37 | }
38 |
39 | @Override
40 | public void onProgress(float v) {
41 | }
42 | });
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
8 |
9 | //全局的配置 颜色对照表:http://tool.oschina.net/commons?type=3
10 | @color/white
11 | #00000000
12 | //基色
13 | #FF0000
14 | #00FF00
15 | #0000FF
16 | //白色
17 | #ffffff
18 | #1AFFFFFF
19 | #3effffff
20 | #4bffffff
21 | #66ffffff
22 | #7FFFFFFF
23 | #96ffffff
24 | #B3ffffff
25 | #CCFFFFFF
26 | #E3FFFFFF
27 | //黑色
28 | #000000
29 | #1A000000
30 | #3e000000
31 | #4b000000
32 | #66000000
33 | #7F000000
34 | #96000000
35 | #B3000000
36 | #CC000000
37 | #E3000000
38 |
39 | //灰色
40 | #BEBEBE
41 |
42 | #7f808080
43 | #454545
44 | #FAE000
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/pickvideo/loader/FileLoader.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.pickvideo.loader;
2 |
3 | import android.content.Context;
4 | import android.net.Uri;
5 | import android.provider.MediaStore;
6 | import android.support.v4.content.CursorLoader;
7 |
8 | /**
9 | * Created by Vincent Woo
10 | * Date: 2016/10/12
11 | * Time: 14:48
12 | */
13 |
14 | public class FileLoader extends CursorLoader {
15 | private static final String[] FILE_PROJECTION = {
16 | //Base File
17 | MediaStore.Files.FileColumns._ID,
18 | MediaStore.Files.FileColumns.TITLE,
19 | MediaStore.Files.FileColumns.DATA,
20 | MediaStore.Files.FileColumns.SIZE,
21 | MediaStore.Files.FileColumns.DATE_ADDED,
22 |
23 | //Normal File
24 | MediaStore.Files.FileColumns.MIME_TYPE
25 | };
26 |
27 | private FileLoader(Context context, Uri uri, String[] projection, String selection,
28 | String[] selectionArgs, String sortOrder) {
29 | super(context, uri, projection, selection, selectionArgs, sortOrder);
30 | }
31 |
32 | public FileLoader(Context context) {
33 | super(context);
34 | setProjection(FILE_PROJECTION);
35 | setUri(MediaStore.Files.getContentUri("external"));
36 | setSortOrder(MediaStore.Files.FileColumns.DATE_ADDED + " DESC");
37 |
38 | // setSelection(MIME_TYPE + "=? or "
39 | //// + MIME_TYPE + "=? or "
40 | //// + MIME_TYPE + "=? or "
41 | // + MIME_TYPE + "=?");
42 | //
43 | // String[] selectionArgs;
44 | // selectionArgs = new String[] { "text/txt", "text/plain" };
45 | // setSelectionArgs(selectionArgs);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/videoPlayer/VideoViewPlayerActivity.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.videoPlayer;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.text.TextUtils;
6 | import android.widget.Toast;
7 | import android.widget.VideoView;
8 |
9 | import com.aserbao.androidcustomcamera.R;
10 | import com.aserbao.androidcustomcamera.base.activity.BaseActivity;
11 |
12 | import butterknife.BindView;
13 |
14 | import static com.aserbao.androidcustomcamera.blocks.mediaCodec.recordCamera.utils.FileUtils.VIDEO_PATH;
15 |
16 | public class VideoViewPlayerActivity extends BaseActivity {
17 |
18 |
19 | @BindView(R.id.video_player_vv)
20 | VideoView mVideoPlayerVv;
21 |
22 | @Override
23 | protected int setLayoutId() {
24 | return R.layout.activity_video_view_player;
25 | }
26 |
27 | @Override
28 | protected void onPause() {
29 | super.onPause();
30 | }
31 |
32 | @Override
33 | protected void onDestroy() {
34 | super.onDestroy();
35 | mVideoPlayerVv.resume();
36 | mVideoPlayerVv = null;
37 | }
38 |
39 | public void initView(){
40 | String stringExtra = getIntent().getStringExtra(VIDEO_PATH);
41 | if (TextUtils.isEmpty(stringExtra)) {
42 | Toast.makeText(this, "文本路径错误", Toast.LENGTH_SHORT).show();
43 | }else {
44 | mVideoPlayerVv.setVideoPath(stringExtra);
45 | mVideoPlayerVv.start();
46 | }
47 | }
48 |
49 | public static void launch(Activity activity, String videoPath) {
50 | Intent intent = new Intent(activity, VideoViewPlayerActivity.class);
51 | intent.putExtra(VIDEO_PATH, videoPath);
52 | activity.startActivity(intent);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/base/beans/BaseRecyclerBean.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.base.beans;
2 |
3 | import com.aserbao.androidcustomcamera.base.utils.StaticFinalValues;
4 |
5 | /**
6 | * description:
7 | * Created by aserbao on 2018/1/25.
8 | */
9 |
10 |
11 | public class BaseRecyclerBean {
12 | private String name;
13 | String extra_info; //补充信息
14 | int tag = -1; //标记
15 | private Class> clazz;
16 | int viewType = StaticFinalValues.VIEW_HOLDER_TEXT;
17 |
18 | public BaseRecyclerBean(String name, int tag) {
19 | this.name = name;
20 | this.tag = tag;
21 | this.viewType = StaticFinalValues.VIEW_HOLDER_TEXT;
22 | }
23 |
24 | public BaseRecyclerBean(String name, Class> clazz) {
25 | this.name = name;
26 | this.clazz = clazz;
27 | this.viewType = StaticFinalValues.VIEW_HOLDER_CLASS;
28 | }
29 |
30 | public String getName() {
31 | return name;
32 | }
33 |
34 | public void setName(String name) {
35 | this.name = name;
36 | }
37 |
38 | public Class> getClazz() {
39 | return clazz;
40 | }
41 |
42 | public void setClazz(Class> clazz) {
43 | this.clazz = clazz;
44 | }
45 |
46 | public String getExtra_info() {
47 | return extra_info;
48 | }
49 |
50 | public void setExtra_info(String extra_info) {
51 | this.extra_info = extra_info;
52 | }
53 |
54 | public int getTag() {
55 | return tag;
56 | }
57 |
58 | public void setTag(int tag) {
59 | this.tag = tag;
60 | }
61 |
62 | public int getViewType() {
63 | return viewType;
64 | }
65 |
66 | public void setViewType(int viewType) {
67 | this.viewType = viewType;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/pickvideo/loader/VideoLoader.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.pickvideo.loader;
2 |
3 | import android.content.Context;
4 | import android.net.Uri;
5 | import android.provider.MediaStore;
6 | import android.support.v4.content.CursorLoader;
7 |
8 | import static android.provider.MediaStore.MediaColumns.MIME_TYPE;
9 |
10 | /**
11 | * Created by Vincent Woo
12 | * Date: 2016/10/10
13 | * Time: 11:38
14 | */
15 |
16 | public class VideoLoader extends CursorLoader {
17 | private static final String[] VIDEO_PROJECTION = {
18 | //Base File
19 | MediaStore.Video.Media._ID,
20 | MediaStore.Video.Media.TITLE,
21 | MediaStore.Video.Media.DATA,
22 | MediaStore.Video.Media.SIZE,
23 | MediaStore.Video.Media.BUCKET_ID,
24 | MediaStore.Video.Media.BUCKET_DISPLAY_NAME,
25 | MediaStore.Video.Media.DATE_ADDED,
26 | //Video File
27 | MediaStore.Video.Media.DURATION
28 | };
29 |
30 | private VideoLoader(Context context, Uri uri, String[] projection, String selection,
31 | String[] selectionArgs, String sortOrder) {
32 | super(context, uri, projection, selection, selectionArgs, sortOrder);
33 | }
34 |
35 | public VideoLoader(Context context) {
36 | super(context);
37 |
38 | setProjection(VIDEO_PROJECTION);
39 | setUri(MediaStore.Video.Media.EXTERNAL_CONTENT_URI);
40 | setSortOrder(MediaStore.Video.Media.DATE_ADDED + " DESC");
41 |
42 | setSelection(MIME_TYPE + "=? or " + MIME_TYPE + "=?");
43 | String[] selectionArgs;
44 | selectionArgs = new String[] { "video/mpeg", "video/mp4" };
45 | setSelectionArgs(selectionArgs);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/blocks/BlocksActivity.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.blocks;
2 |
3 | import android.view.View;
4 |
5 | import com.aserbao.androidcustomcamera.base.activity.RVBaseActivity;
6 | import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean;
7 | import com.aserbao.androidcustomcamera.blocks.audioRecord.AudioRecordActivity;
8 | import com.aserbao.androidcustomcamera.blocks.others.OthersActivity;
9 | import com.aserbao.androidcustomcamera.blocks.others.changeHue.ChangeHueActivity;
10 | import com.aserbao.androidcustomcamera.blocks.mediaExtractor.MediaExtractorActivity;
11 | import com.aserbao.androidcustomcamera.blocks.mediaCodec.MediaCodecActivity;
12 | import com.aserbao.androidcustomcamera.blocks.mediaMuxer.MediaMuxerActivity;
13 | import com.aserbao.androidcustomcamera.blocks.mediaMuxer.functions.CreateVideoAddAudioToMp4;
14 |
15 | public class BlocksActivity extends RVBaseActivity {
16 |
17 | @Override
18 | protected void initGetData() {
19 | mBaseRecyclerBeen.add(new BaseRecyclerBean("修改hue", ChangeHueActivity.class));
20 | mBaseRecyclerBeen.add(new BaseRecyclerBean("AudioRecord", AudioRecordActivity.class));
21 | mBaseRecyclerBeen.add(new BaseRecyclerBean("MediaCodec", MediaCodecActivity.class));
22 | mBaseRecyclerBeen.add(new BaseRecyclerBean("MediaExtractor", MediaExtractorActivity.class));
23 | mBaseRecyclerBeen.add(new BaseRecyclerBean("MediaMuxer", MediaMuxerActivity.class));
24 | mBaseRecyclerBeen.add(new BaseRecyclerBean("合成", CreateVideoAddAudioToMp4.class));
25 | mBaseRecyclerBeen.add(new BaseRecyclerBean("其他", OthersActivity.class));
26 | }
27 |
28 | @Override
29 | public void itemClickBack(View view, int position, boolean isLongClick, int comeFrom) {
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/pickvideo/loader/AudioLoader.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.pickvideo.loader;
2 |
3 | import android.content.Context;
4 | import android.net.Uri;
5 | import android.provider.MediaStore;
6 | import android.support.v4.content.CursorLoader;
7 |
8 | import static android.provider.MediaStore.MediaColumns.MIME_TYPE;
9 |
10 | /**
11 | * Created by Vincent Woo
12 | * Date: 2016/10/11
13 | * Time: 17:35
14 | */
15 |
16 | public class AudioLoader extends CursorLoader {
17 | private static final String[] AUDIO_PROJECTION = {
18 | //Base File
19 | MediaStore.Audio.Media._ID,
20 | MediaStore.Audio.Media.TITLE,
21 | MediaStore.Audio.Media.DATA,
22 | MediaStore.Audio.Media.SIZE,
23 | MediaStore.Audio.Media.DATE_ADDED,
24 | //Audio File
25 | MediaStore.Audio.Media.DURATION
26 | };
27 |
28 | private AudioLoader(Context context, Uri uri, String[] projection, String selection,
29 | String[] selectionArgs, String sortOrder) {
30 | super(context, uri, projection, selection, selectionArgs, sortOrder);
31 | }
32 |
33 | public AudioLoader(Context context) {
34 | super(context);
35 |
36 | setProjection(AUDIO_PROJECTION);
37 | setUri(MediaStore.Files.getContentUri("external"));
38 | setSortOrder(MediaStore.Audio.Media.DATE_ADDED + " DESC");
39 |
40 | setSelection(MIME_TYPE + "=? or "
41 | + MIME_TYPE + "=? or "
42 | // + MIME_TYPE + "=? or "
43 | + MIME_TYPE + "=?");
44 | String[] selectionArgs;
45 | selectionArgs = new String[]{"audio/mpeg", "audio/mp3", "audio/x-ms-wma"};
46 | setSelectionArgs(selectionArgs);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/pickvideo/BaseAdapter.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.pickvideo;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 |
6 | import com.aserbao.androidcustomcamera.whole.pickvideo.beans.VideoFile;
7 | import com.aserbao.androidcustomcamera.whole.pickvideo.callback.OnSelectStateListener;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | /**
13 | * Created by Vincent Woo
14 | * Date: 2016/10/14
15 | * Time: 15:42
16 | */
17 |
18 | public abstract class BaseAdapter extends RecyclerView.Adapter {
19 | protected Context mContext;
20 | protected ArrayList mList;
21 | protected OnSelectStateListener mListener;
22 |
23 | public BaseAdapter(Context ctx, ArrayList list) {
24 | mContext = ctx;
25 | mList = list;
26 | }
27 |
28 | public void add(List list) {
29 | mList.addAll(list);
30 | notifyDataSetChanged();
31 | }
32 |
33 | public void add(T file) {
34 | mList.add(file);
35 | notifyDataSetChanged();
36 | }
37 |
38 | public void add(int index, T file) {
39 | mList.add(index, file);
40 | notifyDataSetChanged();
41 | }
42 |
43 | public void refresh(List list) {
44 | mList.clear();
45 | mList.addAll(list);
46 | notifyDataSetChanged();
47 | }
48 |
49 | public void refresh(T file) {
50 | mList.clear();
51 | mList.add(file);
52 | notifyDataSetChanged();
53 | }
54 |
55 | public List getDataSet() {
56 | return mList;
57 | }
58 |
59 |
60 |
61 | public void setOnSelectStateListener(OnSelectStateListener listener) {
62 | mListener = listener;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/jz_dialog_volume.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
19 |
20 |
29 |
30 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/blocks/mediaExtractor/primary/FrequencyView.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.blocks.mediaExtractor.primary;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.Color;
6 | import android.graphics.Paint;
7 | import android.support.annotation.Nullable;
8 | import android.util.AttributeSet;
9 | import android.view.View;
10 |
11 | import java.util.LinkedList;
12 |
13 | /**
14 | * 功能:
15 | *
16 | * @author aserbao
17 | * @date : On 2019/1/5 4:09 PM
18 | * @email: 1142803753@qq.com
19 | * @project:AndroidCamera
20 | * @package:com.aserbao.androidcustomcamera.blocks.MediaExtractor.primary
21 | * @Copyright: 个人版权所有
22 | */
23 | public class FrequencyView extends View{
24 |
25 | private Paint paint;
26 |
27 | public FrequencyView(Context context) {
28 | this(context,null);
29 | }
30 |
31 | public FrequencyView(Context context, @Nullable AttributeSet attrs) {
32 | this(context, attrs,0);
33 | }
34 |
35 | public FrequencyView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
36 | super(context, attrs, defStyleAttr);
37 | init();
38 | }
39 |
40 | private void init() {
41 | paint = new Paint();
42 | paint.setStrokeWidth(1);
43 | paint.setColor(Color.BLACK);
44 | paint.setAntiAlias(true);
45 | paint.setStyle(Paint.Style.FILL);
46 | }
47 |
48 | private LinkedList mlist = new LinkedList<>();
49 | public void addInt(int i){
50 | mlist.add(i);
51 | invalidate();
52 | }
53 | @Override
54 | protected void onDraw(Canvas canvas) {
55 | super.onDraw(canvas);
56 | for (int i = 0; i < mlist.size(); i++) {
57 | canvas.drawLine(i,0,i+ 1,mlist.get(i),paint);
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_input_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
18 |
19 |
33 |
34 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/jz_dialog_brightness.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
19 |
20 |
29 |
30 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/cool.glsl:
--------------------------------------------------------------------------------
1 | varying highp vec2 textureCoordinate;
2 | precision highp float;
3 |
4 | uniform sampler2D inputImageTexture;
5 | uniform sampler2D curve;
6 |
7 | void main()
8 | {
9 | lowp vec4 textureColor;
10 | lowp vec4 textureColorOri;
11 |
12 | float xCoordinate = textureCoordinate.x;
13 | float yCoordinate = textureCoordinate.y;
14 |
15 | highp float redCurveValue;
16 | highp float greenCurveValue;
17 | highp float blueCurveValue;
18 |
19 | textureColor = texture2D( inputImageTexture, vec2(xCoordinate, yCoordinate));
20 | textureColorOri = textureColor;
21 | // step1 curve
22 | redCurveValue = texture2D(curve, vec2(textureColor.r, 0.0)).r;
23 | greenCurveValue = texture2D(curve, vec2(textureColor.g, 0.0)).g;
24 | blueCurveValue = texture2D(curve, vec2(textureColor.b, 0.0)).b;
25 | // step2 level
26 | redCurveValue = texture2D(curve, vec2(redCurveValue, 0.0)).a;
27 | greenCurveValue = texture2D(curve, vec2(greenCurveValue, 0.0)).a;
28 | blueCurveValue = texture2D(curve, vec2(blueCurveValue, 0.0)).a;
29 | // step3 brightness/constrast adjust
30 | redCurveValue = redCurveValue * 1.25 - 0.12549;
31 | greenCurveValue = greenCurveValue * 1.25 - 0.12549;
32 | blueCurveValue = blueCurveValue * 1.25 - 0.12549;
33 | //redCurveValue = (((redCurveValue) > (1.0)) ? (1.0) : (((redCurveValue) < (0.0)) ? (0.0) : (redCurveValue)));
34 | //greenCurveValue = (((greenCurveValue) > (1.0)) ? (1.0) : (((greenCurveValue) < (0.0)) ? (0.0) : (greenCurveValue)));
35 | //blueCurveValue = (((blueCurveValue) > (1.0)) ? (1.0) : (((blueCurveValue) < (0.0)) ? (0.0) : (blueCurveValue)));
36 | // step4 normal blending with original
37 | textureColor = vec4(redCurveValue, greenCurveValue, blueCurveValue, 1.0);
38 | textureColor = (textureColorOri - textureColor) * 0.549 + textureColor;
39 |
40 | gl_FragColor = vec4(textureColor.r, textureColor.g, textureColor.b, 1.0);
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/whole/pickvideo/loader/ImageLoader.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.whole.pickvideo.loader;
2 |
3 | import android.content.Context;
4 | import android.net.Uri;
5 | import android.provider.MediaStore;
6 | import android.support.v4.content.CursorLoader;
7 |
8 | import static android.provider.MediaStore.MediaColumns.MIME_TYPE;
9 |
10 | /**
11 | * Created by Vincent Woo
12 | * Date: 2016/10/10
13 | * Time: 17:55
14 | */
15 |
16 | public class ImageLoader extends CursorLoader {
17 | private static final String[] IMAGE_PROJECTION = {
18 | //Base File
19 | MediaStore.Images.Media._ID,
20 | MediaStore.Images.Media.TITLE,
21 | MediaStore.Images.Media.DATA,
22 | MediaStore.Images.Media.SIZE,
23 | MediaStore.Images.Media.BUCKET_ID,
24 | MediaStore.Images.Media.BUCKET_DISPLAY_NAME,
25 | MediaStore.Images.Media.DATE_ADDED,
26 | //Image File
27 | MediaStore.Images.Media.ORIENTATION
28 | };
29 |
30 | private ImageLoader(Context context, Uri uri, String[] projection, String selection,
31 | String[] selectionArgs, String sortOrder) {
32 | super(context, uri, projection, selection, selectionArgs, sortOrder);
33 | }
34 |
35 | public ImageLoader(Context context) {
36 | super(context);
37 | setProjection(IMAGE_PROJECTION);
38 | setUri(MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
39 | setSortOrder(MediaStore.Images.Media.DATE_ADDED + " DESC");
40 |
41 | setSelection(MIME_TYPE + "=? or " + MIME_TYPE + "=? or "+ MIME_TYPE + "=? or " + MIME_TYPE + "=?");
42 |
43 | String[] selectionArgs;
44 | selectionArgs = new String[] { "image/jpeg", "image/png", "image/jpg","image/gif" };
45 | setSelectionArgs(selectionArgs);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aserbao/androidcustomcamera/blocks/mediaCodec/bigflake/BigflakeActivity.java:
--------------------------------------------------------------------------------
1 | package com.aserbao.androidcustomcamera.blocks.mediaCodec.bigflake;
2 |
3 | import android.view.View;
4 |
5 | import com.aserbao.androidcustomcamera.base.activity.RVBaseActivity;
6 | import com.aserbao.androidcustomcamera.base.beans.BaseRecyclerBean;
7 | import com.aserbao.androidcustomcamera.blocks.mediaCodec.bigflake.cameraToMpeg.CameraToMpegActivity;
8 | import com.aserbao.androidcustomcamera.blocks.mediaCodec.bigflake.decodeEditEncode.DecodeEditEncodeActivity;
9 | import com.aserbao.androidcustomcamera.blocks.mediaCodec.bigflake.encodeAndMux.EncodeAndMuxActivity;
10 | import com.aserbao.androidcustomcamera.blocks.mediaCodec.bigflake.encodeDecode.EncodeDecodeActivity;
11 | import com.aserbao.androidcustomcamera.blocks.mediaCodec.bigflake.extractDecodeEditEncodeMux.ExtractDecodeEditEncodeMuxActivity;
12 | import com.aserbao.androidcustomcamera.blocks.mediaCodec.bigflake.extractMpegFrames.ExtractMpegFramesActivity;
13 |
14 | public class BigflakeActivity extends RVBaseActivity {
15 |
16 |
17 | @Override
18 | protected void initGetData() {
19 | mBaseRecyclerBeen.add(new BaseRecyclerBean("EncodeAndMux",EncodeAndMuxActivity.class));
20 | mBaseRecyclerBeen.add(new BaseRecyclerBean("CameraToMpeg",CameraToMpegActivity.class));
21 | mBaseRecyclerBeen.add(new BaseRecyclerBean("EncodeDecode",EncodeDecodeActivity.class));
22 | mBaseRecyclerBeen.add(new BaseRecyclerBean("ExtractDecodeEditEncodeMux",ExtractDecodeEditEncodeMuxActivity.class));
23 | mBaseRecyclerBeen.add(new BaseRecyclerBean("DecodeEditEncodeActivity",DecodeEditEncodeActivity.class));
24 | mBaseRecyclerBeen.add(new BaseRecyclerBean("ExtractMpegFramesActivity",ExtractMpegFramesActivity.class));
25 | }
26 |
27 | @Override
28 | public void itemClickBack(View view, int position, boolean isLongClick, int comeFrom) {
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/sutro.glsl:
--------------------------------------------------------------------------------
1 | precision mediump float;
2 |
3 | varying mediump vec2 textureCoordinate;
4 |
5 | uniform sampler2D inputImageTexture;
6 | uniform sampler2D inputImageTexture2; //sutroMap;
7 | uniform sampler2D inputImageTexture3; //sutroMetal;
8 | uniform sampler2D inputImageTexture4; //softLight
9 | uniform sampler2D inputImageTexture5; //sutroEdgeburn
10 | uniform sampler2D inputImageTexture6; //sutroCurves
11 |
12 | uniform float strength;
13 |
14 | void main()
15 | {
16 | vec4 originColor = texture2D(inputImageTexture, textureCoordinate);
17 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb;
18 |
19 | vec2 tc = (2.0 * textureCoordinate) - 1.0;
20 | float d = dot(tc, tc);
21 | vec2 lookup = vec2(d, texel.r);
22 | texel.r = texture2D(inputImageTexture2, lookup).r;
23 | lookup.y = texel.g;
24 | texel.g = texture2D(inputImageTexture2, lookup).g;
25 | lookup.y = texel.b;
26 | texel.b = texture2D(inputImageTexture2, lookup).b;
27 |
28 | vec3 rgbPrime = vec3(0.1019, 0.0, 0.0);
29 | float m = dot(vec3(.3, .59, .11), texel.rgb) - 0.03058;
30 | texel = mix(texel, rgbPrime + m, 0.32);
31 |
32 | vec3 metal = texture2D(inputImageTexture3, textureCoordinate).rgb;
33 | texel.r = texture2D(inputImageTexture4, vec2(metal.r, texel.r)).r;
34 | texel.g = texture2D(inputImageTexture4, vec2(metal.g, texel.g)).g;
35 | texel.b = texture2D(inputImageTexture4, vec2(metal.b, texel.b)).b;
36 |
37 | texel = texel * texture2D(inputImageTexture5, textureCoordinate).rgb;
38 |
39 | texel.r = texture2D(inputImageTexture6, vec2(texel.r, .16666)).r;
40 | texel.g = texture2D(inputImageTexture6, vec2(texel.g, .5)).g;
41 | texel.b = texture2D(inputImageTexture6, vec2(texel.b, .83333)).b;
42 |
43 | texel.rgb = mix(originColor.rgb, texel.rgb, strength);
44 |
45 | gl_FragColor = vec4(texel, 1.0);
46 | }
--------------------------------------------------------------------------------