├── Android
├── .classpath
├── .factorypath
├── .project
├── .settings
│ ├── org.eclipse.jdt.apt.core.prefs
│ ├── org.eclipse.jdt.apt.core.prefs.svntmp
│ └── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── assets
│ ├── config.xml
│ ├── filter
│ │ ├── 2
│ │ │ ├── icon.png
│ │ │ └── meta.xml
│ │ ├── 3
│ │ │ ├── icon.png
│ │ │ ├── lookup_amatorka.png
│ │ │ └── meta.xml
│ │ ├── 4
│ │ │ ├── icon.png
│ │ │ ├── lookup_earlybird.png
│ │ │ └── meta.xml
│ │ ├── 6
│ │ │ ├── icon.png
│ │ │ └── meta.xml
│ │ ├── 11
│ │ │ ├── icon.png
│ │ │ └── meta.xml
│ │ ├── 23
│ │ │ ├── icon.png
│ │ │ ├── lookup_soft_elegance_2.png
│ │ │ └── meta.xml
│ │ ├── 114
│ │ │ ├── icon.png
│ │ │ ├── lookup_miss_etikate.png
│ │ │ └── meta.xml
│ │ └── 1111
│ │ │ ├── icon.png
│ │ │ ├── lookup_abao.png
│ │ │ └── meta.xml
│ └── theme
│ │ ├── 1
│ │ ├── BLEND_SCREEN.xml
│ │ ├── TONE_CURVE.xml
│ │ ├── dream-480-480.mp4
│ │ ├── dream.mp4
│ │ ├── icon.png
│ │ └── meta.xml
│ │ ├── 2
│ │ ├── BLEND_OVERLAY.xml
│ │ ├── BLEND_SCREEN.xml
│ │ ├── SATURATION.xml
│ │ ├── icon.png
│ │ ├── meta.xml
│ │ ├── sun-480-480.mp4
│ │ └── sun.mp4
│ │ ├── 8
│ │ ├── BLEND_SCREEN.xml
│ │ ├── MONOCHROME.xml
│ │ ├── SEPIA.xml
│ │ ├── icon.png
│ │ ├── meta.xml
│ │ ├── vintage-480-480.png
│ │ └── vintage.mp4
│ │ ├── 9
│ │ ├── BLEND_SCREEN.xml
│ │ ├── GRAYSCALE.xml
│ │ ├── icon.png
│ │ ├── meta.xml
│ │ ├── old-movie-2-480-480.mp4
│ │ └── old-movie.mp4
│ │ └── 10
│ │ ├── BLEND_SCREEN.xml
│ │ ├── icon.png
│ │ ├── meta.xml
│ │ ├── rain-480-480.mp4
│ │ └── rain.mp4
├── ic_launcher-web.png
├── libs
│ ├── android-support-v4.jar
│ ├── armeabi
│ │ ├── libEasyVideoRecorder.so
│ │ └── libEasyVideoRender.so
│ ├── butterknife-6.1.0.jar
│ ├── easyvideorecorderlib.jar
│ ├── easyvideorenderlib.jar
│ ├── gpuimage.jar
│ └── universal-image-loader-1.9.3.jar
├── proguard-project.txt
├── project.properties
├── res
│ ├── anim
│ │ ├── video_beautify_button_exit.xml
│ │ ├── voide_beautify_button_enter.xml
│ │ └── voide_button_reenter.xml
│ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── drawable-nodpi
│ │ ├── easy_logo.png
│ │ └── lookup_amatorka.png
│ ├── drawable-xhdpi
│ │ ├── close_bn.png
│ │ ├── ic_launcher.png
│ │ ├── icon_button_left_white.png
│ │ ├── video_beautify_back_down.png
│ │ ├── video_beautify_back_normal.png
│ │ ├── video_beautify_local_add_music_down.png
│ │ ├── video_beautify_local_music.png
│ │ ├── video_beautify_local_music_back_down.png
│ │ ├── video_beautify_local_music_back_normal.png
│ │ ├── video_beautify_local_no_music.png
│ │ ├── video_beautify_local_play_music_down.png
│ │ ├── video_beautify_local_play_music_normal.png
│ │ ├── video_beautify_local_stop_music_down.png
│ │ ├── video_beautify_local_stop_music_normal.png
│ │ ├── video_beautify_local_switch_line.png
│ │ ├── video_beautify_localmusic_edit_seekbar_thumbl.9.png
│ │ ├── video_beautify_no_theme_filter.png
│ │ ├── video_beautify_silencer_normal.png
│ │ ├── video_beautify_silencer_selected.png
│ │ ├── video_player_play_icon.png
│ │ ├── video_process_filter_icon.png
│ │ ├── video_process_filter_icon_bg.png
│ │ ├── video_process_seekbar.9.png
│ │ ├── video_process_seekbar_thumb.png
│ │ ├── video_record_backspace.png
│ │ ├── video_record_chage_camrea_arrow.png
│ │ ├── video_record_delete.png
│ │ ├── video_record_image_focus.png
│ │ ├── video_record_light_off_normal.png
│ │ ├── video_record_ok.png
│ │ ├── video_record_start_btn.png
│ │ ├── video_record_start_btn_pressed.png
│ │ ├── video_record_switch_camera.png
│ │ └── video_watermark_logo.png
│ ├── drawable-xxhdpi
│ │ └── ic_launcher.png
│ ├── drawable
│ │ ├── video_beautify_listview_item_selector.xml
│ │ ├── video_beautify_local_music_play_music_selector.xml
│ │ ├── video_beautify_local_music_play_progress_style.xml
│ │ ├── video_beautify_local_music_stop_music_selector.xml
│ │ ├── video_beautify_local_music_table_text_selector.xml
│ │ ├── video_beautify_local_nusic_back_selector.xml
│ │ ├── video_beautify_title_back_button.xml
│ │ ├── video_process_filter_item_selector.xml
│ │ ├── video_process_filter_item_shap.xml
│ │ └── video_record_start_btn_selector.xml
│ ├── layout
│ │ ├── activity_start.xml
│ │ ├── splash_activity.xml
│ │ ├── video_beautify_activity.xml
│ │ ├── video_beautify_local_music_activity.xml
│ │ ├── video_beautify_local_music_hostory_list.xml
│ │ ├── video_beautify_local_music_list.xml
│ │ ├── video_beautify_local_music_list_item.xml
│ │ ├── video_beautify_local_music_play_edit.xml
│ │ ├── video_beautify_local_music_table_content.xml
│ │ ├── video_beautify_secected_item.xml
│ │ ├── video_play_activity.xml
│ │ └── video_record_activity.xml
│ ├── raw
│ │ └── tone_cuver_sample.acv
│ ├── values-v11
│ │ └── styles.xml
│ ├── values-v14
│ │ └── styles.xml
│ └── values
│ │ ├── attrs.xml
│ │ ├── strings.xml
│ │ ├── styles.xml
│ │ ├── video_beautify_colors.xml
│ │ ├── video_beautify_dimens.xml
│ │ ├── video_beautify_strings.xml
│ │ └── video_recoder_colors.xml
└── src
│ ├── jp
│ └── co
│ │ └── cyberagent
│ │ └── android
│ │ └── gpuimage
│ │ └── util
│ │ ├── GPUImageFilterTools.java
│ │ └── TextureRotationUtil.java
│ └── org
│ └── easydarwin
│ └── video
│ ├── App.java
│ ├── SplashActivity.java
│ ├── StartActivity.java
│ ├── VideoPlayActivity.java
│ ├── beautify
│ ├── activity
│ │ ├── LocalMusicActivity.java
│ │ └── VideoBeautifyActivity.java
│ ├── adapter
│ │ ├── VideoBeautifyMusicAdapter.java
│ │ ├── VideoBeautifyMusicHistoryAdapter.java
│ │ └── VideoBeautifyThemeAdapter.java
│ ├── conf
│ │ └── Conf.java
│ ├── listener
│ │ ├── OnMusicViewChangeListener.java
│ │ └── ViewOnTouchListener.java
│ ├── model
│ │ ├── GalleryModel.java
│ │ ├── LocalMusicLoader.java
│ │ ├── ProcessTask.java
│ │ ├── Type.java
│ │ └── VideoBeautifyTheme.java
│ ├── service
│ │ └── LocalMusicService.java
│ ├── store
│ │ └── VideoBeautifySharedPrefs.java
│ ├── task
│ │ ├── ProgressDialogTask.java
│ │ └── VideoProcessor.java
│ ├── template
│ │ ├── Asset.java
│ │ ├── AssetMgr.java
│ │ ├── AssetType.java
│ │ ├── AudioAsset.java
│ │ ├── AudioClip.java
│ │ ├── AudioEffect.java
│ │ ├── AudioGroup.java
│ │ ├── Effect.java
│ │ ├── Filter.java
│ │ ├── FilterEffect.java
│ │ ├── FilterGroup.java
│ │ ├── FilterUtils.java
│ │ ├── FxEffect.java
│ │ ├── ImageSeqAsset.java
│ │ ├── ImageSeqClip.java
│ │ ├── MediaClip.java
│ │ ├── MediaMgr.java
│ │ ├── NodeType.java
│ │ ├── TimeLineNode.java
│ │ ├── Tittle.java
│ │ ├── TittleAsset.java
│ │ ├── TittleEffect.java
│ │ ├── TransitionEffect.java
│ │ ├── VideoAsset.java
│ │ ├── VideoClip.java
│ │ ├── VideoProject.java
│ │ ├── VideoProjectUtils.java
│ │ ├── VideoTemplate.java
│ │ └── VideoTemplateUtils.java
│ ├── util
│ │ ├── ContextHolder.java
│ │ ├── DateUtils.java
│ │ ├── GPUImageTools.java
│ │ ├── ProjectUtils.java
│ │ ├── TouchUtil.java
│ │ ├── VideoBeautifyUtil.java
│ │ ├── VideoCommonPara.java
│ │ ├── VideoThumbsUtil.java
│ │ └── WindowUtils.java
│ └── view
│ │ ├── CustomImageView.java
│ │ ├── HorizontalListView.java
│ │ └── LocalMusicScrollLayout.java
│ └── recoder
│ ├── activity
│ └── VideoRecorderActivity.java
│ ├── base
│ ├── Application.java
│ └── BaseActivity.java
│ ├── conf
│ └── Conf.java
│ ├── core
│ ├── CameraManager.java
│ └── RecorderManager.java
│ ├── utils
│ ├── AndroidUtils.java
│ └── Logger.java
│ └── view
│ ├── VideoFocusView.java
│ ├── VideoPreviewView.java
│ └── VideoProgressView.java
├── README.md
└── Release
└── EasyVideoDemo1.0.16.0301.apk
/Android/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Android/.factorypath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | EasyVideoDemo
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Android/.settings/org.eclipse.jdt.apt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.apt.aptEnabled=true
3 | org.eclipse.jdt.apt.genSrcDir=.apt_generated
4 | org.eclipse.jdt.apt.reconcileEnabled=true
5 |
--------------------------------------------------------------------------------
/Android/.settings/org.eclipse.jdt.apt.core.prefs.svntmp:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.apt.aptEnabled=true
3 | org.eclipse.jdt.apt.genSrcDir=.apt_generated
4 | org.eclipse.jdt.apt.reconcileEnabled=true
5 |
--------------------------------------------------------------------------------
/Android/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6 | org.eclipse.jdt.core.compiler.compliance=1.7
7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12 | org.eclipse.jdt.core.compiler.processAnnotations=enabled
13 | org.eclipse.jdt.core.compiler.source=1.7
14 |
--------------------------------------------------------------------------------
/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
32 |
33 |
34 |
37 |
38 |
43 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
60 |
61 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/Android/assets/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 | 1
6 | 0
7 | 无主题
8 |
9 | 0
10 |
11 |
12 | -
13 | 1
14 | 10
15 | 雨天
16 | icon.png
17 | 0
18 |
19 |
20 | -
21 | 1
22 | 9
23 | 电影
24 | icon.png
25 | 0
26 |
27 |
28 | -
29 | 1
30 | 8
31 | 怀旧
32 | icon.png
33 | 0
34 |
35 | -
36 | 1
37 | 2
38 | 阳光
39 | icon.png
40 | 0
41 |
42 |
43 |
44 | -
45 | 1
46 | 1
47 | 时光
48 | icon.png
49 | 0
50 |
51 |
52 | -
53 | 2
54 | 0
55 | 原画质
56 |
57 | 0
58 |
59 |
60 | -
61 | 2
62 | 4
63 | 岁月
64 | icon.png
65 | 0
66 |
67 |
68 | -
69 | 2
70 | 23
71 | 邂逅
72 | icon.png
73 | 0
74 |
75 |
76 | -
77 | 2
78 | 114
79 | 思念
80 | icon.png
81 | 0
82 |
83 |
84 | -
85 | 2
86 | 3
87 | 月光
88 | icon.png
89 | 0
90 |
91 |
92 | -
93 | 2
94 | 11
95 | 炫影
96 | icon.png
97 | 0
98 |
99 |
100 | -
101 | 2
102 | 6
103 | 晴朗
104 | icon.png
105 | 0
106 |
107 |
108 |
109 | -
110 | 2
111 | 2
112 | 陌路
113 | icon.png
114 | 0
115 |
116 |
117 |
--------------------------------------------------------------------------------
/Android/assets/filter/11/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/11/icon.png
--------------------------------------------------------------------------------
/Android/assets/filter/11/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/filter/1111/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/1111/icon.png
--------------------------------------------------------------------------------
/Android/assets/filter/1111/lookup_abao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/1111/lookup_abao.png
--------------------------------------------------------------------------------
/Android/assets/filter/1111/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/filter/114/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/114/icon.png
--------------------------------------------------------------------------------
/Android/assets/filter/114/lookup_miss_etikate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/114/lookup_miss_etikate.png
--------------------------------------------------------------------------------
/Android/assets/filter/114/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Android/assets/filter/2/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/2/icon.png
--------------------------------------------------------------------------------
/Android/assets/filter/2/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/filter/23/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/23/icon.png
--------------------------------------------------------------------------------
/Android/assets/filter/23/lookup_soft_elegance_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/23/lookup_soft_elegance_2.png
--------------------------------------------------------------------------------
/Android/assets/filter/23/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Android/assets/filter/3/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/3/icon.png
--------------------------------------------------------------------------------
/Android/assets/filter/3/lookup_amatorka.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/3/lookup_amatorka.png
--------------------------------------------------------------------------------
/Android/assets/filter/3/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/filter/4/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/4/icon.png
--------------------------------------------------------------------------------
/Android/assets/filter/4/lookup_earlybird.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/4/lookup_earlybird.png
--------------------------------------------------------------------------------
/Android/assets/filter/4/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Android/assets/filter/6/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/filter/6/icon.png
--------------------------------------------------------------------------------
/Android/assets/filter/6/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/theme/1/BLEND_SCREEN.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/theme/1/TONE_CURVE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/theme/1/dream-480-480.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/1/dream-480-480.mp4
--------------------------------------------------------------------------------
/Android/assets/theme/1/dream.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/1/dream.mp4
--------------------------------------------------------------------------------
/Android/assets/theme/1/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/1/icon.png
--------------------------------------------------------------------------------
/Android/assets/theme/1/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Android/assets/theme/10/BLEND_SCREEN.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/theme/10/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/10/icon.png
--------------------------------------------------------------------------------
/Android/assets/theme/10/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Android/assets/theme/10/rain-480-480.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/10/rain-480-480.mp4
--------------------------------------------------------------------------------
/Android/assets/theme/10/rain.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/10/rain.mp4
--------------------------------------------------------------------------------
/Android/assets/theme/2/BLEND_OVERLAY.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/theme/2/BLEND_SCREEN.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/theme/2/SATURATION.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/theme/2/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/2/icon.png
--------------------------------------------------------------------------------
/Android/assets/theme/2/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Android/assets/theme/2/sun-480-480.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/2/sun-480-480.mp4
--------------------------------------------------------------------------------
/Android/assets/theme/2/sun.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/2/sun.mp4
--------------------------------------------------------------------------------
/Android/assets/theme/8/BLEND_SCREEN.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/theme/8/MONOCHROME.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/theme/8/SEPIA.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/theme/8/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/8/icon.png
--------------------------------------------------------------------------------
/Android/assets/theme/8/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Android/assets/theme/8/vintage-480-480.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/8/vintage-480-480.png
--------------------------------------------------------------------------------
/Android/assets/theme/8/vintage.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/8/vintage.mp4
--------------------------------------------------------------------------------
/Android/assets/theme/9/BLEND_SCREEN.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/theme/9/GRAYSCALE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Android/assets/theme/9/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/9/icon.png
--------------------------------------------------------------------------------
/Android/assets/theme/9/meta.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Android/assets/theme/9/old-movie-2-480-480.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/9/old-movie-2-480-480.mp4
--------------------------------------------------------------------------------
/Android/assets/theme/9/old-movie.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/assets/theme/9/old-movie.mp4
--------------------------------------------------------------------------------
/Android/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/ic_launcher-web.png
--------------------------------------------------------------------------------
/Android/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/Android/libs/armeabi/libEasyVideoRecorder.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/libs/armeabi/libEasyVideoRecorder.so
--------------------------------------------------------------------------------
/Android/libs/armeabi/libEasyVideoRender.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/libs/armeabi/libEasyVideoRender.so
--------------------------------------------------------------------------------
/Android/libs/butterknife-6.1.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/libs/butterknife-6.1.0.jar
--------------------------------------------------------------------------------
/Android/libs/easyvideorecorderlib.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/libs/easyvideorecorderlib.jar
--------------------------------------------------------------------------------
/Android/libs/easyvideorenderlib.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/libs/easyvideorenderlib.jar
--------------------------------------------------------------------------------
/Android/libs/gpuimage.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/libs/gpuimage.jar
--------------------------------------------------------------------------------
/Android/libs/universal-image-loader-1.9.3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/libs/universal-image-loader-1.9.3.jar
--------------------------------------------------------------------------------
/Android/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
22 | -dontusemixedcaseclassnames
23 | -dontskipnonpubliclibraryclasses
24 | -dontpreverify
25 | -verbose
26 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
27 | -flattenpackagehierarchy
28 | -allowaccessmodification
29 | -printmapping map.txt
30 | -optimizationpasses 7
31 | -dontskipnonpubliclibraryclasses
32 | -dontskipnonpubliclibraryclassmembers
33 | -ignorewarnings
34 |
35 | -renamesourcefileattribute SourceFile
36 |
37 | -keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,*Annotation*,EnclosingMethod,ProtoContract,ProtoMember
38 |
39 | -keep public class * extends android.app.Activity
40 | -keep public class * extends android.app.Application
41 | -keep public class * extends android.app.Service
42 | -keep public class * extends android.content.BroadcastReceiver
43 | -keep public class * extends android.content.ContentProvider
44 | -keep public class com.android.vending.licensing.ILicensingService
45 | -keep public class * extends android.support.v4.app.FragmentActivity
46 | -keep public class * extends android.app.backup.BackupAgentHelper
47 | -keep public class * extends android.preference.Preference
48 | -keep public class com.android.vending.licensing.ILicensingService
49 |
50 |
51 | -keepclasseswithmembernames class * {
52 | native ;
53 | }
54 |
55 | -keepclasseswithmembernames class * {
56 | public (android.content.Context, android.util.AttributeSet);
57 | }
58 |
59 | -keepclasseswithmembernames class * {
60 | public (android.content.Context, android.util.AttributeSet, int);
61 | }
62 |
63 | -keepclassmembers class * extends android.app.Activity {
64 | public void *(android.view.View);
65 | }
66 |
67 | -keepclassmembers enum * {
68 | public static **[] values();
69 | public static ** valueOf(java.lang.String);
70 | }
71 |
72 | -keep class * implements android.os.Parcelable {
73 | public static final android.os.Parcelable$Creator *;
74 | }
75 |
76 | -keepclassmembers class fqcn.of.javascript.interface.for.webview {
77 | public *;
78 | }
79 |
80 | -keepclassmembers class **.R$* {
81 | public static ;
82 | }
83 |
84 | -dontwarn android.support.**
85 |
86 | -keep class butterknife.** { *; }
87 | -dontwarn butterknife.internal.**
88 | -keep class **$$ViewBinder { *; }
89 | -keepclasseswithmembernames class * {
90 | @butterknife.* ;
91 | }
92 | -keepclasseswithmembernames class * {
93 | @butterknife.* ;
94 | }
95 |
96 | -keep class jp.co.**{*;}
97 |
98 | -dontwarn com.googlecode.**
99 | -keep class com.googlecode.**{*;}
100 |
101 | -keep class org.easydarwin.video.recoder.**{*;}
102 | -keep class org.easydarwin.video.render.**{*;}
103 |
104 | -keepclassmembers class ** {public void onEvent*(**);}
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/Android/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-23
15 |
--------------------------------------------------------------------------------
/Android/res/anim/video_beautify_button_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
10 |
15 |
--------------------------------------------------------------------------------
/Android/res/anim/voide_beautify_button_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
11 |
16 |
--------------------------------------------------------------------------------
/Android/res/anim/voide_button_reenter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
12 |
--------------------------------------------------------------------------------
/Android/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Android/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Android/res/drawable-nodpi/easy_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-nodpi/easy_logo.png
--------------------------------------------------------------------------------
/Android/res/drawable-nodpi/lookup_amatorka.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-nodpi/lookup_amatorka.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/close_bn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/close_bn.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/icon_button_left_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/icon_button_left_white.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_back_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_back_down.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_back_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_back_normal.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_local_add_music_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_local_add_music_down.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_local_music.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_local_music.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_local_music_back_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_local_music_back_down.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_local_music_back_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_local_music_back_normal.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_local_no_music.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_local_no_music.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_local_play_music_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_local_play_music_down.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_local_play_music_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_local_play_music_normal.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_local_stop_music_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_local_stop_music_down.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_local_stop_music_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_local_stop_music_normal.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_local_switch_line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_local_switch_line.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_localmusic_edit_seekbar_thumbl.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_localmusic_edit_seekbar_thumbl.9.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_no_theme_filter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_no_theme_filter.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_silencer_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_silencer_normal.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_beautify_silencer_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_beautify_silencer_selected.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_player_play_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_player_play_icon.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_process_filter_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_process_filter_icon.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_process_filter_icon_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_process_filter_icon_bg.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_process_seekbar.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_process_seekbar.9.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_process_seekbar_thumb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_process_seekbar_thumb.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_record_backspace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_record_backspace.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_record_chage_camrea_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_record_chage_camrea_arrow.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_record_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_record_delete.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_record_image_focus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_record_image_focus.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_record_light_off_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_record_light_off_normal.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_record_ok.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_record_ok.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_record_start_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_record_start_btn.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_record_start_btn_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_record_start_btn_pressed.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_record_switch_camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_record_switch_camera.png
--------------------------------------------------------------------------------
/Android/res/drawable-xhdpi/video_watermark_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xhdpi/video_watermark_logo.png
--------------------------------------------------------------------------------
/Android/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Android/res/drawable/video_beautify_listview_item_selector.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 |
30 |
31 |
32 |
33 | -
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/Android/res/drawable/video_beautify_local_music_play_music_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Android/res/drawable/video_beautify_local_music_play_progress_style.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
12 |
13 |
14 |
15 | -
16 |
17 |
18 |
19 |
25 |
26 |
27 |
28 | -
29 |
30 |
31 |
32 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/Android/res/drawable/video_beautify_local_music_stop_music_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
8 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Android/res/drawable/video_beautify_local_music_table_text_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
8 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Android/res/drawable/video_beautify_local_nusic_back_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Android/res/drawable/video_beautify_title_back_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Android/res/drawable/video_process_filter_item_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Android/res/drawable/video_process_filter_item_shap.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Android/res/drawable/video_record_start_btn_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Android/res/layout/activity_start.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
12 |
13 |
19 |
24 |
25 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Android/res/layout/splash_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
23 |
24 |
--------------------------------------------------------------------------------
/Android/res/layout/video_beautify_local_music_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
23 |
24 |
31 |
32 |
41 |
42 |
43 |
48 |
49 |
50 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
70 |
71 |
72 |
73 |
77 |
78 |
79 |
80 |
81 |
82 |
86 |
87 |
88 |
89 |
90 |
91 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/Android/res/layout/video_beautify_local_music_hostory_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
24 |
25 |
--------------------------------------------------------------------------------
/Android/res/layout/video_beautify_local_music_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
24 |
25 |
--------------------------------------------------------------------------------
/Android/res/layout/video_beautify_local_music_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
23 |
24 |
34 |
35 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Android/res/layout/video_beautify_local_music_play_edit.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
22 |
23 |
31 |
32 |
42 |
43 |
53 |
54 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/Android/res/layout/video_beautify_local_music_table_content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
20 |
21 |
30 |
31 |
36 |
37 |
38 |
42 |
43 |
52 |
53 |
62 |
63 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/Android/res/layout/video_beautify_secected_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
20 |
21 |
28 |
29 |
30 |
33 |
34 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/Android/res/layout/video_play_activity.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/Android/res/layout/video_record_activity.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
14 |
20 |
21 |
29 |
30 |
37 |
38 |
44 |
45 |
46 |
47 |
53 |
54 |
58 |
59 |
63 |
64 |
69 |
70 |
74 |
75 |
76 |
77 |
82 |
83 |
88 |
89 |
93 |
94 |
95 |
103 |
104 |
111 |
112 |
119 |
120 |
129 |
130 |
131 |
--------------------------------------------------------------------------------
/Android/res/raw/tone_cuver_sample.acv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Android/res/raw/tone_cuver_sample.acv
--------------------------------------------------------------------------------
/Android/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Android/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Android/res/values/attrs.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 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Android/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | EasyVideoRecorder
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Android/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Android/res/values/video_beautify_colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #2a2a2a
5 | #e2d8c2
6 | #e2d8c2
7 | #313131
8 | #252525
9 | #F24AA0
10 | #e2d8c2
11 | #e2d8c2
12 | #1d1d1d
13 | #7d786d
14 | #1d1d1d
15 | #00000000
16 | #979797
17 | #ff000000
18 | #ffffff
19 | #00ffffff
20 | #eaeced
21 | #ee683e
22 | #F24AA0
23 | #333333
24 | #999999
25 | #ffffff
26 | #d74993
27 | #5ad7a9
28 | #ffffff
29 | #F24AA0
30 | #333333
31 | #F24AA0
32 | #dddfe0
33 | #dddfe0
34 |
35 |
--------------------------------------------------------------------------------
/Android/res/values/video_beautify_dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
9 | 52dp
10 | 12dp
11 | 6dp
12 | 6dp
13 | 12dp
14 | 10dp
15 | 10dp
16 | 52dp
17 | 18sp
18 | 18sp
19 |
20 | 150dp
21 | 143dp
22 | 90dp
23 | 9dp
24 | 53dp
25 | 14sp
26 | 4dp
27 | 10sp
28 | 10dp
29 | 8dp
30 | 55dp
31 | 55dp
32 |
33 | 12dp
34 | 5dp
35 | 4dp
36 | 22dp
37 |
38 |
39 | 2dp
40 |
41 | 4dp
42 | 6dp
43 | 6dp
44 | 4dp
45 | 10sp
46 | 300dip
47 | 111dp
48 | 171dp
49 | 4dp
50 |
51 | 60dp
52 | 48dp
53 | 12dp
54 | 12dp
55 | 16sp
56 | 16dp
57 | 12dp
58 | 12sp
59 | 8dp
60 | 12sp
61 | 12dp
62 | 14dp
63 | 12dp
64 | 12dp
65 | 12sp
66 | 8dp
67 | 8dp
68 | 14dp
69 | 8dp
70 | 15dp
71 | 16sp
72 | 4dp
73 | 1dp
74 |
75 |
--------------------------------------------------------------------------------
/Android/res/values/video_beautify_strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 视频美化
5 | 分享视频
6 | 设置
7 | 确定返回吗?特效将消失
8 | 确定返回吗?生成的视频将消失
9 | 已保存到手机
10 | 继续编辑
11 | 返回首页
12 |
13 | 预览
14 | 发布
15 | 主题
16 | 滤镜
17 | 无主题
18 | 配乐
19 | 配音
20 | 字幕
21 | 装饰
22 | 00:00
23 | 00:00
24 |
25 | 处理中\u2026\u0020
26 | 切换中
27 | 0
28 | %
29 | 原音开启
30 | 原音关闭
31 | 确定
32 | 取消
33 | 提示
34 | 确定放弃并重新拍摄吗?
35 | 保存成功
36 | 本地乐库
37 | 我的音乐
38 | 历史
39 | 小苹果
40 | 00:00
41 | 筷子兄弟-猛龙过江 电影原声带
42 | 确定放弃已编辑音乐吗?
43 | 本地暂时没有歌曲
44 | 还没有使用过本地歌曲
45 |
46 |
--------------------------------------------------------------------------------
/Android/res/values/video_recoder_colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #ffffffff
6 | #00ffffff
7 | #69F24AA0
8 |
9 |
10 | #222222
11 |
12 | #ff0000
13 |
14 | #4db288
15 |
16 | #f15369
17 |
18 | #FFFF00
19 | #C8FFFFFF
20 | #bababa
21 | #434343
22 | #96000000
23 |
24 |
--------------------------------------------------------------------------------
/Android/src/jp/co/cyberagent/android/gpuimage/util/TextureRotationUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 CyberAgent
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package jp.co.cyberagent.android.gpuimage.util;
18 |
19 | import jp.co.cyberagent.android.gpuimage.Rotation;
20 |
21 | public class TextureRotationUtil {
22 |
23 | public static final float TEXTURE_NO_ROTATION[] = { 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, };
24 |
25 | public static final float TEXTURE_ROTATED_90[] = { 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, };
26 | public static final float TEXTURE_ROTATED_180[] = { 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, };
27 | public static final float TEXTURE_ROTATED_270[] = { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, };
28 |
29 | private TextureRotationUtil() {
30 | }
31 |
32 | public static float[] getRotation(final Rotation rotation, final boolean flipHorizontal, final boolean flipVertical) {
33 | float[] rotatedTex;
34 | switch (rotation) {
35 | case ROTATION_90:
36 | rotatedTex = TEXTURE_ROTATED_90;
37 | break;
38 | case ROTATION_180:
39 | rotatedTex = TEXTURE_ROTATED_180;
40 | break;
41 | case ROTATION_270:
42 | rotatedTex = TEXTURE_ROTATED_270;
43 | break;
44 | case NORMAL:
45 | default:
46 | rotatedTex = TEXTURE_NO_ROTATION;
47 | break;
48 | }
49 | if (flipHorizontal) {
50 | rotatedTex = new float[] { flip(rotatedTex[0]), rotatedTex[1], flip(rotatedTex[2]), rotatedTex[3],
51 | flip(rotatedTex[4]), rotatedTex[5], flip(rotatedTex[6]), rotatedTex[7], };
52 | }
53 | if (flipVertical) {
54 | rotatedTex = new float[] { rotatedTex[0], flip(rotatedTex[1]), rotatedTex[2], flip(rotatedTex[3]),
55 | rotatedTex[4], flip(rotatedTex[5]), rotatedTex[6], flip(rotatedTex[7]), };
56 | }
57 | return rotatedTex;
58 | }
59 |
60 | private static float flip(final float i) {
61 | if (i == 0.0f) {
62 | return 1.0f;
63 | }
64 | return 0.0f;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/App.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video;
2 |
3 | import org.easydarwin.video.beautify.util.ProjectUtils;
4 |
5 | import android.app.Application;
6 | import android.content.Context;
7 |
8 | import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
9 | import com.nostra13.universalimageloader.core.ImageLoader;
10 | import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
11 | import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
12 |
13 | public class App extends Application {
14 |
15 | @Override
16 | public void onCreate() {
17 | super.onCreate();
18 | ProjectUtils.init(getApplicationContext());
19 | initImageLoader(getApplicationContext());
20 | }
21 |
22 | public static void initImageLoader(Context context) {
23 | ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
24 | .threadPriority(Thread.NORM_PRIORITY - 2)
25 | .denyCacheImageMultipleSizesInMemory()
26 | .diskCacheFileNameGenerator(new Md5FileNameGenerator())
27 | .diskCacheSize(50 * 1024 * 1024)
28 | .tasksProcessingOrder(QueueProcessingType.LIFO)
29 | .writeDebugLogs()
30 | .build();
31 | ImageLoader.getInstance().init(config);
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/SplashActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2013-2016 EasyDarwin.ORG. All rights reserved.
3 | Github: https://github.com/EasyDarwin
4 | WEChat: EasyDarwin
5 | Website: http://www.easydarwin.org
6 | */
7 | package org.easydarwin.video;
8 |
9 | import org.easydarwin.video.recoder.activity.VideoRecorderActivity;
10 |
11 | import android.app.Activity;
12 | import android.content.Intent;
13 | import android.os.Bundle;
14 | import android.os.Handler;
15 |
16 | public class SplashActivity extends Activity{
17 |
18 | @Override
19 | protected void onCreate(Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | setContentView(R.layout.splash_activity);
22 |
23 | new Handler().postDelayed(new Runnable() {
24 |
25 | @Override
26 | public void run() {
27 | startActivity(new Intent(SplashActivity.this,VideoRecorderActivity.class));
28 | SplashActivity.this.finish();
29 | }
30 | }, 2000);
31 |
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/StartActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2013-2016 EasyDarwin.ORG. All rights reserved.
3 | Github: https://github.com/EasyDarwin
4 | WEChat: EasyDarwin
5 | Website: http://www.easydarwin.org
6 | */
7 | package org.easydarwin.video;
8 |
9 | import org.easydarwin.video.recoder.activity.VideoRecorderActivity;
10 | import org.easydarwin.video.recoder.base.BaseActivity;
11 |
12 | import android.os.Bundle;
13 | import android.view.View;
14 | import android.widget.Button;
15 | import butterknife.InjectView;
16 | import butterknife.OnClick;
17 |
18 | public class StartActivity extends BaseActivity {
19 |
20 | @InjectView(R.id.start)
21 | Button start;
22 |
23 | @Override
24 | protected void onCreate(Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.activity_start);
27 | }
28 |
29 | @OnClick(R.id.start)
30 | public void onStartClick(View v) {
31 | startActivity(VideoRecorderActivity.class);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/VideoPlayActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2013-2016 EasyDarwin.ORG. All rights reserved.
3 | Github: https://github.com/EasyDarwin
4 | WEChat: EasyDarwin
5 | Website: http://www.easydarwin.org
6 | */
7 | package org.easydarwin.video;
8 |
9 | import android.app.Activity;
10 | import android.os.Bundle;
11 | import android.widget.MediaController;
12 | import android.widget.VideoView;
13 |
14 | public class VideoPlayActivity extends Activity {
15 |
16 | VideoView player;
17 | MediaController mediaController;
18 |
19 | @Override
20 | protected void onCreate(Bundle savedInstanceState) {
21 | super.onCreate(savedInstanceState);
22 | setContentView(R.layout.video_play_activity);
23 | String uri = getIntent().getStringExtra("path");
24 | player = (VideoView) findViewById(R.id.player);
25 | player.setVideoPath(uri);
26 | mediaController = new MediaController(this);
27 | player.setMediaController(mediaController);
28 | mediaController.setMediaPlayer(player);
29 | }
30 |
31 | @Override
32 | protected void onResume() {
33 | super.onResume();
34 | player.requestFocus();
35 | player.start();
36 | }
37 |
38 | @Override
39 | protected void onPause() {
40 | super.onPause();
41 | player.stopPlayback();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/adapter/VideoBeautifyMusicAdapter.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.adapter;
2 |
3 | import java.util.List;
4 |
5 | import org.easydarwin.video.R;
6 | import org.easydarwin.video.beautify.model.LocalMusicLoader;
7 | import org.easydarwin.video.beautify.util.DateUtils;
8 |
9 | import android.content.Context;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.BaseAdapter;
13 | import android.widget.RelativeLayout;
14 | import android.widget.TextView;
15 |
16 | public class VideoBeautifyMusicAdapter extends BaseAdapter {
17 |
18 | private final Context mContext;
19 | private final List models;
20 | private int selectIndex = 0;
21 |
22 | public VideoBeautifyMusicAdapter(Context mContext, List models) {
23 | this.mContext = mContext;
24 | this.models = models;
25 | }
26 |
27 | public void setSelectIndex(int i) {
28 | selectIndex = i;
29 | }
30 |
31 | @Override
32 | public int getCount() {
33 | return models != null ? models.size() : 0;
34 | }
35 |
36 | @Override
37 | public Object getItem(int position) {
38 | return models != null && models.size() > 0 ? models.get(position) : null;
39 | }
40 |
41 | @Override
42 | public long getItemId(int position) {
43 | return position;
44 | }
45 |
46 | @Override
47 | public View getView(final int position, View convertView, ViewGroup parent) {
48 | ViewHolder holder = null;
49 | if (convertView == null) {
50 | holder = new ViewHolder();
51 | convertView = View.inflate(mContext, R.layout.video_beautify_local_music_list_item, null);
52 | holder.musicItem = (RelativeLayout) convertView.findViewById(R.id.local_music_list_item);
53 | holder.name = (TextView) convertView.findViewById(R.id.local_music_name);
54 | holder.introduction = (TextView) convertView.findViewById(R.id.local_music_introduction);
55 | holder.playTime = (TextView) convertView.findViewById(R.id.local_music_play_time);
56 |
57 | convertView.setTag(holder);
58 | } else {
59 | holder = (ViewHolder) convertView.getTag();
60 | }
61 |
62 | if (models != null && models.size() > 0) {
63 |
64 | LocalMusicLoader.LocalMusic model = models.get(position);
65 |
66 | if (model != null) {
67 | holder.name.setText(model.getName());
68 | if (model.getIntroduction() != null) {
69 | holder.introduction.setText(model.getIntroduction());
70 | } else {
71 | holder.introduction.setText("");
72 | }
73 | if (selectIndex == position) {
74 | holder.musicItem.setBackgroundColor(0xffeaeced);
75 | } else {
76 | holder.musicItem.setBackgroundColor(0x00ffffff);
77 |
78 | }
79 | if (model.getPlayTime() != null) {
80 | holder.playTime.setText(DateUtils.formateTime(Integer.parseInt(model.getPlayTime()), "00:00"));
81 | } else {
82 | holder.playTime.setText("");
83 |
84 | }
85 | }
86 |
87 | }
88 | return convertView;
89 | }
90 |
91 | class ViewHolder {
92 | TextView name; //歌名
93 | TextView introduction; //音乐简介
94 | TextView playTime; //播放时间
95 | RelativeLayout musicItem; //本地音乐Item
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/adapter/VideoBeautifyMusicHistoryAdapter.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.adapter;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 | import java.util.Map;
6 |
7 | import org.easydarwin.video.R;
8 | import org.easydarwin.video.beautify.util.DateUtils;
9 |
10 | import android.content.Context;
11 | import android.view.View;
12 | import android.view.ViewGroup;
13 | import android.widget.BaseAdapter;
14 | import android.widget.RelativeLayout;
15 | import android.widget.TextView;
16 |
17 | public class VideoBeautifyMusicHistoryAdapter extends BaseAdapter {
18 | private final Context mContext;
19 | private List models = new ArrayList();
20 |
21 | private int selectIndex = -1;
22 |
23 | public VideoBeautifyMusicHistoryAdapter(Context mContext, Map model) {
24 | this.mContext = mContext;
25 | for (Map.Entry entry : model.entrySet()) {
26 | models.add((String) entry.getValue());
27 | }
28 | }
29 |
30 | public void setSelectIndex(int i) {
31 | selectIndex = i;
32 | }
33 |
34 | @Override
35 | public int getCount() {
36 | return models != null ? models.size() : 0;
37 | }
38 |
39 | @Override
40 | public Object getItem(int position) {
41 | return models != null && models.size() > 0 ? models.get(position) : null;
42 | }
43 |
44 | @Override
45 | public long getItemId(int position) {
46 | return position;
47 | }
48 |
49 | @Override
50 | public View getView(final int position, View convertView, ViewGroup parent) {
51 | ViewHolder holder = null;
52 | if (convertView == null) {
53 | holder = new ViewHolder();
54 | convertView = View.inflate(mContext, R.layout.video_beautify_local_music_list_item, null);
55 | holder.musicItem = (RelativeLayout) convertView.findViewById(R.id.local_music_list_item);
56 | holder.name = (TextView) convertView.findViewById(R.id.local_music_name);
57 | holder.introduction = (TextView) convertView.findViewById(R.id.local_music_introduction);
58 | holder.playTime = (TextView) convertView.findViewById(R.id.local_music_play_time);
59 |
60 | convertView.setTag(holder);
61 | } else {
62 | holder = (ViewHolder) convertView.getTag();
63 | }
64 |
65 | if (models != null && models.size() > 0) {
66 |
67 | String model = models.get(position);
68 |
69 | if (model != null) {
70 | String[] musicHistory = model.split(",");
71 | holder.name.setText(musicHistory[0]);
72 | holder.introduction.setText(musicHistory[1]);
73 | if (selectIndex == position) {
74 | holder.musicItem.setBackgroundColor(0xffeaeced);
75 | } else {
76 | holder.musicItem.setBackgroundColor(0x00ffffff);
77 | }
78 | holder.playTime.setText(DateUtils.formateTime(Integer.parseInt(musicHistory[2]), "00:00"));
79 | }
80 |
81 | }
82 | return convertView;
83 | }
84 |
85 | class ViewHolder {
86 | TextView name; //歌名
87 | TextView introduction; //音乐简介
88 | TextView playTime; //播放时间
89 | RelativeLayout musicItem; //本地音乐Item
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/adapter/VideoBeautifyThemeAdapter.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.adapter;
2 |
3 | import java.util.List;
4 |
5 | import org.easydarwin.video.R;
6 | import org.easydarwin.video.beautify.model.VideoBeautifyTheme;
7 | import org.easydarwin.video.beautify.view.CustomImageView;
8 |
9 | import android.content.Context;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.BaseAdapter;
13 | import android.widget.TextView;
14 |
15 | public class VideoBeautifyThemeAdapter extends BaseAdapter {
16 |
17 | private final Context mContext;
18 | private final List models;
19 | private int selectIndex = -1;
20 |
21 | public void setSelectIndex(int i) {
22 | selectIndex = i;
23 | }
24 |
25 | public VideoBeautifyThemeAdapter(Context mContext, List models) {
26 | this.mContext = mContext;
27 | this.models = models;
28 | }
29 |
30 | @Override
31 | public int getCount() {
32 | return models != null ? models.size() : 0;
33 | }
34 |
35 | @Override
36 | public Object getItem(int position) {
37 | return models != null && models.size() > 0 ? models.get(position) : null;
38 | }
39 |
40 | @Override
41 | public long getItemId(int position) {
42 | return position;
43 | }
44 |
45 | @Override
46 | public View getView(int position, View convertView, ViewGroup parent) {
47 | ViewHolder holder = null;
48 | if (convertView == null) {
49 | holder = new ViewHolder();
50 | convertView = View.inflate(mContext, R.layout.video_beautify_secected_item, null);
51 | holder.imageView = (CustomImageView) convertView.findViewById(R.id.secected_item_image);
52 | holder.textView = (TextView) convertView.findViewById(R.id.secected_item_text);
53 |
54 | convertView.setTag(holder);
55 |
56 | } else {
57 | holder = (ViewHolder) convertView.getTag();
58 | }
59 |
60 | // 绑定数据
61 | if (models != null && models.size() > 0) {
62 |
63 | VideoBeautifyTheme model = models.get(position);
64 | if (model != null) {
65 | holder.textView.setText(model.getName());
66 | // 新加图片的显示
67 | if (model.getImage() == null) {
68 | holder.imageView.setImageResource(R.drawable.video_beautify_no_theme_filter);
69 | } else {
70 | holder.imageView.setImageBitmap(model.getImage());
71 | }
72 | }
73 | // 新加选中的效果
74 | if (position == selectIndex) {
75 | convertView.setSelected(true);
76 | } else {
77 | convertView.setSelected(false);
78 | }
79 | }
80 | return convertView;
81 | }
82 |
83 | class ViewHolder {
84 | private CustomImageView imageView;
85 | private TextView textView;
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/conf/Conf.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.conf;
2 |
3 | public class Conf {
4 | public static final String BASE_DIR = "/org.easydarwin.video";
5 | public static final String TMP_DIR = BASE_DIR + "/tmp";
6 | public static final String VS_DIR = BASE_DIR + "/.vs";
7 | public static final String VIDEO_TMP_DIR = TMP_DIR + "/.video";
8 | public static final String IMG_TMP_DIR = TMP_DIR + "/.img";
9 | public static final String AUDIO_TMP_DIR = TMP_DIR + "/.audio";
10 | public static final int VIDEO_FRAMERATE = 25;
11 | public static final boolean TEST_VIDEO_PREVIEW = false;
12 | public static final int V_RE_MAX = 1 * 60 * 1000;
13 | public static final int V_RE_MIN = 8 * 1000;
14 | public static final int A_RE_MAX = 5 * 60 * 1000;
15 | public static final int A_RE_MIN = 10 * 1000;
16 | public static final int V_IN_MAX = 60 * 1000;
17 | public static final int V_IN_MIN = 2 * 1000;
18 | public static final String V_IN_MAX_DES = "1分钟";
19 | public static String SAVE_EFFECT_PATH = "/org.easydarwin.video/effect";
20 | public static String ROOT_FILE_PATH = "org.easydarwin.video";
21 | public static String V = "15";
22 | }
23 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/listener/OnMusicViewChangeListener.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.listener;
2 |
3 | public interface OnMusicViewChangeListener {
4 | public void OnViewChange(int view);
5 | }
6 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/listener/ViewOnTouchListener.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.listener;
2 |
3 | import android.view.MotionEvent;
4 | import android.view.View;
5 | import android.widget.FrameLayout;
6 |
7 | public class ViewOnTouchListener implements View.OnTouchListener {
8 | Point pushPoint;
9 | int lastImgLeft;
10 | int lastImgTop;
11 | FrameLayout.LayoutParams viewLP;
12 | FrameLayout.LayoutParams pushBtnLP;
13 | int lastPushBtnLeft;
14 | int lastPushBtnTop;
15 | private View mPushView;
16 |
17 | public ViewOnTouchListener(View mPushView) {
18 | this.mPushView = mPushView;
19 |
20 | }
21 |
22 | @Override
23 | public boolean onTouch(View view, MotionEvent event) {
24 | switch (event.getAction() & MotionEvent.ACTION_MASK) {
25 | case MotionEvent.ACTION_DOWN:
26 | if (null == viewLP) {
27 | viewLP = (FrameLayout.LayoutParams) view.getLayoutParams();
28 | }
29 | if (null == pushBtnLP) {
30 | pushBtnLP = (FrameLayout.LayoutParams) mPushView.getLayoutParams();
31 | }
32 | pushPoint = getRawPoint(event);
33 | lastImgLeft = viewLP.leftMargin;
34 | lastImgTop = viewLP.topMargin;
35 | lastPushBtnLeft = pushBtnLP.leftMargin;
36 | lastPushBtnTop = pushBtnLP.topMargin;
37 | break;
38 | case MotionEvent.ACTION_MOVE:
39 | Point newPoint = getRawPoint(event);
40 | float moveX = newPoint.x - pushPoint.x;
41 | float moveY = newPoint.y - pushPoint.y;
42 |
43 | viewLP.leftMargin = (int) (lastImgLeft + moveX);
44 | viewLP.topMargin = (int) (lastImgTop + moveY);
45 | view.setLayoutParams(viewLP);
46 |
47 | pushBtnLP.leftMargin = (int) (lastPushBtnLeft + moveX);
48 | pushBtnLP.topMargin = (int) (lastPushBtnTop + moveY);
49 | mPushView.setLayoutParams(pushBtnLP);
50 |
51 | break;
52 |
53 | }
54 | return false;
55 | }
56 |
57 | private Point getRawPoint(MotionEvent event) {
58 | return new Point((int) event.getRawX(), (int) event.getRawY());
59 | }
60 |
61 | public class Point {
62 | public float x;
63 | public float y;
64 |
65 | public Point(float x, float y) {
66 | this.x = x;
67 | this.y = y;
68 | }
69 |
70 | @Override
71 | public String toString() {
72 | return "x: " + x + ",y: " + y;
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/model/GalleryModel.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import android.graphics.Bitmap;
6 | import android.net.Uri;
7 |
8 | public class GalleryModel implements Serializable {
9 |
10 | private static final long serialVersionUID = 5751407082315686041L;
11 |
12 | private String id;
13 |
14 | private Bitmap image;
15 |
16 | private Uri imageUri;
17 |
18 | private int frameIndex;
19 |
20 | public GalleryModel() {
21 | super();
22 | }
23 |
24 | public GalleryModel(Uri imageUri, int frameIndex) {
25 | super();
26 | this.imageUri = imageUri;
27 | this.frameIndex = frameIndex;
28 | }
29 |
30 | public String getId() {
31 | return id;
32 | }
33 |
34 | public void setId(String id) {
35 | this.id = id;
36 | }
37 |
38 | public Bitmap getImage() {
39 | return image;
40 | }
41 |
42 | public void setImage(Bitmap image) {
43 | this.image = image;
44 | }
45 |
46 | public int getFrameIndex() {
47 | return frameIndex;
48 | }
49 |
50 | public void setFrameIndex(int frameIndex) {
51 | this.frameIndex = frameIndex;
52 | }
53 |
54 | public Uri getImageUri() {
55 | return imageUri;
56 | }
57 |
58 | public void setImageUri(Uri imageUri) {
59 | this.imageUri = imageUri;
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/model/LocalMusicLoader.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.model;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import android.content.ContentResolver;
7 | import android.database.Cursor;
8 | import android.net.Uri;
9 | import android.os.Parcel;
10 | import android.os.Parcelable;
11 | import android.provider.MediaStore.Audio.AudioColumns;
12 | import android.provider.MediaStore.Audio.Media;
13 | import android.provider.MediaStore.MediaColumns;
14 | import android.util.Log;
15 |
16 | public class LocalMusicLoader {
17 |
18 | private static final String TAG = "LocalMusicLoader";
19 |
20 | private List musicList = new ArrayList();
21 |
22 | private static LocalMusicLoader musicLoader;
23 |
24 | private static ContentResolver contentResolver;
25 |
26 | private Uri contentUri = Media.EXTERNAL_CONTENT_URI;
27 |
28 | public static LocalMusicLoader instance(ContentResolver pContentResolver) {
29 | if (musicLoader == null) {
30 | contentResolver = pContentResolver;
31 | musicLoader = new LocalMusicLoader();
32 | }
33 | return musicLoader;
34 | }
35 |
36 | private LocalMusicLoader() {
37 | LocalMusicLoader.LocalMusic music = new LocalMusicLoader.LocalMusic();
38 | music.setName("无配乐");
39 | music.setUrl(null);
40 | music.setPlayTime(null);
41 | music.setIntroduction(null);
42 | musicList.add(music);
43 | Cursor cursor = contentResolver.query(contentUri, null, null, null, null);
44 | if (cursor == null) {
45 | Log.v(TAG, "Line(39 ) Music Loader cursor == null.");
46 | } else if (!cursor.moveToFirst()) {
47 | Log.v(TAG, "Line(41 ) Music Loader cursor.moveToFirst() returns false.");
48 | } else {
49 | int displayNameCol = cursor.getColumnIndex(MediaColumns.TITLE);
50 | int albumCol = cursor.getColumnIndex(AudioColumns.ALBUM);
51 | int urlCol = cursor.getColumnIndex(MediaColumns.DATA);
52 | int durationCol = cursor.getColumnIndex(AudioColumns.DURATION);
53 | do {
54 | String title = cursor.getString(displayNameCol);
55 | String album = cursor.getString(albumCol);
56 | int duration = cursor.getInt(durationCol);
57 | String url = cursor.getString(urlCol);
58 | if (url.contains(".mp3") && duration > 10000) {
59 | LocalMusic localMusic = new LocalMusic();
60 | localMusic.setName(title);
61 | localMusic.setIntroduction(album);
62 | localMusic.setUrl(url);
63 | localMusic.setPlayTime(duration + "");
64 | musicList.add(localMusic);
65 | }
66 | } while (cursor.moveToNext());
67 | }
68 | }
69 |
70 | public List getMusicList() {
71 | return musicList;
72 | }
73 |
74 | public class LocalMusic implements Parcelable {
75 | private String name; //音乐名称
76 |
77 | private String playTime; //音乐时长
78 |
79 | private int playProTime; //音乐进度
80 |
81 | private String isSelected; //是否选中
82 |
83 | private String isPlay; //是否正在播放
84 |
85 | private String introduction; //音乐简介
86 |
87 | private String url; //音乐路径
88 |
89 | public String getName() {
90 | return name;
91 | }
92 |
93 | public void setName(String name) {
94 | this.name = name;
95 | }
96 |
97 | public String getPlayTime() {
98 | return playTime;
99 | }
100 |
101 | public void setPlayTime(String playTime) {
102 | this.playTime = playTime;
103 | }
104 |
105 | public int getPlayProTime() {
106 | return playProTime;
107 | }
108 |
109 | public void setPlayProTime(int playProTime) {
110 | this.playProTime = playProTime;
111 | }
112 |
113 | public String getIsSelected() {
114 | return isSelected;
115 | }
116 |
117 | public void setIsSelected(String isSelected) {
118 | this.isSelected = isSelected;
119 | }
120 |
121 | public String getIsPlay() {
122 | return isPlay;
123 | }
124 |
125 | public void setIsPlay(String isPlay) {
126 | this.isPlay = isPlay;
127 | }
128 |
129 | public String getIntroduction() {
130 | return introduction;
131 | }
132 |
133 | public void setIntroduction(String introduction) {
134 | this.introduction = introduction;
135 | }
136 |
137 | public String getUrl() {
138 | return url;
139 | }
140 |
141 | public void setUrl(String url) {
142 | this.url = url;
143 | }
144 |
145 | @Override
146 | public int describeContents() {
147 | return 0;
148 | }
149 |
150 | @Override
151 | public void writeToParcel(Parcel dest, int flags) {
152 | dest.writeString(name);
153 | dest.writeString(playTime);
154 | dest.writeInt(playProTime);
155 | dest.writeString(isSelected);
156 | dest.writeString(isPlay);
157 | dest.writeString(introduction);
158 | dest.writeString(url);
159 | }
160 |
161 | public final Parcelable.Creator CREATOR = new Creator() {
162 |
163 | @Override
164 | public LocalMusic[] newArray(int size) {
165 | return new LocalMusic[size];
166 | }
167 |
168 | @Override
169 | public LocalMusic createFromParcel(Parcel source) {
170 | LocalMusic musicInfo = new LocalMusic();
171 | musicInfo.setName(source.readString());
172 | musicInfo.setPlayTime(source.readString());
173 | musicInfo.setPlayProTime(source.readInt());
174 | musicInfo.setIsSelected(source.readString());
175 | musicInfo.setIsPlay(source.readString());
176 | musicInfo.setIntroduction(source.readString());
177 | musicInfo.setUrl(source.readString());
178 | return musicInfo;
179 | }
180 | };
181 | }
182 | }
183 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/model/ProcessTask.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | package org.easydarwin.video.beautify.model;
5 |
6 | import org.easydarwin.video.beautify.template.AudioClip;
7 | import org.easydarwin.video.beautify.template.Filter;
8 | import org.easydarwin.video.beautify.template.Tittle;
9 |
10 | import android.net.Uri;
11 |
12 | public class ProcessTask {
13 | /**
14 | * 视频文件地址
15 | */
16 | private Uri uri;
17 | /**
18 | * 是否消音
19 | */
20 | private volatile boolean isMute = false;
21 |
22 | public Uri getUri() {
23 | return uri;
24 | }
25 |
26 | public ProcessTask setUri(Uri uri) {
27 | this.uri = uri;
28 | return this;
29 | }
30 |
31 | public boolean isMute() {
32 | return isMute;
33 | }
34 |
35 | public ProcessTask setMute(boolean isMute) {
36 | this.isMute = isMute;
37 | return this;
38 | }
39 |
40 | // 主题
41 | private String themeId;
42 |
43 | // 滤镜
44 | private String filterId;
45 |
46 | // 装饰
47 | private Filter decorateFilter = null;
48 |
49 | // 字幕
50 | private Tittle[] titlles = null;
51 |
52 | // 配音
53 | private AudioClip[] audioClips = null;
54 |
55 | // 配乐
56 | private AudioClip music = null;
57 |
58 | public String getThemeId() {
59 | return themeId;
60 | }
61 |
62 | public void setThemeId(String themeId) {
63 | this.themeId = themeId;
64 | }
65 |
66 | public String getFilterId() {
67 | return filterId;
68 | }
69 |
70 | public void setFilterId(String filterId) {
71 | this.filterId = filterId;
72 | }
73 |
74 | public Filter getDecorateFilter() {
75 | return decorateFilter;
76 | }
77 |
78 | public void setDecorateFilter(Filter decorateFilter) {
79 | this.decorateFilter = decorateFilter;
80 | }
81 |
82 | public Tittle[] getTitlles() {
83 | return titlles;
84 | }
85 |
86 | public void setTitlles(Tittle[] titlles) {
87 | this.titlles = titlles;
88 | }
89 |
90 | public AudioClip[] getAudioClips() {
91 | return audioClips;
92 | }
93 |
94 | public void setAudioClips(AudioClip[] audioClips) {
95 | this.audioClips = audioClips;
96 | }
97 |
98 | public AudioClip getMusic() {
99 | return music;
100 | }
101 |
102 | public void setMusic(AudioClip music) {
103 | this.music = music;
104 | }
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/model/Type.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.model;
2 |
3 | public class Type {
4 | public final static int TABLE_TYPE_THEME = 1;
5 | public final static int TABLE_TYPE_FILTER = 2;
6 | public final static int TABLE_TYPE_MUSIC = 3;
7 | public final static int TABLE_TYPE_DECORATE = 4;
8 | public final static int TABLE_TYPE_CARTOON = 8;
9 | public final static int TABLE_TYPE_SUBTITLE = 5;
10 | public final static int TABLE_TYPE_DUB = 6;
11 |
12 | public final static int TABLE_TYPE_BUBBLE = 7;
13 | public final static int TABLE_TYPE_FONT = 8;
14 | public final static int TABLE_TYPE_STYLE = 9;
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/model/VideoBeautifyTheme.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.model;
2 |
3 | import android.graphics.Bitmap;
4 |
5 | public class VideoBeautifyTheme {
6 | private String type;// 为了区别主题和滤镜1表示主题,2表示滤镜
7 | private String id; // ID
8 | private String name; // 名
9 | private Bitmap image; // //图片icon
10 | private String imagepath;
11 | private String download;// 是否是下载的资源0表示 内置资源1表示下载资源
12 |
13 | public VideoBeautifyTheme() {
14 |
15 | }
16 |
17 | public String getId() {
18 | return id;
19 | }
20 |
21 | public void setId(String id) {
22 | this.id = id;
23 | }
24 |
25 | public String getName() {
26 | return name;
27 | }
28 |
29 | public void setName(String name) {
30 | this.name = name;
31 | }
32 |
33 | public Bitmap getImage() {
34 | return image;
35 | }
36 |
37 | public void setImage(Bitmap image) {
38 | this.image = image;
39 | }
40 |
41 | public String getType() {
42 | return type;
43 | }
44 |
45 | public void setType(String type) {
46 | this.type = type;
47 | }
48 |
49 | public String getImagepath() {
50 | return imagepath;
51 | }
52 |
53 | public void setImagepath(String imagepath) {
54 | this.imagepath = imagepath;
55 | }
56 |
57 | public String getDownload() {
58 | return download;
59 | }
60 |
61 | public void setDownload(String download) {
62 | this.download = download;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/store/VideoBeautifySharedPrefs.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.store;
2 |
3 | import java.util.Map;
4 |
5 | import android.content.Context;
6 | import android.content.SharedPreferences;
7 | import android.content.SharedPreferences.Editor;
8 |
9 | /**
10 | * SharedPreferences 存储数据方式工具类
11 | *
12 | */
13 | public class VideoBeautifySharedPrefs {
14 |
15 | public final static String SETTING = "ViedoBeautify";
16 |
17 | public static void putValue(Context context, String key, int value) {
18 | Editor sp = context.getSharedPreferences(SETTING, Context.MODE_PRIVATE).edit();
19 | sp.putInt(key, value);
20 | sp.commit();
21 | }
22 |
23 | public static void putValue(Context context, String key, boolean value) {
24 | Editor sp = context.getSharedPreferences(SETTING, Context.MODE_PRIVATE).edit();
25 | sp.putBoolean(key, value);
26 | sp.commit();
27 | }
28 |
29 | public static void putValue(Context context, String key, String value) {
30 | Editor sp = context.getSharedPreferences(SETTING, Context.MODE_PRIVATE).edit();
31 | sp.putString(key, value);
32 | sp.commit();
33 | }
34 |
35 | public static int getValue(Context context, String key, int defValue) {
36 | SharedPreferences sp = context.getSharedPreferences(SETTING, Context.MODE_PRIVATE);
37 | int value = sp.getInt(key, defValue);
38 | return value;
39 | }
40 |
41 | public static boolean getValue(Context context, String key, boolean defValue) {
42 | SharedPreferences sp = context.getSharedPreferences(SETTING, Context.MODE_PRIVATE);
43 | boolean value = sp.getBoolean(key, defValue);
44 | return value;
45 | }
46 |
47 | public static String getValue(Context context, String key, String defValue) {
48 | SharedPreferences sp = context.getSharedPreferences(SETTING, Context.MODE_PRIVATE);
49 | String value = sp.getString(key, defValue);
50 | return value;
51 | }
52 |
53 | public static Map getAll(Context context) {
54 | SharedPreferences preference = context.getSharedPreferences(SETTING, Context.MODE_PRIVATE);
55 | return preference.getAll();
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/task/ProgressDialogTask.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.task;
2 |
3 | import org.easydarwin.video.beautify.activity.VideoBeautifyActivity;
4 | import org.easydarwin.video.beautify.model.ProcessTask;
5 |
6 | import android.content.Context;
7 | import android.media.MediaScannerConnection;
8 | import android.net.Uri;
9 | import android.os.AsyncTask;
10 | import android.os.SystemClock;
11 | import android.util.Log;
12 |
13 | public class ProgressDialogTask extends AsyncTask {
14 | private final static String LOG_TAG = "ProgressDialogTask";
15 | private VideoBeautifyActivity mVideoBeautifyActivity;
16 | private boolean mIsPreview;
17 | private boolean mIsSaveFile;
18 | private Context mContext;
19 | public ProgressDialogTask(VideoBeautifyActivity VideoBeautifyActivity,Context ctx, boolean isPreview, boolean isSaveFile) {
20 | super();
21 | mVideoBeautifyActivity = VideoBeautifyActivity;
22 | mIsPreview = isPreview;
23 | mIsSaveFile = isSaveFile;
24 | mContext=ctx;
25 | }
26 |
27 | @Override
28 | protected Uri doInBackground(ProcessTask... params) {
29 | Log.v(LOG_TAG, LOG_TAG + ": doInBackground begin");
30 | VideoProcessor videoProcessor = new VideoProcessor(params[0],mContext);
31 | videoProcessor.setPreview(mIsPreview);
32 | videoProcessor.setSaveFile(mIsSaveFile);
33 | videoProcessor.process();
34 | int progress = 0;
35 | while (!videoProcessor.isDone()) {
36 | if (isCancelled()) {// && videoProcessor.isPreview()// 输出文件不中断
37 | videoProcessor.setSynthesis(true); // block until vieoproject thread exit
38 | break;
39 | }
40 | if (!mIsPreview) {
41 | progress = videoProcessor.getProgress();
42 | publishProgress(progress);
43 | }
44 | SystemClock.sleep(10);///////////////////////////////
45 | }
46 | Log.v(LOG_TAG, LOG_TAG + ": doInBackground end");
47 | return videoProcessor.getProcessedUri();// 返回处理后视频路径
48 | }
49 |
50 | @Override
51 | protected void onPostExecute(Uri result) {
52 | Log.v(LOG_TAG, LOG_TAG + ": onPostExecute begin");
53 | mVideoBeautifyActivity.taskFinished(result);
54 | if (!mIsPreview && !mIsSaveFile) {
55 | SystemClock.sleep(500);
56 | Log.v(LOG_TAG, LOG_TAG + ": onPostExecute end(convert)");
57 | return;
58 | } else if (mIsSaveFile) {
59 | MediaScannerConnection.scanFile(mVideoBeautifyActivity, new String[] { result.getPath() }, null, null);
60 | }
61 | }
62 |
63 | @Override
64 | protected void onPreExecute() {
65 | }
66 |
67 | @Override
68 | protected void onProgressUpdate(Integer... values) {
69 | mVideoBeautifyActivity.updateProgress(values[0]);
70 | }
71 |
72 | @Override
73 | protected void onCancelled() {
74 | mVideoBeautifyActivity.preTaskCancelled();
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/task/VideoProcessor.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.task;
2 |
3 | import java.io.File;
4 | import java.io.PrintWriter;
5 | import java.io.Serializable;
6 | import java.io.StringWriter;
7 |
8 | import org.easydarwin.video.beautify.conf.Conf;
9 | import org.easydarwin.video.beautify.model.ProcessTask;
10 | import org.easydarwin.video.beautify.template.VideoProjectUtils;
11 | import org.easydarwin.video.beautify.util.ProjectUtils;
12 |
13 | import android.content.Context;
14 | import android.graphics.Bitmap;
15 | import android.net.Uri;
16 | import android.util.Log;
17 |
18 | public class VideoProcessor implements Runnable {
19 | private final static String LOG_TAG = "VideoProcessor";
20 | private volatile int progress = 0;
21 | private volatile ProcessTask processTask;
22 | private volatile Uri processedUri;
23 | private volatile boolean isDone = false;
24 | private volatile boolean isSynthesis = false; //结束符
25 | private volatile boolean isPreview = false; //是否预览
26 | private volatile boolean isSaveFile = false; //保存文件
27 | private final int FrameRate = 1000/Conf.VIDEO_FRAMERATE; //40ms 播放一帧
28 | private Thread mVideoProjectThread;
29 | private static FilterListener filterL;
30 | private Bitmap bit;
31 | private Context mContext;
32 |
33 | public void process() {
34 | mVideoProjectThread = new Thread(this);
35 | mVideoProjectThread.start();
36 | }
37 |
38 | public VideoProcessor(ProcessTask processTask,Context ctx) {
39 | this.processTask = processTask;
40 | mContext=ctx;
41 | }
42 |
43 | public int getProgress() {
44 | return progress;
45 | }
46 |
47 | @Override
48 | public void run() {
49 | new VideoProjectUtils().excute(this,mContext);
50 | }
51 |
52 | public boolean isDone() {
53 | return isDone;
54 | }
55 |
56 | public Uri getProcessedUri() {
57 | return processedUri;
58 | }
59 |
60 | public ProcessTask getProcessTask() {
61 | return processTask;
62 | }
63 |
64 | public void setProgress(int progress) {
65 | this.progress = progress;
66 | }
67 |
68 | public void setDone(boolean isDone) {
69 | this.isDone = isDone;
70 | }
71 |
72 | public boolean isSynthesis() {
73 | return isSynthesis;
74 | }
75 |
76 | public void setSynthesis(boolean isSynthesis) {
77 | this.isSynthesis = isSynthesis;
78 | if (isSynthesis) {
79 | if (mVideoProjectThread != null) {
80 | try {
81 | mVideoProjectThread.join();
82 |
83 | } catch (InterruptedException in) {
84 | StringWriter errors = new StringWriter();
85 | PrintWriter printer = new PrintWriter(errors);
86 | in.printStackTrace(printer);
87 | Log.e(LOG_TAG, "mVideoProjectThread.join() " + errors.toString());
88 | printer = null;
89 | errors = null;
90 | }
91 | }
92 | }
93 | }
94 |
95 | public boolean isPreview() {
96 | return isPreview;
97 | }
98 |
99 | public void setPreview(boolean isPreview) {
100 | this.isPreview = isPreview;
101 | }
102 |
103 | public int getFrameRate() {
104 | return FrameRate;
105 | }
106 |
107 | public void setProcessTask(ProcessTask processTask) {
108 | this.processTask = processTask;
109 | }
110 |
111 | public void setProcessedUri(Uri processedUri) {
112 | this.processedUri = processedUri;
113 | }
114 |
115 | public boolean isSaveFile() {
116 | return isSaveFile;
117 | }
118 |
119 | public void setSaveFile(boolean isSaveFile) {
120 | this.isSaveFile = isSaveFile;
121 | }
122 |
123 | public static FilterListener getFilterL() {
124 | return filterL;
125 | }
126 |
127 | public static void setFilterL(FilterListener L) {
128 | filterL = L;
129 | }
130 |
131 | public Bitmap getBit() {
132 | return bit;
133 | }
134 |
135 | public void setBit(Bitmap bit) {
136 | this.bit = bit;
137 | }
138 |
139 | public String getOutPath() {
140 | String outPath = null;
141 | if (isSaveFile()) {
142 | outPath = ProjectUtils.getSaveEffectPath();
143 | } else {
144 | outPath = ProjectUtils.getCachePath();
145 | }
146 | File outDir = new File(outPath);
147 | if (!outDir.exists()) {
148 | outDir.mkdirs();
149 | }
150 |
151 | return outPath;
152 | }
153 |
154 | public static abstract class FilterListener implements Serializable {
155 | private static final long serialVersionUID = -6174673391405130886L;
156 |
157 | public abstract void onStart(Bitmap bit);
158 |
159 | public abstract void onFinish(String path);
160 |
161 | public abstract void onCancle();
162 |
163 | public abstract void onProgress(int pro);
164 |
165 | public abstract void onError(int code, String e);
166 | }
167 |
168 | }
169 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/Asset.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | package org.easydarwin.video.beautify.template;
5 |
6 | import android.net.Uri;
7 |
8 | /**
9 | * 视频处理的资源抽象类
10 | *
11 | */
12 | public abstract class Asset {
13 |
14 | private String id;
15 |
16 | // 资源类型
17 | private AssetType assetType;
18 |
19 | //
20 | private Uri uri;
21 |
22 | public Asset() {
23 | super();
24 | }
25 |
26 | public String getId() {
27 | return id;
28 | }
29 |
30 | public void setId(String id) {
31 | this.id = id;
32 | }
33 |
34 | public AssetType getAssetType() {
35 | return assetType;
36 | }
37 |
38 | public void setAssetType(AssetType assetType) {
39 | this.assetType = assetType;
40 | }
41 |
42 | public Uri getUri() {
43 | return uri;
44 | }
45 |
46 | public void setUri(Uri uri) {
47 | this.uri = uri;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/AssetMgr.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import android.net.Uri;
4 |
5 | /**
6 | *
7 | * 视频处理的资源管理器
8 | *
9 | */
10 | public class AssetMgr {
11 |
12 | public static Asset buildAsset(final AssetType assetType, final Uri uri) {
13 |
14 | switch (assetType) {
15 | case VIDEO:
16 | return createAsset(VideoAsset.class, uri);
17 | case AUDIO:
18 | return createAsset(AudioAsset.class, uri);
19 | case IMAGE:
20 | return createAsset(ImageSeqAsset.class, uri);
21 | case TITTLE:
22 | return createAsset(TittleAsset.class, uri);
23 | default:
24 | throw new IllegalStateException("No asset of that type!");
25 | }
26 |
27 | }
28 |
29 | private static Asset createAsset(Class extends Asset> assetClass, Uri uri) {
30 | try {
31 | Asset asset = assetClass.newInstance();
32 | asset.setUri(uri);
33 | asset.setId(asset.getAssetType().toString() + String.valueOf(System.currentTimeMillis()));
34 | return asset;
35 | } catch (Exception e) {
36 | e.printStackTrace();
37 | return null;
38 | }
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/AssetType.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | // 资源类型
4 | public enum AssetType {
5 |
6 | VIDEO, // 视频
7 | IMAGE, // 图片
8 | AUDIO, // 音频
9 | TITTLE // 字体
10 | ;
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/AudioAsset.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import org.easydarwin.video.beautify.conf.Conf;
4 | import org.easydarwin.video.render.MediaSource;
5 |
6 | import android.util.Log;
7 |
8 | public class AudioAsset extends Asset {
9 |
10 | // 资源长度(帧数)
11 | private long duration;
12 |
13 | private MediaSource mediaSource = null;
14 |
15 | public long getDuration() {
16 | if (mediaSource == null) {
17 | startDecode();
18 | }
19 | if (duration == 0) {
20 | duration = mediaSource.duration() * Conf.VIDEO_FRAMERATE / 1000;
21 | }
22 | return duration;
23 | }
24 |
25 | public void setDuration(long duration) {
26 | this.duration = duration;
27 | }
28 |
29 | public AudioAsset() {
30 | super();
31 | setAssetType(AssetType.AUDIO);
32 | }
33 |
34 | public void startDecode() {
35 | if (mediaSource != null) {
36 | return;
37 | }
38 | mediaSource = new MediaSource();
39 | mediaSource.init(getUri().getPath());
40 | int open = mediaSource.open();
41 | if (open != 0) {
42 | // 异常处理
43 | Log.e("ExcecuteProject", "open audio fail:" + open + "@" + getUri().getPath());
44 | return;
45 | }
46 | Log.i("ExcecuteProject", "start audio Decode:" + getUri().getPath() + "@" + mediaSource);
47 | }
48 |
49 | public void closeDecode() {
50 | if (mediaSource != null) {
51 | mediaSource.close();
52 | Log.i("ExcecuteProject", "close audio Decode:" + getUri().getPath() + "@" + mediaSource);
53 | mediaSource = null;
54 | }
55 | }
56 |
57 | @Override
58 | protected void finalize() throws Throwable {
59 | super.finalize();
60 | closeDecode();
61 | }
62 |
63 | public byte[] getNextAudioSamples() {
64 | if (mediaSource == null) {
65 | startDecode();
66 | }
67 |
68 | if (mediaSource.getFrame() != 0) {
69 | // 异常处理
70 | Log.e("ExcecuteProject", "decode audio fail:" + "@" + getUri().getPath());
71 | closeDecode();
72 | return null;
73 | }
74 |
75 | return mediaSource.currentAudio();
76 |
77 | }
78 |
79 | public byte[] mixAudio(byte[] audio2) {
80 | Log.e("mixAudio", "mixAudio ing");
81 | byte[] audioSamples = getNextAudioSamples();
82 | if (audioSamples == null) {
83 | return audio2;
84 | }
85 | for (int i = 0; i < audioSamples.length; i++) {
86 | audioSamples[i] += audio2[i];
87 | }
88 |
89 | return audioSamples;
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/AudioClip.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import android.content.Context;
4 |
5 | public class AudioClip extends MediaClip {
6 |
7 | public AudioClip() {
8 | super();
9 | }
10 |
11 | public AudioClip(Asset asset) {
12 | super(asset);
13 | }
14 |
15 | @Override
16 | public AudioEffect getEffect() {
17 | return (AudioEffect) super.getEffect();
18 | }
19 |
20 | private void buildEffect() {
21 | // //
22 | AudioEffect effect = new AudioEffect();
23 | setEffect(effect);
24 | }
25 |
26 | public void applyEffect(Context ctx) {
27 | if (super.getEffect() == null) {
28 | buildEffect();
29 | }
30 | getEffect().applyEffect(getAsset().getUri(),ctx);
31 | }
32 |
33 | public void close() {
34 | if (getEffect() != null) {
35 | getEffect().close();
36 | }
37 | if (getAsset() != null) {
38 | getAsset().closeDecode();
39 | }
40 | }
41 |
42 | @Override
43 | public AudioAsset getAsset() {
44 | return (AudioAsset) super.getAsset();
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/AudioEffect.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.media.MediaPlayer;
6 | import android.net.Uri;
7 | import android.util.Log;
8 |
9 | public class AudioEffect extends Effect {
10 |
11 | private MediaPlayer player = null;
12 |
13 | private static MediaPlayer srcAudioPlayer = new MediaPlayer();
14 |
15 | private static boolean isSrcMute = false;
16 |
17 | public AudioEffect() {
18 | super();
19 | }
20 |
21 | public AudioEffect(String id) {
22 | super(id);
23 | }
24 |
25 | @Override
26 | public Bitmap applyEffect(Bitmap curFrame, boolean isPreview) {
27 |
28 | return curFrame;
29 | }
30 |
31 | protected void applyEffect(Uri uri,Context ctx) {
32 | if (uri != null) {
33 | player = MediaPlayer.create(ctx, uri);
34 | player.setVolume(1.0f, 1.0f);
35 | player.setLooping(true);
36 | player.start();
37 | }
38 |
39 | }
40 |
41 | public void close() {
42 | if (player != null) {
43 | try {
44 | player.stop();
45 | player.release();
46 | } catch (Exception e) {
47 | e.printStackTrace();
48 | }
49 | player = null;
50 | }
51 | }
52 |
53 | @Override
54 | protected void finalize() throws Throwable {
55 | super.finalize();
56 | close();
57 | }
58 |
59 | public static void playSrcAudio(Uri srcAudio,Context ctx) {
60 |
61 | try {
62 | srcAudioPlayer = MediaPlayer.create(ctx, srcAudio);
63 | } catch (Exception e) {
64 | Log.e("error", e.getMessage());
65 | }
66 |
67 | if (isSrcMute) {
68 | srcAudioPlayer.setVolume(0.0f, 0.0f);
69 | } else {
70 | srcAudioPlayer.setVolume(1.0f, 1.0f);
71 | }
72 | srcAudioPlayer.start();
73 |
74 | }
75 |
76 | public static void setSrcPlayerMute(boolean isMute) {
77 | isSrcMute = isMute;
78 | if (srcAudioPlayer != null) {
79 | try {
80 | if (isMute) {
81 | srcAudioPlayer.setVolume(0.0f, 0.0f);
82 | } else {
83 | srcAudioPlayer.setVolume(1.0f, 1.0f);
84 | }
85 | } catch (Exception e) {
86 | e.printStackTrace();
87 | }
88 | }
89 | }
90 |
91 | public static void stopSrcPlayer() {
92 | if (srcAudioPlayer != null) {
93 | try {
94 | srcAudioPlayer.stop();
95 | srcAudioPlayer.release();
96 | } catch (Exception e) {
97 | e.printStackTrace();
98 | }
99 | srcAudioPlayer = null;
100 | }
101 | }
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/AudioGroup.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import android.content.Context;
8 | import android.util.Log;
9 |
10 | public class AudioGroup extends AudioClip {
11 |
12 | private List audioClips = null;
13 |
14 | private long frameIndex;
15 |
16 | public AudioGroup() {
17 | audioClips = new ArrayList();
18 | }
19 |
20 | public void addAudio(AudioClip audioClip) {
21 | audioClips.add(audioClip);
22 | }
23 |
24 | @Override
25 | public void applyEffect(Context ctx) {
26 | AudioClip audioClip = null;
27 | for (Iterator iterator = audioClips.iterator(); iterator.hasNext();) {
28 | audioClip = iterator.next();
29 | if (audioClip.getEffect() == null) {
30 | audioClip.applyEffect(ctx);
31 | Log.i("ExcecuteProject", "applyAudio:" + audioClip.getAsset().getUri());
32 | }
33 | if (frameIndex >= audioClip.getOutPoint()) {
34 | audioClip.close();
35 | }
36 | }
37 | }
38 |
39 | @Override
40 | public void close() {
41 | for (AudioClip audioClip : audioClips) {
42 | audioClip.close();
43 | }
44 | }
45 |
46 | public void setFrameIndex(long frameIndex) {
47 | this.frameIndex = frameIndex;
48 | }
49 |
50 | public byte[] mixAudio(byte[] audioSrc, boolean useSrcAudio) {
51 |
52 | if (!useSrcAudio) {
53 | for (int i = 0; i < audioSrc.length; i++) {
54 | audioSrc[i] = 0;
55 | }
56 | }
57 |
58 | byte[] mixedSamples = audioSrc;
59 | AudioClip audioClip = null;
60 | for (Iterator iterator = audioClips.iterator(); iterator.hasNext();) {
61 | audioClip = iterator.next();
62 | mixedSamples = audioClip.getAsset().mixAudio(mixedSamples);
63 | Log.i("ExcecuteProject", "mixAudio:" + audioClip.getAsset().getUri());
64 | }
65 |
66 | return mixedSamples;
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/Effect.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | package org.easydarwin.video.beautify.template;
5 |
6 | import android.graphics.Bitmap;
7 | import android.net.Uri;
8 |
9 | /**
10 | *
11 | * 视频处理特效抽象类
12 | *
13 | */
14 | public abstract class Effect {
15 |
16 | private String id;
17 |
18 | private String name;
19 |
20 | private Uri icon;
21 |
22 | public Effect() {
23 |
24 | }
25 |
26 | public Effect(String id) {
27 | if (id == null) {
28 | throw new IllegalStateException("Effect: id should not be null!");
29 | }
30 | this.id = id;
31 |
32 | }
33 |
34 | public String getId() {
35 | return id;
36 | }
37 |
38 | public void setId(String id) {
39 | this.id = id;
40 | }
41 |
42 | public String getName() {
43 | return name;
44 | }
45 |
46 | public void setName(String name) {
47 | this.name = name;
48 | }
49 |
50 | public Uri getIcon() {
51 | return icon;
52 | }
53 |
54 | public void setIcon(Uri icon) {
55 | this.icon = icon;
56 | }
57 |
58 | /**
59 | * 执行特效
60 | *
61 | * @param curFrame
62 | * 当前帧
63 | * @return 处理后的帧
64 | */
65 | abstract public Bitmap applyEffect(Bitmap curFrame, boolean isPreview);
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/FilterEffect.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import jp.co.cyberagent.android.gpuimage.GPUImage;
4 | import jp.co.cyberagent.android.gpuimage.GPUImageFilter;
5 | import jp.co.cyberagent.android.gpuimage.GPUImageFilterGroup;
6 | import jp.co.cyberagent.android.gpuimage.GPUImageView;
7 |
8 | import org.easydarwin.video.beautify.activity.VideoBeautifyActivity;
9 | import org.easydarwin.video.beautify.util.ContextHolder;
10 |
11 | import android.graphics.Bitmap;
12 |
13 | /**
14 | *
15 | * 应用GPUImage执行滤镜特效
16 | *
17 | */
18 | public class FilterEffect extends Effect {
19 |
20 | private GPUImage gpuImage = null;
21 |
22 | private GPUImageView gpuImageView = null;
23 |
24 | // 支持多个滤镜效果
25 | private GPUImageFilterGroup filterGroup = null;
26 |
27 | public FilterEffect() {
28 | super();
29 | }
30 |
31 | /**
32 | * 生成GPUImage实例
33 | *
34 | * @return GPUImage instance
35 | */
36 | private GPUImage getGPUImage() {
37 | if (gpuImage != null) {
38 | return gpuImage;
39 | }
40 |
41 | gpuImage = new GPUImage(ContextHolder.getInstance().getContext());
42 |
43 | if (filterGroup.getFilters().size() == 1) {
44 | gpuImage.setFilter(filterGroup.getFilters().get(0));
45 | } else {
46 | filterGroup.updateMergedFilters();
47 | gpuImage.setFilter(filterGroup);
48 | }
49 |
50 | return gpuImage;
51 | }
52 |
53 | private void setGPUImage() {
54 | if (gpuImageView != null) {
55 | return;
56 | }
57 |
58 | VideoBeautifyActivity activity = (VideoBeautifyActivity) ContextHolder.getInstance().getActivity();
59 | gpuImageView = activity.mGPUImageView;
60 |
61 | if (filterGroup.getFilters().size() == 1) {
62 | gpuImageView.setFilter(filterGroup.getFilters().get(0));
63 | } else {
64 | filterGroup.updateMergedFilters();
65 | gpuImageView.setFilter(filterGroup);
66 | }
67 |
68 | }
69 |
70 | @Override
71 | public Bitmap applyEffect(Bitmap curFrame, boolean isPreview) {
72 |
73 | if (isPreview) {
74 | if (gpuImageView == null) {
75 | setGPUImage();
76 | }
77 |
78 | gpuImageView.setImage(curFrame);
79 |
80 | return curFrame;
81 |
82 | } else {
83 | if (gpuImage == null) {
84 | gpuImage = getGPUImage();
85 | }
86 |
87 | gpuImage.setImage(curFrame);
88 | curFrame = gpuImage.getBitmapWithFilterApplied();
89 |
90 | return curFrame;
91 | }
92 |
93 | }
94 |
95 | protected void addEffect(GPUImageFilter gpuImageFilter, int index) {
96 | if (filterGroup == null) {
97 | filterGroup = new GPUImageFilterGroup();
98 | }
99 | if (index < 0) {
100 | index = filterGroup.getFilters().size();
101 | }
102 | if (!filterGroup.getFilters().contains(gpuImageFilter)) {
103 | filterGroup.getFilters().add(index, gpuImageFilter);
104 | filterGroup.updateMergedFilters();
105 | if (gpuImageView != null) {
106 | gpuImageView.setFilter(filterGroup);
107 | } else if (gpuImage != null) {
108 | gpuImage.setFilter(filterGroup);
109 | }
110 | }
111 | }
112 |
113 | protected void removeEffect(GPUImageFilter gpuImageFilter) {
114 | if (filterGroup.getFilters().contains(gpuImageFilter)) {
115 | filterGroup.getFilters().remove(gpuImageFilter);
116 | filterGroup.updateMergedFilters();
117 | if (gpuImageView != null) {
118 | gpuImageView.setFilter(filterGroup);
119 | } else if (gpuImage != null) {
120 | gpuImage.setFilter(filterGroup);
121 | }
122 | }
123 | }
124 |
125 | public void clear() {
126 | if (gpuImageView != null) {
127 | gpuImageView.clear();
128 | gpuImageView = null;
129 | }
130 |
131 | if (gpuImage != null) {
132 | gpuImage.clear();
133 | gpuImage = null;
134 | }
135 |
136 | if (filterGroup != null) {
137 | filterGroup.onDestroy();
138 | filterGroup = null;
139 | }
140 | System.gc();
141 | }
142 |
143 | }
144 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/FilterGroup.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import android.graphics.Bitmap;
8 |
9 | public class FilterGroup extends Filter {
10 |
11 | private List filters = null;
12 | private List tempFilters = null;
13 |
14 | public FilterGroup() {
15 | super();
16 | filters = new ArrayList();
17 | tempFilters = new ArrayList();
18 | }
19 |
20 | public FilterGroup(List filters) {
21 | this.filters = filters;
22 | tempFilters = new ArrayList();
23 | }
24 |
25 | public void addFilter(Filter filter) {
26 | addFilter(filter, -1);
27 | }
28 |
29 | public void addFilter(Filter filter, int index) {
30 | if (index < 0) {
31 | filters.add(filter);
32 | } else {
33 | filters.add(index, filter);
34 | }
35 | if (getEffect() == null) {
36 | setEffect(new FilterEffect());
37 | }
38 | getEffect().addEffect(filter.getGpuImageFilter(), index);
39 | }
40 |
41 | public Bitmap applyEffect(Bitmap curFrame, boolean isPreview) {
42 | if (getEffect() == null) {
43 | throw new IllegalStateException("filter:filterEffect should not be null!");
44 | }
45 |
46 | tempFilters.clear();
47 | Filter filter = null;
48 | for (Iterator iterator = filters.iterator(); iterator.hasNext();) {
49 | filter = iterator.next();
50 | // 根据入点、出点过滤当前需要执行的滤镜
51 | if (getFrameIndex() >= filter.getOffset() && getFrameIndex() < filter.getOutPoint()) {
52 | //getEffect().addEffect(filter.getGpuImageFilter(), tempFilters.size());
53 | tempFilters.add(filter);
54 | } else {
55 | //etEffect().removeEffect(filter.getGpuImageFilter());
56 | }
57 | }
58 |
59 | for (Filter filter2 : tempFilters) {
60 | filter2.applyDynamicParam();
61 | }
62 |
63 | curFrame = getEffect().applyEffect(curFrame, isPreview);
64 |
65 | return curFrame;
66 | }
67 |
68 | @Override
69 | public void setFrameRate(int frameRate) {
70 | super.setFrameRate(frameRate);
71 | for (Filter filter : filters) {
72 | filter.setFrameRate(frameRate);
73 | }
74 | }
75 |
76 | @Override
77 | public void setFrameIndex(long frameIndex) {
78 | super.setFrameIndex(frameIndex);
79 | for (Filter filter : filters) {
80 | filter.setFrameIndex(frameIndex);
81 | }
82 | }
83 |
84 | @Override
85 | public void close() {
86 | for (Filter filter : filters) {
87 | filter.close();
88 | }
89 | getEffect().clear();
90 | }
91 |
92 | @Override
93 | public int getFilterSize() {
94 | return filters == null ? 0 : filters.size();
95 | }
96 |
97 | public List getFilters() {
98 | return filters;
99 | }
100 |
101 | }
102 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/FxEffect.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import android.graphics.Bitmap;
4 |
5 | public class FxEffect extends Effect {
6 |
7 | @Override
8 | public Bitmap applyEffect(Bitmap curFrame, boolean isPreview) {
9 | return null;
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/ImageSeqAsset.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import java.lang.ref.SoftReference;
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | import android.graphics.Bitmap;
8 | import android.graphics.BitmapFactory;
9 | import android.net.Uri;
10 |
11 | /**
12 | *
13 | * 图片序列(png)
14 | *
15 | */
16 | public class ImageSeqAsset extends Asset {
17 |
18 | // 图片URI列表(循环)
19 | private List imageUriList;
20 |
21 | // 缓存Bitmap对象
22 | private List> imageList = null;
23 |
24 | private int attachSize = 0;
25 |
26 | public ImageSeqAsset() {
27 | super();
28 | setAssetType(AssetType.IMAGE);
29 | }
30 |
31 | public List getImageUriList() {
32 | return imageUriList;
33 | }
34 |
35 | public void setImageUriList(List imageUriList) {
36 | this.imageUriList = imageUriList;
37 |
38 | attachSize = imageUriList == null ? 0 : imageUriList.size();
39 | loadImage();
40 | }
41 |
42 | /**
43 | * 取缓存的Bitmap对象
44 | *
45 | * @param index
46 | * @return
47 | */
48 | public Bitmap getImage(int index) {
49 |
50 | if (imageList == null) {
51 | return null;
52 | }
53 |
54 | SoftReference softBitmap = imageList.get(index);
55 |
56 | return softBitmap == null ? null : softBitmap.get();
57 | }
58 |
59 | private void loadImage() {
60 | new Thread(new Runnable() {
61 | @Override
62 | public void run() {
63 | if (imageUriList != null && imageUriList.size() > 0) {
64 | imageList = new ArrayList>(imageUriList.size());
65 | Bitmap bitmap = null;
66 | for (Uri uri2 : imageUriList) {
67 | bitmap = BitmapFactory.decodeFile(uri2.getPath());
68 | imageList.add(new SoftReference(bitmap));
69 | }
70 | }
71 | }
72 | }).start();
73 | }
74 |
75 | public int getAttachSize() {
76 | return attachSize;
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/ImageSeqClip.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | public class ImageSeqClip extends MediaClip {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/MediaClip.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | package org.easydarwin.video.beautify.template;
5 |
6 | /**
7 | *
8 | * 视频处理的素材抽象类
9 | *
10 | */
11 | public abstract class MediaClip {
12 |
13 | private String id;
14 |
15 | /** 引用资源 */
16 | private Asset asset;
17 |
18 | /** 资源长度 */
19 | private long duration;
20 |
21 | /** 素材入点(精确帧) */
22 | private long offset;
23 |
24 | // 素材出点(精确帧)
25 |
26 | /** 是否对齐循环 */
27 | private boolean recycle = true;
28 |
29 | /** 帧率 */
30 | private int frameRate;
31 |
32 | private Effect effect;
33 |
34 | public Effect getEffect() {
35 | return effect;
36 | }
37 |
38 | public void setEffect(Effect effect) {
39 | this.effect = effect;
40 | }
41 |
42 | public MediaClip() {
43 |
44 | }
45 |
46 | public MediaClip(Asset asset) {
47 | if (asset == null) {
48 | throw new IllegalStateException("MediaClip:asset should not be null!");
49 | }
50 | this.asset = asset;
51 | }
52 |
53 | public String getId() {
54 | return id;
55 | }
56 |
57 | public void setId(String id) {
58 | this.id = id;
59 | }
60 |
61 | public Asset getAsset() {
62 | return asset;
63 | }
64 |
65 | public void setAsset(Asset asset) {
66 | this.asset = asset;
67 | }
68 |
69 | public AssetType getAssetType() {
70 | return asset == null ? null : asset.getAssetType();
71 | }
72 |
73 | public long getDuration() {
74 | return duration;
75 | }
76 |
77 | public void setDuration(long duration) {
78 | this.duration = duration;
79 | }
80 |
81 | public long getOffset() {
82 | return offset;
83 | }
84 |
85 | public void setOffset(long offset) {
86 | this.offset = offset;
87 | }
88 |
89 | public boolean isRecycle() {
90 | return recycle;
91 | }
92 |
93 | public void setRecycle(boolean recycle) {
94 | this.recycle = recycle;
95 | }
96 |
97 | public int getFrameRate() {
98 | return frameRate;
99 | }
100 |
101 | public void setFrameRate(int frameRate) {
102 | this.frameRate = frameRate;
103 | }
104 |
105 | public long getOutPoint() {
106 | return offset + duration;
107 | }
108 |
109 | }
110 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/MediaMgr.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import android.graphics.Bitmap;
7 | import android.net.Uri;
8 |
9 | public class MediaMgr {
10 |
11 | // 构造没有裁剪的视频素材对象
12 | protected static List buildMediaClip(AssetType assetType, Uri... uris) {
13 | List mediaClips = new ArrayList(uris.length);
14 | for (Uri uri : uris) {
15 | VideoAsset videoAsset = (VideoAsset) AssetMgr.buildAsset(assetType, uri);
16 | mediaClips.add(buildMediaClip(videoAsset, 0, videoAsset.getDuration()));
17 | }
18 | return mediaClips;
19 | }
20 |
21 | // 从资源裁剪得到素材
22 | public static MediaClip buildMediaClip(Asset asset, long offset, long duration) {
23 | if (asset == null) {
24 | throw new IllegalStateException("asset can not be null!");
25 | }
26 |
27 | MediaClip mediaClip = null;
28 |
29 | switch (asset.getAssetType()) {
30 | case VIDEO:
31 | mediaClip = createMediaClip(VideoClip.class, asset);
32 | break;
33 | case IMAGE:
34 | mediaClip = createMediaClip(ImageSeqClip.class, asset);
35 | break;
36 | case AUDIO:
37 | mediaClip = createMediaClip(AudioClip.class, asset);
38 | break;
39 | case TITTLE:
40 | mediaClip = createMediaClip(Tittle.class, asset);
41 | break;
42 | default:
43 | break;
44 | }
45 |
46 | mediaClip.setOffset(offset);
47 | mediaClip.setDuration(duration);
48 |
49 | return mediaClip;
50 | }
51 |
52 | private static MediaClip createMediaClip(Class extends MediaClip> mediaClipClass, Asset asset) {
53 | try {
54 | MediaClip mediaClip = mediaClipClass.newInstance();
55 | mediaClip.setAsset(asset);
56 | mediaClip.setId(asset.getAssetType().toString() + System.currentTimeMillis());
57 | return mediaClip;
58 | } catch (Exception e) {
59 | e.printStackTrace();
60 | return null;
61 | }
62 | }
63 |
64 | /**
65 | * 获得字幕素材包装对象
66 | *
67 | * @param tittleImage
68 | * 字幕转成的iamge
69 | * @param offset
70 | * 入点(帧序号)
71 | * @param duration
72 | * 时长(持续帧数)
73 | * @return
74 | */
75 | public static Tittle createTittle(Bitmap tittleImage, long offset, long duration) {
76 |
77 | TittleAsset tittleAsset = (TittleAsset) AssetMgr.buildAsset(AssetType.TITTLE, null);
78 | //
79 | tittleAsset.setTittleImage(tittleImage);
80 |
81 | Tittle tittle = (Tittle) buildMediaClip(tittleAsset, offset, duration);
82 |
83 | return tittle;
84 | }
85 |
86 | /**
87 | * 获得音频素材包装对象
88 | *
89 | * @param audioUri
90 | * 音频文件uri
91 | * @param offset
92 | * 入点(帧序号)
93 | * @param duration
94 | * 时长(持续帧数)
95 | * @return
96 | */
97 | public static AudioClip createAudio(Uri audioUri, long offset, long duration) {
98 |
99 | Asset asset = AssetMgr.buildAsset(AssetType.AUDIO, audioUri);
100 |
101 | AudioClip audio = (AudioClip) buildMediaClip(asset, offset, duration);
102 |
103 | return audio;
104 | }
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/NodeType.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | // 渲染树节点类型
4 | public enum NodeType {
5 | VIDEO_TRACK, //视频轨
6 | TRANSITION_TRACK, //转场特效轨
7 | FXEFFECT_TRACK, //Fx特效轨
8 | AUDIO_TRACK, //音频轨
9 | TITTLE_TRACK, //字幕轨
10 |
11 | VIDEO_NODE, //视频素材
12 | IMAGE_NODE, //图像素材
13 | FILER_NODE, //滤镜
14 | TRANSITION_NODE, //转场特效
15 | FXEFFECT_NODE, //Fx特效
16 | TITTLE_NODE //字幕
17 | }
18 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/TimeLineNode.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import java.util.List;
4 |
5 | import org.easydarwin.video.beautify.conf.Conf;
6 |
7 | /**
8 | *
9 | * 渲染树节点
10 | *
11 | */
12 | public class TimeLineNode {
13 |
14 | private String id;
15 |
16 | private String name;
17 |
18 | private TimeLineNode parentNode;
19 |
20 | private List childNodeList;
21 |
22 | private NodeType nodeType;
23 |
24 | private MediaClip nodeData;
25 |
26 | // 入点(精确帧)
27 | private long offset = 0;
28 |
29 | // -->出点
30 | private long duration = Conf.V_RE_MAX / 1000 * Conf.VIDEO_FRAMERATE;
31 |
32 | // 是否对齐循环
33 | private boolean recycle = true;
34 |
35 | public String getId() {
36 | return id;
37 | }
38 |
39 | public void setId(String id) {
40 | this.id = id;
41 | }
42 |
43 | public String getName() {
44 | return name;
45 | }
46 |
47 | public void setName(String name) {
48 | this.name = name;
49 | }
50 |
51 | public TimeLineNode getParentNode() {
52 | return parentNode;
53 | }
54 |
55 | public void setParentNode(TimeLineNode parentNode) {
56 | this.parentNode = parentNode;
57 | }
58 |
59 | public List getChildNodeList() {
60 | return childNodeList;
61 | }
62 |
63 | public void setChildNodeList(List childNodeList) {
64 | this.childNodeList = childNodeList;
65 | }
66 |
67 | public NodeType getNodeType() {
68 | return nodeType;
69 | }
70 |
71 | public void setNodeType(NodeType nodeType) {
72 | this.nodeType = nodeType;
73 | }
74 |
75 | public MediaClip getNodeData() {
76 | return nodeData;
77 | }
78 |
79 | public void setNodeData(MediaClip nodeData) {
80 | this.nodeData = nodeData;
81 | }
82 |
83 | public long getOffset() {
84 | return offset;
85 | }
86 |
87 | public void setOffset(long offset) {
88 | this.offset = offset;
89 | }
90 |
91 | public long getDuration() {
92 | return duration;
93 | }
94 |
95 | public void setDuration(long duration) {
96 | this.duration = duration;
97 | }
98 |
99 | public boolean isRecycle() {
100 | return recycle;
101 | }
102 |
103 | public void setRecycle(boolean recycle) {
104 | this.recycle = recycle;
105 | }
106 |
107 | public long getOutPoint() {
108 | return offset + duration;
109 | }
110 |
111 | }
112 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/Tittle.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import android.graphics.Bitmap;
4 |
5 | /**
6 | *
7 | * 字幕
8 | *
9 | */
10 | public class Tittle extends MediaClip {
11 |
12 | private Filter filter;
13 |
14 | public Tittle() {
15 | super();
16 | }
17 |
18 | public Tittle(Asset asset) {
19 | super(asset);
20 | }
21 |
22 | @Override
23 | public TittleAsset getAsset() {
24 | return (TittleAsset) super.getAsset();
25 | }
26 |
27 | public Filter getFilter() {
28 | if (filter == null) {
29 | filter = FilterUtils.buildTittleFilter();
30 | Bitmap bitmap = getAsset().getTittleImage();
31 | filter.setAttachImage(bitmap);
32 | filter.setOffset(getOffset());
33 | filter.setDuration(getDuration());
34 | }
35 | return filter;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/TittleAsset.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import android.graphics.Bitmap;
4 |
5 | /**
6 | *
7 | * 字体Font
8 | *
9 | */
10 | public class TittleAsset extends Asset {
11 |
12 | private Bitmap tittleImage = null;
13 |
14 | public TittleAsset() {
15 | super();
16 | setAssetType(AssetType.TITTLE);
17 | }
18 |
19 | public Bitmap getTittleImage() {
20 | return tittleImage;
21 | }
22 |
23 | public void setTittleImage(Bitmap tittleImage) {
24 | this.tittleImage = tittleImage;
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/TittleEffect.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import android.graphics.Bitmap;
4 |
5 | /**
6 | *
7 | * 字幕特效
8 | *
9 | */
10 | public class TittleEffect extends Effect {
11 |
12 | // 字幕素材
13 | private Tittle tittle;
14 |
15 | public Tittle getTittle() {
16 | return tittle;
17 | }
18 |
19 | public void setTittle(Tittle tittle) {
20 | this.tittle = tittle;
21 | }
22 |
23 | @Override
24 | public Bitmap applyEffect(Bitmap curFrame, boolean isPreview) {
25 | return null;
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/TransitionEffect.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import android.graphics.Bitmap;
4 |
5 | /**
6 | *
7 | * 转场特效
8 | *
9 | */
10 | public class TransitionEffect extends Effect {
11 |
12 | @Override
13 | public Bitmap applyEffect(Bitmap curFrame, boolean isPreview) {
14 | return null;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/VideoAsset.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import org.easydarwin.video.beautify.conf.Conf;
4 | import org.easydarwin.video.render.MediaSource;
5 | import org.easydarwin.video.render.MediaTarget;
6 |
7 | import android.graphics.Bitmap;
8 | import android.util.Log;
9 |
10 | /**
11 | *
12 | * 视频资源(mp4)
13 | *
14 | */
15 | public class VideoAsset extends Asset {
16 |
17 | // 资源长度 (精确到帧)
18 | private long duration = -1;
19 |
20 | // 资源使用游标,即当前处理的帧序号
21 | private long cursor = 0;
22 |
23 | private int width;
24 |
25 | private int height;
26 |
27 | private MediaSource mediaSource = null;
28 |
29 | private MediaTarget mediaTarget = null;
30 |
31 | // 添加音乐
32 | private AudioGroup audioGroup = null;
33 |
34 | // 消除原音
35 | private boolean useSrcAudio;
36 |
37 | public VideoAsset() {
38 | super();
39 | setAssetType(AssetType.VIDEO);
40 | }
41 |
42 | public long getDuration() {
43 | if (mediaSource == null) {
44 | startDecode();
45 | }
46 | if (duration == -1) {
47 | duration = mediaSource.duration() * Conf.VIDEO_FRAMERATE / 1000;
48 | }
49 | return duration;
50 | }
51 |
52 | public void setDuration(long duration) {
53 | this.duration = duration;
54 | }
55 |
56 | public long getCursor() {
57 | return cursor;
58 | }
59 |
60 | public void setCursor(long cursor) {
61 | this.cursor = cursor;
62 | }
63 |
64 | public void startDecode() {
65 | if (mediaSource != null) {
66 | return;
67 | }
68 | mediaSource = new MediaSource();
69 | mediaSource.init(getUri().getPath());
70 | int open = mediaSource.open();
71 | if (open != 0) {
72 | // 异常处理
73 | Log.e("ExcecuteProject", "open source fail:" + open + "@" + getUri().getPath());
74 | }
75 | Log.i("ExcecuteProject", "startDecode:" + getUri().getPath() + "@" + mediaSource);
76 | }
77 |
78 | public Bitmap getNextFrame() {
79 | if (mediaSource.getFrame() != 0) {
80 | // 异常处理
81 | closeDecode();
82 | return null;
83 | }
84 |
85 | while (!mediaSource.isVideo()) {
86 |
87 | if (mediaTarget != null) {
88 |
89 | if (audioGroup != null) {
90 | // 混音
91 | mediaTarget.pushAudio(audioGroup.mixAudio(mediaSource.currentAudio(), useSrcAudio),
92 | mediaSource.audioCurrentNumberOfSamples());
93 | } else {
94 | if (useSrcAudio) {
95 | mediaTarget.pushAudio(mediaSource.currentAudio(), mediaSource.audioCurrentNumberOfSamples());
96 | }
97 | }
98 | }
99 |
100 | if (mediaSource.getFrame() != 0) {
101 | closeDecode();
102 | return null;
103 | }
104 | }
105 |
106 | // 移动游标
107 | cursor++;
108 | Bitmap currentFrame = mediaSource.currentFrame();
109 | if (cursor >= getDuration() || mediaSource.currentFrame() == null) {
110 | closeDecode();
111 | }
112 |
113 | return currentFrame;
114 |
115 | }
116 |
117 | public void closeDecode() {
118 | if (mediaSource != null) {
119 | mediaSource.close();
120 | Log.i("ExcecuteProject", "closeDecode:" + getUri().getPath() + "@" + mediaSource);
121 | mediaSource = null;
122 | cursor = 0;
123 | }
124 | }
125 |
126 | public void startEncode() {
127 | if (mediaTarget != null) {
128 | return;
129 | }
130 | mediaTarget = new MediaTarget();
131 | mediaTarget.init(getUri().getPath());
132 | mediaTarget.setVideoWidth(480);
133 | mediaTarget.setVideoHeight(480);
134 | //
135 | mediaTarget.open();
136 | }
137 |
138 | public void appendFrame(Bitmap frame) {
139 | mediaTarget.pushFrame(frame);
140 | }
141 |
142 | public void colseEncode() {
143 | if (mediaTarget != null) {
144 | mediaTarget.close();
145 | Log.i("ExcecuteProject", "colseEncode:" + mediaTarget);
146 | mediaTarget = null;
147 | }
148 | }
149 |
150 | public int getWidth() {
151 | if (mediaSource == null) {
152 | startDecode();
153 | }
154 | if (width == 0) {
155 | width = mediaSource.videoWidth();
156 | }
157 | return width;
158 | }
159 |
160 | public void setWidth(int width) {
161 | this.width = width;
162 | }
163 |
164 | public int getHeight() {
165 | if (mediaSource == null) {
166 | startDecode();
167 | }
168 | if (height == 0) {
169 | height = mediaSource.videoHeight();
170 | }
171 | return height;
172 | }
173 |
174 | public void setHeight(int height) {
175 | this.height = height;
176 | }
177 |
178 | public MediaTarget getMediaTarget() {
179 | return mediaTarget;
180 | }
181 |
182 | public void setMediaTarget(MediaTarget mediaTarget) {
183 | this.mediaTarget = mediaTarget;
184 | }
185 |
186 | @Override
187 | protected void finalize() throws Throwable {
188 | super.finalize();
189 | }
190 |
191 | public void setMusic(AudioGroup music) {
192 | audioGroup = music;
193 | }
194 |
195 | public void setUseSrcAudio(boolean useSrcAudio) {
196 | this.useSrcAudio = useSrcAudio;
197 | }
198 |
199 | }
200 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/VideoClip.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import android.graphics.Bitmap;
4 |
5 | public class VideoClip extends MediaClip {
6 |
7 | public VideoClip() {
8 | super();
9 | }
10 |
11 | public VideoClip(Asset asset) {
12 | super(asset);
13 | }
14 |
15 | @Override
16 | public VideoAsset getAsset() {
17 | return (VideoAsset) super.getAsset();
18 | }
19 |
20 | public void startDecode() {
21 | getAsset().startDecode();
22 | // 跳转到素材入点
23 | if (getOffset() > getAsset().getCursor()) {
24 | int deffer = (int) (getOffset() - getAsset().getCursor());
25 | for (int i = 0; i < deffer; i++) {
26 | getNextFrame();
27 | }
28 | }
29 | }
30 |
31 | public Bitmap getNextFrame() {
32 | Bitmap curFrame = getAsset().getNextFrame();
33 | return curFrame;
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/template/VideoProject.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.template;
2 |
3 | import java.util.List;
4 |
5 | public class VideoProject {
6 |
7 | private VideoTemplate videoTemplate;
8 |
9 | public VideoProject(VideoTemplate videoTemplate) {
10 | if (videoTemplate == null) {
11 | throw new IllegalStateException("videoTemplate can not be null!");
12 | }
13 | this.videoTemplate = videoTemplate;
14 | }
15 |
16 | public VideoTemplate getVideoTemplate() {
17 | return videoTemplate;
18 | }
19 |
20 | public void setVideoTemplate(VideoTemplate videoTemplate) {
21 | this.videoTemplate = videoTemplate;
22 | }
23 |
24 | /**
25 | * 把素材绑定到模板对应节点(暂时只实现视频轨素材绑定)
26 | *
27 | * @param mediaClip
28 | * @return
29 | */
30 | public void addMedia(List mediaClips) {
31 | if (getVideoTemplate() == null || getVideoTemplate().getRenderTree() == null) {
32 | throw new IllegalStateException("videoTemplate and RenderTree should not be null!");
33 | }
34 | long totalFrame = 0;
35 | TimeLineNode renderTree = getVideoTemplate().getRenderTree();
36 | List trackList = renderTree.getChildNodeList();
37 | for (TimeLineNode trackNode : trackList) {
38 | if (trackNode.getNodeType() == NodeType.VIDEO_TRACK) {
39 | List videoNodes = trackNode.getChildNodeList();
40 | int mediaIndex = 0;
41 | TimeLineNode videoNode = null;
42 | for (TimeLineNode timeLineNode : videoNodes) {
43 | videoNode = timeLineNode;
44 | if (videoNode.getNodeData() != null) {
45 | // 模板自带素材节点,如“片头”
46 | continue;
47 | }
48 | MediaClip clip = mediaClips.get(mediaIndex++);
49 | videoNode.setNodeData(clip);
50 | totalFrame += clip.getDuration();
51 | if (clip.getDuration() < videoNode.getDuration()) {
52 | videoNode.setDuration(clip.getDuration());
53 | }
54 | TimeLineNode filterNode = videoNode.getChildNodeList().get(0);
55 | FilterGroup filterGroup = (FilterGroup) filterNode.getNodeData();
56 | if (filterGroup.getEffect() == null) {
57 | Filter filter = FilterUtils.buildBlankFilter();
58 | filter.setOffset(videoNode.getOffset());
59 | filter.setDuration(videoNode.getDuration());
60 | filterGroup.addFilter(filter);
61 | }
62 |
63 | if (mediaIndex == mediaClips.size()) {
64 | break;
65 | }
66 |
67 | }
68 | if (mediaIndex < mediaClips.size()) {
69 | for (int i = 0; i < mediaClips.size() - mediaIndex; i++) {
70 |
71 | }
72 | }
73 |
74 | }
75 | }
76 | videoTemplate.setTotalFrame(totalFrame);
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/util/ContextHolder.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.util;
2 |
3 | import java.lang.ref.WeakReference;
4 |
5 | import android.app.Activity;
6 | import android.content.Context;
7 |
8 | public class ContextHolder {
9 | private static ContextHolder mInstance;
10 | private Context mContext;
11 | private Activity mActivity;
12 |
13 | public static ContextHolder getInstance() {
14 | if (mInstance == null) {
15 | mInstance = new ContextHolder();
16 | }
17 | return mInstance;
18 | }
19 |
20 | public Context getContext() {
21 | return mContext;
22 | }
23 |
24 | public void setContext(Context mContext) {
25 | this.mContext = mContext;
26 | }
27 |
28 | public Activity getActivity() {
29 | return mActivity;
30 | }
31 |
32 | public void setActivity(Activity mActivity) {
33 | this.mActivity = mActivity;
34 | }
35 |
36 | public WeakReference getEffectActivity() {
37 | return new WeakReference(mActivity);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/util/DateUtils.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.util;
2 |
3 | import java.text.DateFormat;
4 | import java.text.ParseException;
5 | import java.text.SimpleDateFormat;
6 | import java.util.Date;
7 | import java.util.GregorianCalendar;
8 | import java.util.Locale;
9 |
10 | import android.util.Log;
11 |
12 | public class DateUtils {
13 | /**
14 | * 把日期时间转为字符串
15 | *
16 | * @param date
17 | * @return 返回格式为 'yyyy-MM-dd HH:mm:ss'
18 | */
19 | public final static String formatDate(Date date) {
20 | if (date == null) {
21 | return null;
22 | }
23 | SimpleDateFormat form = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.getDefault());
24 | return form.format(date);
25 | }
26 |
27 | /**
28 | * 把日期时间转为字符串
29 | *
30 | * @param date
31 | * 格式 yyyy-MM-dd HH:mm:ss
32 | * @return 返回格式为 'MM/dd'
33 | */
34 | public final static String formatDateToDay(String date) {
35 | if (date == null || date.length() < 10) {
36 | return "";
37 | }
38 | String res = null;
39 | SimpleDateFormat form = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.getDefault());
40 | try {
41 | Date d = form.parse(date);
42 | res = formatDateToDay(d);
43 | } catch (ParseException e) {
44 | Log.e("DateUtil", "parse error", e);
45 | }
46 | return res;
47 | }
48 |
49 | /**
50 | * 把日期时间转为字符串
51 | *
52 | * @param date
53 | * @return 返回格式为 'MM/dd'
54 | */
55 | @SuppressWarnings("deprecation")
56 | public final static String formatDateToDay(Date date) {
57 | if (date == null) {
58 | return "";
59 | }
60 | String res = date.getMonth() + "/" + date.getDay();
61 | return res;
62 | }
63 |
64 | public final static Date parseDate(String date) {
65 | if (date == null || date.length() < 10) {
66 | return null;
67 | }
68 | Date res = null;
69 | SimpleDateFormat form = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.getDefault());
70 | try {
71 | res = form.parse(date);
72 | } catch (ParseException e) {
73 | Log.e("DateUtil", "parse error", e);
74 | }
75 | return res;
76 | }
77 |
78 | public final static Date parseDate(String date, DateFormat format) {
79 |
80 | if (date == null || date.length() < 8) {
81 | return null;
82 | }
83 |
84 | Date res = null;
85 |
86 | try {
87 | res = format.parse(date);
88 | } catch (ParseException e) {
89 | Log.e("DateUtil", "parse error", e);
90 | }
91 | return res;
92 | }
93 |
94 | public final static int compareDate(Date beg, Date end) {
95 | int res = 0;
96 | if (beg != null && end != null) {
97 | res = (int) (end.getTime() - beg.getTime()) / 1000;
98 | }
99 | return res;
100 | }
101 |
102 | public static String millisToDate(long millis) {
103 | Date date = new Date(millis);
104 | GregorianCalendar gc = new GregorianCalendar();
105 | gc.setTime(date);
106 | java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss",Locale.getDefault());
107 | String sb = format.format(gc.getTime());
108 | return sb;
109 | }
110 |
111 | /**
112 | * 用于将毫秒数转换为00:00 或 00:00:00格式,比如在配乐页面时间显示
113 | *
114 | * @param time
115 | * @return
116 | */
117 | public static String formateTime(int time, String type) {
118 | time /= 1000;
119 | int minute = time / 60;
120 | int hour = minute / 60;
121 | int second = time % 60;
122 | minute %= 60;
123 | String result = null;
124 | if (type == null) {
125 | throw new NullPointerException("type == null");
126 | }
127 | if (type.equals("00:00")) {
128 | result = String.format(Locale.getDefault(),"%02d:%02d", minute, second);
129 | }
130 | if (type.equals("00:00:00")) {
131 | result = String.format(Locale.getDefault(),"%02d:%02d", hour, minute, second);
132 | }
133 | return result;
134 | }
135 |
136 | public static void main(String[] args) {
137 | System.out.println(formateTime(8667, "00:00"));
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/util/GPUImageTools.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.util;
2 |
3 | import jp.co.cyberagent.android.gpuimage.GPUImage;
4 |
5 | import org.easydarwin.video.beautify.template.Filter;
6 | import org.easydarwin.video.beautify.template.FilterUtils;
7 |
8 | import android.content.Context;
9 | import android.graphics.Bitmap;
10 | import android.graphics.Matrix;
11 |
12 | public class GPUImageTools {
13 |
14 | private GPUImage gpuImage = null;
15 |
16 | private static GPUImageTools instance = null;
17 |
18 | public GPUImageTools(Context context) {
19 | gpuImage = new GPUImage(context);
20 | }
21 |
22 | public static GPUImageTools getInstance() {
23 | if (instance == null) {
24 | Context context = ContextHolder.getInstance().getContext();
25 | instance = new GPUImageTools(context);
26 | }
27 | return instance;
28 | }
29 |
30 | public Bitmap blend(Bitmap bitmap1, Bitmap bitmap2) {
31 |
32 | Filter filter = FilterUtils.buildDecorateFilter();
33 | filter.setAttachImage(bitmap1);
34 |
35 | gpuImage.setFilter(filter.getGpuImageFilter());
36 | gpuImage.setImage(bitmap2);
37 |
38 | Bitmap result = gpuImage.getBitmapWithFilterApplied();
39 |
40 | Matrix matrix = new Matrix();
41 | matrix.postScale(1, -1); // 镜像垂直翻转
42 | result = Bitmap.createBitmap(result, 0, 0, result.getWidth(), result.getHeight(), matrix, true);
43 |
44 | return result;
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/util/ProjectUtils.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.util;
2 |
3 | import java.io.BufferedInputStream;
4 | import java.io.BufferedOutputStream;
5 | import java.io.File;
6 | import java.io.FileOutputStream;
7 | import java.io.IOException;
8 | import java.io.InputStream;
9 | import java.io.OutputStream;
10 |
11 | import org.easydarwin.video.beautify.conf.Conf;
12 | import org.easydarwin.video.recoder.utils.AndroidUtils;
13 |
14 | import android.content.Context;
15 | import android.os.Environment;
16 |
17 | public class ProjectUtils {
18 |
19 | private static String mainPath = null;
20 | private static File mResourceFile;
21 |
22 | public static void init(Context context) {
23 | initFoler(context);
24 | AndroidUtils.init(context);
25 | VideoBeautifyUtil.getInstance().init(context);
26 | }
27 |
28 | public static void initFoler(Context context) {
29 | File environmentPath = null;
30 | if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
31 | mResourceFile = new File(new File(Environment.getExternalStorageDirectory(), Conf.ROOT_FILE_PATH), "resource");
32 | environmentPath = context.getExternalCacheDir();
33 | } else {
34 | environmentPath = context.getFilesDir();
35 | mResourceFile = new File(new File(environmentPath, "draft"), "resource");
36 | }
37 |
38 | String root = Environment.getExternalStorageDirectory().getAbsolutePath();
39 | File baseDir = new File(root + Conf.BASE_DIR);
40 | if (!baseDir.exists()) {
41 | baseDir.mkdir();
42 | }
43 | File tmpDir = new File(root + Conf.TMP_DIR);
44 | if (!tmpDir.exists()) {
45 | tmpDir.mkdir();
46 | }
47 |
48 | File videoTmpDir = new File(root + Conf.VIDEO_TMP_DIR);
49 | if (!videoTmpDir.exists()) {
50 | videoTmpDir.mkdir();
51 | }
52 |
53 | File videoTmpNonmedia = new File(root + Conf.VIDEO_TMP_DIR, ".nonmedia");
54 | if (!videoTmpNonmedia.exists()) {
55 | try {
56 | videoTmpNonmedia.createNewFile();
57 | } catch (IOException e) {
58 | }
59 | }
60 | File imgTmpDir = new File(root + Conf.IMG_TMP_DIR);
61 | if (!imgTmpDir.exists()) {
62 | imgTmpDir.mkdir();
63 | }
64 |
65 | File imgTmpNonmedia = new File(root + Conf.IMG_TMP_DIR, ".nonmedia");
66 | if (!imgTmpNonmedia.exists()) {
67 | try {
68 | imgTmpNonmedia.createNewFile();
69 | } catch (IOException e) {
70 | }
71 | }
72 |
73 | File audioTmpDir = new File(root + Conf.AUDIO_TMP_DIR);
74 | if (!audioTmpDir.exists()) {
75 | audioTmpDir.mkdir();
76 | }
77 | File audioTmpNonmedia = new File(root + Conf.AUDIO_TMP_DIR, ".nonmedia");
78 | if (!audioTmpNonmedia.exists()) {
79 | try {
80 | audioTmpNonmedia.createNewFile();
81 | } catch (IOException e) {
82 | }
83 | }
84 |
85 | }
86 |
87 | public static String getAudioTemplateResourcePath() {
88 | File file = new File(mResourceFile, "audioTemplate");
89 | if (!file.exists()) {
90 | file.mkdirs();
91 | }
92 | return file.toString();
93 | }
94 |
95 | public static String getVideoResourcePath() {
96 | File file = new File(mResourceFile, "video");
97 | if (!file.exists()) {
98 | file.mkdirs();
99 | }
100 | File nomediaFile = new File(file, ".nomedia");
101 | if (!nomediaFile.exists()) {
102 | try {
103 | nomediaFile.createNewFile();
104 | } catch (IOException e) {
105 | e.printStackTrace();
106 | }
107 | }
108 | return file.toString();
109 | }
110 |
111 | public static long getAssetsFileLength(Context context, String assetsPath) throws IOException {
112 | return context.getAssets().openFd(assetsPath).getLength();
113 | }
114 |
115 | public static long getSdcardFreeSpace() {
116 | File esd = Environment.getExternalStorageDirectory();
117 | return esd.getUsableSpace();
118 | }
119 |
120 | public static void releaseAssetsFile(Context context, String assetsPath, String localPath) throws IOException {
121 | InputStream is = new BufferedInputStream(context.getAssets().open(assetsPath));
122 | OutputStream os = new BufferedOutputStream(new FileOutputStream(localPath));
123 | int c = 0;
124 | while ((c = is.read()) != -1) {
125 | os.write(c);
126 | }
127 | is.close();
128 | os.close();
129 | }
130 |
131 | public static String getResourcePath() {
132 | if (mainPath == null) {
133 | mainPath = ContextHolder.getInstance().getContext().getExternalFilesDir(null).getAbsolutePath() + "/.beautify_resource/";
134 | }
135 | File file = new File(mainPath);
136 | if (!file.exists()) {
137 | file.mkdirs();
138 | }
139 | return mainPath;
140 | }
141 |
142 | public static String getCachePath() {
143 | String path = ContextHolder.getInstance().getContext().getExternalFilesDir(null).getAbsolutePath() + "/.beautify_cache/";
144 | File destDir = new File(path);
145 | if (!destDir.exists()) {
146 | destDir.mkdirs();
147 | }
148 | return path;
149 | }
150 |
151 | public static String getThemePath() {
152 | return getResourcePath() + "theme/";
153 | }
154 |
155 | public static String getFilterPath() {
156 | return getResourcePath() + "filter/";
157 | }
158 |
159 | public static String getMusicPath() {
160 | return getResourcePath() + "music/";
161 | }
162 |
163 | public static String getSaveEffectPath() {
164 | String fileName = Environment.getExternalStorageDirectory().getAbsolutePath() + Conf.SAVE_EFFECT_PATH;
165 | File file = new File(fileName);
166 | if (!file.exists()) {
167 | file.mkdirs();
168 | }
169 | return fileName;
170 | }
171 | }
172 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/util/TouchUtil.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.util;
2 |
3 | import android.graphics.Rect;
4 | import android.view.TouchDelegate;
5 | import android.view.View;
6 |
7 | /**
8 | *
9 | * @description 扩大按钮点击范围Util
10 | */
11 | public class TouchUtil {
12 | public static void createTouchDelegate(final View view, final int expandTop, final int expandBottom,
13 | final int expandLeft, final int expandRight) {
14 | final View parent = (View) view.getParent();
15 | parent.post(new Runnable() {
16 | @Override
17 | public void run() {
18 | final Rect r = new Rect();
19 | view.getHitRect(r);
20 | r.top -= expandTop;
21 | r.bottom += expandBottom;
22 | r.left -= expandLeft;
23 | r.right += expandRight;
24 | parent.setTouchDelegate(new TouchDelegate(r, view));
25 | }
26 | });
27 | }
28 |
29 | public static void createTouchDelegate(final View view, final int expandTouchWidth) {
30 | final View parent = (View) view.getParent();
31 | parent.post(new Runnable() {
32 | @Override
33 | public void run() {
34 | final Rect r = new Rect();
35 | view.getHitRect(r);
36 | r.top -= expandTouchWidth;
37 | r.bottom += expandTouchWidth;
38 | r.left -= expandTouchWidth;
39 | r.right += expandTouchWidth;
40 | parent.setTouchDelegate(new TouchDelegate(r, view));
41 | }
42 | });
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/util/VideoThumbsUtil.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.beautify.util;
2 |
3 | import java.io.File;
4 | import java.io.FileNotFoundException;
5 | import java.io.FileOutputStream;
6 | import java.io.IOException;
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | import org.easydarwin.video.beautify.model.GalleryModel;
11 | import org.easydarwin.video.beautify.template.VideoAsset;
12 | import org.easydarwin.video.beautify.view.HorizontalListView;
13 |
14 | import android.graphics.Bitmap;
15 | import android.net.Uri;
16 | import android.os.AsyncTask;
17 |
18 | public class VideoThumbsUtil {
19 |
20 | private static class LoadVideoThumbsTask extends AsyncTask> {
21 | private final List mmodels;
22 | private final HorizontalListView mGallery;
23 |
24 | public LoadVideoThumbsTask(final List models, HorizontalListView gallery) {
25 | mmodels = models;
26 | mGallery = gallery;
27 | }
28 |
29 | @Override
30 | protected List doInBackground(Uri... params) {
31 | mmodels.addAll(getVideoThumbs(params[0]));
32 | return mmodels;
33 | }
34 |
35 | @Override
36 | protected void onPostExecute(List result) {
37 | mGallery.requestLayout();
38 | }
39 | }
40 |
41 | /**
42 | * 异步加载缩略图
43 | *
44 | * @param models
45 | * @param videoUri
46 | * @param gallery
47 | */
48 | public static void loadVideoThumbs(final List models, final Uri videoUri,
49 | final HorizontalListView gallery) {
50 | new LoadVideoThumbsTask(models, gallery).execute(videoUri);
51 | }
52 |
53 | /**
54 | * 获取视频的缩略图列表(缓存到cache)
55 | *
56 | * @param videoUri
57 | * @return
58 | */
59 | public static List getVideoThumbs(Uri videoUri) {
60 | return getVideoThumbs(videoUri, 0, new File(ProjectUtils.getCachePath()));
61 | }
62 |
63 | public static List getVideoThumbs(Uri videoUri, int step, File destDir) {
64 |
65 | List result = new ArrayList();
66 |
67 | if (!destDir.exists()) {
68 | destDir.mkdirs();
69 | }
70 |
71 | // 截取视频文件名
72 | String fileName = videoUri.getPath();
73 | fileName = fileName.substring(fileName.lastIndexOf(File.separatorChar) + 1);
74 | fileName = fileName.substring(0, fileName.lastIndexOf('.'));
75 |
76 | fileName = destDir.getAbsolutePath() + File.separator + fileName;
77 |
78 | if (checkFileCached(fileName, step, result)) {
79 | return result;
80 | }
81 |
82 | VideoAsset videoAsset = new VideoAsset();
83 | videoAsset.setUri(videoUri);
84 | videoAsset.startDecode();
85 |
86 | Bitmap frame = null;
87 | int count = 0;
88 |
89 | long duration = videoAsset.getDuration();
90 | if (step == 0) {
91 | // 固定返回11张图
92 | step = (int) duration / 10;
93 | }
94 |
95 | File file = null;
96 | for (int i = 0; i < duration; i++) {
97 | frame = videoAsset.getNextFrame();
98 | if (frame == null) {
99 | break;
100 | }
101 |
102 | if (i == 0 || count == step || i == duration - 4) {
103 | file = new File(fileName + i);
104 | saveFrame(frame, file);
105 | result.add(new GalleryModel(Uri.fromFile(file), i));
106 | count = 0;
107 | }
108 | count++;
109 | }
110 |
111 | videoAsset.closeDecode();
112 | videoAsset = null;
113 | return result;
114 | }
115 |
116 | private static void saveFrame(Bitmap frame, File file) {
117 |
118 | try {
119 | FileOutputStream out = new FileOutputStream(file);
120 | /* 压缩 储存 */
121 | if (frame.compress(Bitmap.CompressFormat.JPEG, 20, out)) {
122 | //
123 | out.flush();
124 | }
125 | out.close();
126 | } catch (FileNotFoundException e) {
127 | e.printStackTrace();
128 | } catch (IOException e) {
129 | e.printStackTrace();
130 | }
131 | }
132 |
133 | private static boolean checkFileCached(String fileName, int step, List result) {
134 | if (step == 0) {
135 | step = 1;
136 | }
137 | boolean isCached = false;
138 | int index = 0;
139 | File cachedFile = null;
140 | while (true) {
141 | cachedFile = new File(fileName + index);
142 | if (!cachedFile.exists()) {
143 | if (index == 0 || index > 250) {
144 | break;
145 | } else {
146 | index += 1;
147 | continue;
148 | }
149 | }
150 | isCached = true;
151 | result.add(new GalleryModel(Uri.fromFile(cachedFile), index));
152 | index += step;
153 | }
154 |
155 | return isCached;
156 | }
157 |
158 | }
159 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/beautify/util/WindowUtils.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | package org.easydarwin.video.beautify.util;
5 |
6 | import android.annotation.SuppressLint;
7 | import android.annotation.TargetApi;
8 | import android.app.Activity;
9 | import android.content.Context;
10 | import android.graphics.Point;
11 | import android.os.Build;
12 | import android.util.DisplayMetrics;
13 | import android.view.Display;
14 | import android.view.Window;
15 | import android.view.WindowManager;
16 |
17 | /**
18 | *
19 | */
20 | public class WindowUtils {
21 | private WindowUtils() {
22 | }
23 |
24 | /**
25 | * 获取屏幕尺寸工具
26 | *
27 | * @param mContext
28 | * 上下文
29 | * @return Point size ex:size.x,size.y
30 | */
31 | @SuppressWarnings("deprecation")
32 | @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
33 | public static Point getScreenSize(Context mContext) {
34 | Point size = new Point();
35 | if (Build.VERSION.SDK_INT > 13) {
36 | WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
37 | Display display = wm.getDefaultDisplay();
38 | display.getSize(size);
39 | } else if (Build.VERSION.SDK_INT < 13 && Build.VERSION.SDK_INT > 8) {
40 | WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
41 | Display display = wm.getDefaultDisplay();
42 | int width = display.getWidth();
43 | int height = display.getHeight();
44 | size.set(width, height);
45 | } else if (Build.VERSION.SDK_INT <= 8) {
46 | DisplayMetrics dm = mContext.getResources().getDisplayMetrics();
47 | size.set(dm.widthPixels, dm.heightPixels);
48 | }
49 | return size;
50 | }
51 |
52 | /**
53 | * 实现全屏
54 | *
55 | * @param a
56 | */
57 | @SuppressLint("InlinedApi")
58 | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
59 | public static void fullScreen(Activity a) {
60 | if (Build.VERSION.SDK_INT >= 11) {
61 | // a.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
62 | } else if (Build.VERSION.SDK_INT < 11) {
63 | a.requestWindowFeature(Window.FEATURE_NO_TITLE);
64 | a.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
65 | }
66 | }
67 |
68 | /**
69 | * 根据手机的分辨率从 dp 的单位 转成为 px(像素)
70 | */
71 | public static int dip2px(Context context, float dpValue) {
72 | final float scale = context.getResources().getDisplayMetrics().density;
73 | return (int) (dpValue * scale + 0.5f);
74 | }
75 |
76 | /**
77 | * 根据手机的分辨率从 px(像素) 的单位 转成为 dp
78 | */
79 | public static int px2dip(Context context, float pxValue) {
80 | final float scale = context.getResources().getDisplayMetrics().density;
81 | return (int) (pxValue / scale + 0.5f);
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/recoder/base/Application.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.recoder.base;
2 |
3 | import java.io.File;
4 | import java.io.IOException;
5 |
6 | import org.easydarwin.video.recoder.conf.Conf;
7 | import org.easydarwin.video.recoder.utils.AndroidUtils;
8 |
9 | import android.os.Environment;
10 |
11 | public class Application extends android.app.Application {
12 |
13 | @Override
14 | public void onCreate() {
15 | super.onCreate();
16 | initApplication();
17 | }
18 |
19 | private void initApplication() {
20 | initFolder();
21 | AndroidUtils.init(getApplicationContext());
22 | }
23 |
24 | private void initFolder() {
25 | String root = Environment.getExternalStorageDirectory().getAbsolutePath();
26 | File baseDir = new File(root + Conf.BASE_DIR);
27 | if (!baseDir.exists()) {
28 | baseDir.mkdir();
29 | }
30 | File vsDir = new File(root + Conf.VS_DIR);
31 | if (!vsDir.exists()) {
32 | vsDir.mkdir();
33 |
34 | }
35 | File vsNonmedia = new File(root + Conf.VS_DIR, ".nonmedia");
36 | if (!vsNonmedia.exists()) {
37 | try {
38 | vsNonmedia.createNewFile();
39 | } catch (IOException e) {
40 | }
41 | }
42 |
43 | File tmpDir = new File(root + Conf.TMP_DIR);
44 | if (!tmpDir.exists()) {
45 | tmpDir.mkdir();
46 | }
47 |
48 | File videoTmpDir = new File(root + Conf.VIDEO_TMP_DIR);
49 | if (!videoTmpDir.exists()) {
50 | videoTmpDir.mkdir();
51 | }
52 |
53 | File videoTmpNonmedia = new File(root + Conf.VIDEO_TMP_DIR, ".nonmedia");
54 | if (!videoTmpNonmedia.exists()) {
55 | try {
56 | videoTmpNonmedia.createNewFile();
57 | } catch (IOException e) {
58 | }
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/recoder/base/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.recoder.base;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.app.Activity;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.graphics.Point;
8 | import android.os.Build;
9 | import android.os.Bundle;
10 | import android.view.Display;
11 | import butterknife.ButterKnife;
12 |
13 | public abstract class BaseActivity extends Activity {
14 | public int[] screenSize;
15 | public Context context;
16 |
17 | @Override
18 | protected void onCreate(Bundle savedInstanceState) {
19 | context = this;
20 | super.onCreate(savedInstanceState);
21 | }
22 |
23 | @Override
24 | public void setContentView(int layoutResID) {
25 | super.setContentView(layoutResID);
26 | ButterKnife.inject(this);
27 | init();
28 | }
29 |
30 | private void init() {
31 | screenSize = getScreenSize();
32 | }
33 |
34 | @SuppressWarnings("deprecation")
35 | @SuppressLint("NewApi")
36 | private int[] getScreenSize() {
37 | int[] res = new int[2];
38 | Display display = getWindowManager().getDefaultDisplay();
39 | if (Build.VERSION.SDK_INT >= 13) {
40 | Point size = new Point();
41 | display.getSize(size);
42 | res[0] = size.x;
43 | res[1] = size.y;
44 | } else {
45 | res[0] = display.getWidth(); // deprecated
46 | res[1] = display.getHeight(); // deprecated
47 | }
48 | return res;
49 | }
50 |
51 | protected void startActivity(final Class> activityClass, Bundle extras) {
52 | Intent intent = new Intent(this, activityClass);
53 | intent.putExtras(extras);
54 | startActivity(intent);
55 | }
56 |
57 | protected void startActivity(final Class> activityClass) {
58 | startActivity(new Intent(this, activityClass));
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/recoder/conf/Conf.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.recoder.conf;
2 |
3 | public class Conf {
4 | public static final int VIDEO_FRAMERATE = 20;
5 | public static final String BASE_DIR = "/org.easydarwin.video";
6 | public static final String TMP_DIR = BASE_DIR + "/tmp";
7 | public static final String VS_DIR = BASE_DIR + "/.vs";
8 | public static final String VIDEO_TMP_DIR = TMP_DIR + "/.video";
9 |
10 | public static final float MAX_RECORD_TIME = 15 * 1000f;
11 | public static final float MIN_RECORD_TIME = 2 * 1000f;
12 | }
13 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/recoder/utils/Logger.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.recoder.utils;
2 |
3 | import android.util.Log;
4 |
5 | public class Logger {
6 | private static String DEFAULT_TAG = "FaceRecorder ==>";
7 | private final static boolean DEBUG = true;
8 |
9 | public static void setTag(String tag) {
10 | DEFAULT_TAG = tag;
11 | }
12 |
13 | public static int d(Object msg) {
14 | return Log.d(Logger.DEFAULT_TAG, String.valueOf(msg));
15 | }
16 |
17 | public static int d(Object msg, Throwable tr) {
18 | return Log.d(Logger.DEFAULT_TAG, String.valueOf(msg), tr);
19 | }
20 |
21 | public static int d(String tag, Object msg) {
22 | return Log.d(tag, String.valueOf(msg));
23 | }
24 |
25 | public static int d(String tag, Object msg, Throwable tr) {
26 | return Log.d(tag, String.valueOf(msg), tr);
27 | }
28 |
29 | public static int e(Object msg) {
30 | return Log.e(Logger.DEFAULT_TAG, String.valueOf(msg));
31 | }
32 |
33 | public static int e(Object msg, Throwable tr) {
34 | return Log.e(Logger.DEFAULT_TAG, String.valueOf(msg), tr);
35 | }
36 |
37 | public static int e(String tag, Object msg) {
38 | return Log.d(tag, String.valueOf(msg));
39 | }
40 |
41 | public static int e(String tag, Object msg, Throwable tr) {
42 | return Log.e(tag, String.valueOf(msg), tr);
43 | }
44 |
45 | public static int i(Object msg) {
46 | return Log.i(Logger.DEFAULT_TAG, String.valueOf(msg));
47 | }
48 |
49 | public static int i(Object msg, Throwable tr) {
50 | return Log.i(Logger.DEFAULT_TAG, String.valueOf(msg), tr);
51 | }
52 |
53 | public static int i(String tag, Object msg) {
54 | return Log.i(tag, String.valueOf(msg));
55 | }
56 |
57 | public static int i(String tag, Object msg, Throwable tr) {
58 | return Log.i(tag, String.valueOf(msg), tr);
59 | }
60 |
61 | public static void printStackTrace(Throwable e) {
62 | if (e == null) {
63 | return;
64 | }
65 | if (DEBUG) {
66 | e.printStackTrace();
67 | }
68 | }
69 |
70 | public static void t(Object msg) {
71 | if (DEBUG) {
72 | Log.v(Logger.DEFAULT_TAG, String.valueOf(msg));
73 | }
74 | }
75 |
76 | public static void t(Object msg, Throwable tr) {
77 | if (DEBUG) {
78 | Log.v(Logger.DEFAULT_TAG, String.valueOf(msg), tr);
79 | }
80 | }
81 |
82 | public static void t(String tag, Object msg) {
83 | if (DEBUG) {
84 | Log.v(tag, String.valueOf(msg));
85 | }
86 | }
87 |
88 | public static int v(Object msg) {
89 | return Log.v(Logger.DEFAULT_TAG, String.valueOf(msg));
90 | }
91 |
92 | public static int v(Object msg, Throwable tr) {
93 | return Log.v(Logger.DEFAULT_TAG, String.valueOf(msg), tr);
94 | }
95 |
96 | public static int v(String tag, Object msg) {
97 | return Log.v(tag, String.valueOf(msg));
98 | }
99 |
100 | public static int v(String tag, Object msg, Throwable tr) {
101 | return Log.v(tag, String.valueOf(msg), tr);
102 | }
103 |
104 | public static int w(Object msg) {
105 | return Log.w(Logger.DEFAULT_TAG, String.valueOf(msg));
106 | }
107 |
108 | public static int w(Object msg, Throwable tr) {
109 | return Log.w(Logger.DEFAULT_TAG, String.valueOf(msg), tr);
110 | }
111 |
112 | public static int w(String tag, Object msg) {
113 | return Log.w(tag, String.valueOf(msg));
114 | }
115 |
116 | public static int w(String tag, Object msg, Throwable tr) {
117 | return Log.w(tag, String.valueOf(msg), tr);
118 | }
119 |
120 | public static int w(String tag, Throwable tr) {
121 | return Log.w(tag, tr);
122 | }
123 |
124 | public static int w(Throwable tr) {
125 | return Log.w(Logger.DEFAULT_TAG, tr);
126 | }
127 |
128 | private Logger() {
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/Android/src/org/easydarwin/video/recoder/view/VideoPreviewView.java:
--------------------------------------------------------------------------------
1 | package org.easydarwin.video.recoder.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.SurfaceView;
6 |
7 | public class VideoPreviewView extends SurfaceView {
8 | public static float DONT_CARE = 0.0f;
9 | private double mAspectRatio = DONT_CARE;
10 | private int mCameraW;
11 | private int mCameraH;
12 | private int mSqueraW;
13 |
14 | public VideoPreviewView(Context context) {
15 | super(context);
16 | }
17 |
18 | public VideoPreviewView(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | }
21 |
22 | public VideoPreviewView(Context context, AttributeSet attrs, int defStyle) {
23 | super(context, attrs, defStyle);
24 | }
25 |
26 | public void setAspectRatio(int cameraW, int cameraH, int squareW) {
27 | mCameraW = cameraW;
28 | mCameraH = cameraH;
29 | mSqueraW = squareW;
30 | double ratio = (double) mCameraW / mCameraH;
31 | if (ratio <= 0.0) {
32 | throw new IllegalArgumentException();
33 | }
34 | if (mAspectRatio != ratio) {
35 | mAspectRatio = ratio;
36 | requestLayout();
37 | invalidate();
38 | }
39 | }
40 |
41 | @Override
42 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
43 | if (mAspectRatio != DONT_CARE) {
44 | int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
45 | int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec);
46 |
47 | int width = widthSpecSize;
48 | int height = heightSpecSize;
49 |
50 | if (width > 0 && height > 0) {
51 |
52 | int min = Math.min(mCameraW, mCameraH);
53 | if (min < mSqueraW) {
54 | float scale = (float) mSqueraW / min;
55 | setMeasuredDimension((int) (mCameraW * scale), (int) (mCameraH * scale));
56 | } else {
57 | float scale = (float) min / mSqueraW;
58 | setMeasuredDimension((int) (mCameraW / scale), (int) (mCameraH / scale));
59 | }
60 | return;
61 | }
62 | }
63 |
64 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # EasyVideoRecorder #
2 |
3 | EasyVideoRecorder是EasyDarwin开源团队成员开发的一款移动端短视频拍摄工具库,类似于美拍、秒拍、微拍的短视频拍摄功能,支持按住拍、滤镜、mv、照片合成、水印、本地视频导入功能,并且还在不断扩展功能中!开源团队成员经过多年技术积累,开发出的拍摄库支持Android、IOS平台,适配性好,比同行业的视频合成技术在:速度,稳定性,适配性上都具有一定的技术优势!
4 |
5 | - 拍摄
6 | - 断点拍摄
7 | - 回删
8 | - 摄像头切换
9 | - 焦距调节
10 | - 滤镜
11 | - MV
12 | - 关闭原音
13 | - 背景音乐
14 | - 视频水印
15 | - 不断扩展中…
16 |
17 | **EasyVideoRecorder SDK库个人使用免费,企业及商用需要经过授权,支持滤镜、MV定制**;
18 |
19 |
20 | ## 获取更多信息 ##
21 |
22 | 邮件:[support@easydarwin.org](mailto:support@easydarwin.org)
23 |
24 | WEB:[www.EasyDarwin.org](http://www.easydarwin.org)
25 |
26 | Author:[Holo@EasyDarwin.org](mailto:Holo@EasyDarwin.org "EasyDarwin Holo")
27 |
28 | QQ交流群:[201790130](http://jq.qq.com/?_wv=1027&k=2Fz1eP2 "EasyVideoRecorder短视频")
29 |
30 | Copyright © EasyDarwin.ORG 2012-2016
31 |
32 | 
33 |
--------------------------------------------------------------------------------
/Release/EasyVideoDemo1.0.16.0301.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/StrangerMosr/EasyVideoRecorder/e04b1309171f547d774e4a20f07f4c44bafc9147/Release/EasyVideoDemo1.0.16.0301.apk
--------------------------------------------------------------------------------