├── .project
├── AndroidManifest.xml
├── libs
├── android-support-v4.jar
├── armeabi
│ ├── libavcodec.so
│ ├── libavdevice.so
│ ├── libavfilter.so
│ ├── libavformat.so
│ ├── libavutil.so
│ ├── libjniARToolKitPlus.so
│ ├── libjniavcodec.so
│ ├── libjniavdevice.so
│ ├── libjniavfilter.so
│ ├── libjniavformat.so
│ ├── libjniavutil.so
│ ├── libjnicvkernels.so
│ ├── libjniopencv_calib3d.so
│ ├── libjniopencv_contrib.so
│ ├── libjniopencv_core.so
│ ├── libjniopencv_features2d.so
│ ├── libjniopencv_flann.so
│ ├── libjniopencv_highgui.so
│ ├── libjniopencv_imgproc.so
│ ├── libjniopencv_legacy.so
│ ├── libjniopencv_ml.so
│ ├── libjniopencv_nonfree.so
│ ├── libjniopencv_objdetect.so
│ ├── libjniopencv_photo.so
│ ├── libjniopencv_stitching.so
│ ├── libjniopencv_video.so
│ ├── libjniopencv_videostab.so
│ ├── libjnipostproc.so
│ ├── libjniswresample.so
│ ├── libjniswscale.so
│ ├── libopencv_calib3d.so
│ ├── libopencv_contrib.so
│ ├── libopencv_core.so
│ ├── libopencv_features2d.so
│ ├── libopencv_flann.so
│ ├── libopencv_highgui.so
│ ├── libopencv_imgproc.so
│ ├── libopencv_info.so
│ ├── libopencv_legacy.so
│ ├── libopencv_ml.so
│ ├── libopencv_nonfree.so
│ ├── libopencv_objdetect.so
│ ├── libopencv_photo.so
│ ├── libopencv_stitching.so
│ ├── libopencv_ts.so
│ ├── libopencv_video.so
│ ├── libopencv_videostab.so
│ ├── libpostproc.so
│ ├── libswresample.so
│ ├── libswscale.so
│ └── libtbb.so
├── javacpp.jar
└── javacv.jar
├── project.properties
├── res
├── drawable-hdpi
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── layout
│ └── activity_main.xml
├── menu
│ └── main.xml
├── values-sw600dp
│ └── dimens.xml
├── values-sw720dp-land
│ └── dimens.xml
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
└── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
└── src
└── com
└── example
└── javacv05streamtest
└── MainActivity.java
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | JavaCV 0.5 StreamTest
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 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
22 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/libs/armeabi/libavcodec.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libavcodec.so
--------------------------------------------------------------------------------
/libs/armeabi/libavdevice.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libavdevice.so
--------------------------------------------------------------------------------
/libs/armeabi/libavfilter.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libavfilter.so
--------------------------------------------------------------------------------
/libs/armeabi/libavformat.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libavformat.so
--------------------------------------------------------------------------------
/libs/armeabi/libavutil.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libavutil.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniARToolKitPlus.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniARToolKitPlus.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniavcodec.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniavcodec.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniavdevice.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniavdevice.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniavfilter.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniavfilter.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniavformat.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniavformat.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniavutil.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniavutil.so
--------------------------------------------------------------------------------
/libs/armeabi/libjnicvkernels.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjnicvkernels.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_calib3d.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_calib3d.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_contrib.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_contrib.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_core.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_features2d.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_features2d.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_flann.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_flann.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_highgui.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_highgui.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_imgproc.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_imgproc.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_legacy.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_legacy.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_ml.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_ml.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_nonfree.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_nonfree.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_objdetect.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_objdetect.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_photo.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_photo.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_stitching.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_stitching.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_video.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_video.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniopencv_videostab.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniopencv_videostab.so
--------------------------------------------------------------------------------
/libs/armeabi/libjnipostproc.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjnipostproc.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniswresample.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniswresample.so
--------------------------------------------------------------------------------
/libs/armeabi/libjniswscale.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libjniswscale.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_calib3d.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_calib3d.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_contrib.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_contrib.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_core.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_core.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_features2d.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_features2d.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_flann.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_flann.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_highgui.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_highgui.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_imgproc.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_imgproc.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_info.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_info.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_legacy.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_legacy.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_ml.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_ml.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_nonfree.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_nonfree.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_objdetect.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_objdetect.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_photo.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_photo.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_stitching.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_stitching.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_ts.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_ts.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_video.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_video.so
--------------------------------------------------------------------------------
/libs/armeabi/libopencv_videostab.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libopencv_videostab.so
--------------------------------------------------------------------------------
/libs/armeabi/libpostproc.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libpostproc.so
--------------------------------------------------------------------------------
/libs/armeabi/libswresample.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libswresample.so
--------------------------------------------------------------------------------
/libs/armeabi/libswscale.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libswscale.so
--------------------------------------------------------------------------------
/libs/armeabi/libtbb.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/armeabi/libtbb.so
--------------------------------------------------------------------------------
/libs/javacpp.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/javacpp.jar
--------------------------------------------------------------------------------
/libs/javacv.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/libs/javacv.jar
--------------------------------------------------------------------------------
/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-17
15 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vanevery/JavaCV-0.5-Stream-Test/2437444b0cf7ce1bcb2fb843d211430bdcf93e8a/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/res/values-sw600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/res/values-sw720dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | 128dp
8 |
9 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | JavaCV 0.5 Stream Test
5 | Settings
6 | Hello world!
7 |
8 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
--------------------------------------------------------------------------------
/src/com/example/javacv05streamtest/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.javacv05streamtest;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.content.pm.ActivityInfo;
6 | import android.graphics.Bitmap;
7 | import android.graphics.Canvas;
8 | import android.graphics.Color;
9 | import android.graphics.ImageFormat;
10 | import android.graphics.Paint;
11 | import android.graphics.RectF;
12 | import android.hardware.Camera;
13 | import android.hardware.Camera.PreviewCallback;
14 | import android.media.AudioFormat;
15 | import android.media.AudioRecord;
16 | import android.media.MediaRecorder;
17 | import android.os.Bundle;
18 | import android.os.PowerManager;
19 | import android.util.Log;
20 | import android.view.KeyEvent;
21 | import android.view.SurfaceHolder;
22 | import android.view.SurfaceView;
23 | import android.view.View;
24 | import android.view.View.OnClickListener;
25 | import android.widget.Button;
26 | import android.widget.LinearLayout;
27 |
28 | import java.io.IOException;
29 | import java.nio.Buffer;
30 | import java.nio.ShortBuffer;
31 |
32 | import com.googlecode.javacv.FrameRecorder;
33 | import com.googlecode.javacv.FFmpegFrameRecorder;
34 | import com.googlecode.javacv.cpp.opencv_core.IplImage;
35 |
36 | import static com.googlecode.javacv.cpp.opencv_core.*;
37 |
38 | public class MainActivity extends Activity implements OnClickListener {
39 |
40 | private final static String LOG_TAG = "MainActivity";
41 |
42 | private PowerManager.WakeLock mWakeLock;
43 |
44 | private String ffmpeg_link = "rtmp://username:password@xxx.xxx.xxx.xxx:1935/live/test.flv";
45 | //private String ffmpeg_link = "/mnt/sdcard/new_stream.flv";
46 |
47 | private volatile FFmpegFrameRecorder recorder;
48 | boolean recording = false;
49 | long startTime = 0;
50 |
51 | private int sampleAudioRateInHz = 44100;
52 | private int imageWidth = 320;
53 | private int imageHeight = 240;
54 | private int frameRate = 30;
55 |
56 | private Thread audioThread;
57 | volatile boolean runAudioThread = true;
58 | private AudioRecord audioRecord;
59 | private AudioRecordRunnable audioRecordRunnable;
60 |
61 | private CameraView cameraView;
62 | private IplImage yuvIplimage = null;
63 |
64 | private Button recordButton;
65 | private LinearLayout mainLayout;
66 |
67 | @Override
68 | public void onCreate(Bundle savedInstanceState) {
69 | super.onCreate(savedInstanceState);
70 |
71 | setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
72 | setContentView(R.layout.activity_main);
73 |
74 | initLayout();
75 | initRecorder();
76 | }
77 |
78 | @Override
79 | protected void onResume() {
80 | super.onResume();
81 |
82 | if (mWakeLock == null) {
83 | PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
84 | mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, LOG_TAG);
85 | mWakeLock.acquire();
86 | }
87 | }
88 |
89 | @Override
90 | protected void onPause() {
91 | super.onPause();
92 |
93 | if (mWakeLock != null) {
94 | mWakeLock.release();
95 | mWakeLock = null;
96 | }
97 | }
98 |
99 | @Override
100 | protected void onDestroy() {
101 | super.onDestroy();
102 |
103 | recording = false;
104 | }
105 |
106 |
107 | private void initLayout() {
108 |
109 | mainLayout = (LinearLayout) this.findViewById(R.id.record_layout);
110 |
111 | recordButton = (Button) findViewById(R.id.recorder_control);
112 | recordButton.setText("Start");
113 | recordButton.setOnClickListener(this);
114 |
115 | cameraView = new CameraView(this);
116 |
117 | LinearLayout.LayoutParams layoutParam = new LinearLayout.LayoutParams(imageWidth, imageHeight);
118 | mainLayout.addView(cameraView, layoutParam);
119 | Log.v(LOG_TAG, "added cameraView to mainLayout");
120 | }
121 |
122 | private void initRecorder() {
123 | Log.w(LOG_TAG,"initRecorder");
124 |
125 | if (yuvIplimage == null) {
126 | // Recreated after frame size is set in surface change method
127 | yuvIplimage = IplImage.create(imageWidth, imageHeight, IPL_DEPTH_8U, 2);
128 | //yuvIplimage = IplImage.create(imageWidth, imageHeight, IPL_DEPTH_32S, 2);
129 |
130 | Log.v(LOG_TAG, "IplImage.create");
131 | }
132 |
133 | recorder = new FFmpegFrameRecorder(ffmpeg_link, imageWidth, imageHeight, 1);
134 | Log.v(LOG_TAG, "FFmpegFrameRecorder: " + ffmpeg_link + " imageWidth: " + imageWidth + " imageHeight " + imageHeight);
135 |
136 | recorder.setFormat("flv");
137 | Log.v(LOG_TAG, "recorder.setFormat(\"flv\")");
138 |
139 | recorder.setSampleRate(sampleAudioRateInHz);
140 | Log.v(LOG_TAG, "recorder.setSampleRate(sampleAudioRateInHz)");
141 |
142 | // re-set in the surface changed method as well
143 | recorder.setFrameRate(frameRate);
144 | Log.v(LOG_TAG, "recorder.setFrameRate(frameRate)");
145 |
146 | // Create audio recording thread
147 | audioRecordRunnable = new AudioRecordRunnable();
148 | audioThread = new Thread(audioRecordRunnable);
149 | }
150 |
151 | // Start the capture
152 | public void startRecording() {
153 | try {
154 | recorder.start();
155 | startTime = System.currentTimeMillis();
156 | recording = true;
157 | audioThread.start();
158 | } catch (FFmpegFrameRecorder.Exception e) {
159 | e.printStackTrace();
160 | }
161 | }
162 |
163 | public void stopRecording() {
164 | // This should stop the audio thread from running
165 | runAudioThread = false;
166 |
167 | if (recorder != null && recording) {
168 | recording = false;
169 | Log.v(LOG_TAG,"Finishing recording, calling stop and release on recorder");
170 | try {
171 | recorder.stop();
172 | recorder.release();
173 | } catch (FFmpegFrameRecorder.Exception e) {
174 | e.printStackTrace();
175 | }
176 | recorder = null;
177 | }
178 | }
179 |
180 | @Override
181 | public boolean onKeyDown(int keyCode, KeyEvent event) {
182 | // Quit when back button is pushed
183 | if (keyCode == KeyEvent.KEYCODE_BACK) {
184 | if (recording) {
185 | stopRecording();
186 | }
187 | finish();
188 | return true;
189 | }
190 | return super.onKeyDown(keyCode, event);
191 | }
192 |
193 | @Override
194 | public void onClick(View v) {
195 | if (!recording) {
196 | startRecording();
197 | Log.w(LOG_TAG, "Start Button Pushed");
198 | recordButton.setText("Stop");
199 | } else {
200 | stopRecording();
201 | Log.w(LOG_TAG, "Stop Button Pushed");
202 | recordButton.setText("Start");
203 | }
204 | }
205 |
206 | //---------------------------------------------
207 | // audio thread, gets and encodes audio data
208 | //---------------------------------------------
209 | class AudioRecordRunnable implements Runnable {
210 |
211 | @Override
212 | public void run() {
213 | // Set the thread priority
214 | android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);
215 |
216 | // Audio
217 | int bufferSize;
218 | short[] audioData;
219 | int bufferReadResult;
220 |
221 | bufferSize = AudioRecord.getMinBufferSize(sampleAudioRateInHz,
222 | AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT);
223 | audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, sampleAudioRateInHz,
224 | AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, bufferSize);
225 |
226 | audioData = new short[bufferSize];
227 |
228 | Log.d(LOG_TAG, "audioRecord.startRecording()");
229 | audioRecord.startRecording();
230 |
231 | // Audio Capture/Encoding Loop
232 | while (runAudioThread) {
233 | // Read from audioRecord
234 | bufferReadResult = audioRecord.read(audioData, 0, audioData.length);
235 | if (bufferReadResult > 0) {
236 | //Log.v(LOG_TAG,"audioRecord bufferReadResult: " + bufferReadResult);
237 |
238 | // Changes in this variable may not be picked up despite it being "volatile"
239 | if (recording) {
240 | try {
241 | // Write to FFmpegFrameRecorder
242 | Buffer[] buffer = {ShortBuffer.wrap(audioData, 0, bufferReadResult)};
243 | recorder.record(buffer);
244 | } catch (FFmpegFrameRecorder.Exception e) {
245 | Log.v(LOG_TAG,e.getMessage());
246 | e.printStackTrace();
247 | }
248 | }
249 | }
250 | }
251 | Log.v(LOG_TAG,"AudioThread Finished");
252 |
253 | /* Capture/Encoding finished, release recorder */
254 | if (audioRecord != null) {
255 | audioRecord.stop();
256 | audioRecord.release();
257 | audioRecord = null;
258 | Log.v(LOG_TAG,"audioRecord released");
259 | }
260 | }
261 | }
262 |
263 | class CameraView extends SurfaceView implements SurfaceHolder.Callback, PreviewCallback {
264 |
265 | private boolean previewRunning = false;
266 |
267 | private SurfaceHolder holder;
268 | private Camera camera;
269 |
270 | private byte[] previewBuffer;
271 |
272 | long videoTimestamp = 0;
273 |
274 | Bitmap bitmap;
275 | Canvas canvas;
276 |
277 | public CameraView(Context _context) {
278 | super(_context);
279 |
280 | holder = this.getHolder();
281 | holder.addCallback(this);
282 | holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
283 | }
284 |
285 | @Override
286 | public void surfaceCreated(SurfaceHolder holder) {
287 | camera = Camera.open();
288 |
289 | try {
290 | camera.setPreviewDisplay(holder);
291 | camera.setPreviewCallback(this);
292 |
293 | Camera.Parameters currentParams = camera.getParameters();
294 | Log.v(LOG_TAG,"Preview Framerate: " + currentParams.getPreviewFrameRate());
295 | Log.v(LOG_TAG,"Preview imageWidth: " + currentParams.getPreviewSize().width + " imageHeight: " + currentParams.getPreviewSize().height);
296 |
297 | // Use these values
298 | imageWidth = currentParams.getPreviewSize().width;
299 | imageHeight = currentParams.getPreviewSize().height;
300 | frameRate = currentParams.getPreviewFrameRate();
301 |
302 | bitmap = Bitmap.createBitmap(imageWidth, imageHeight, Bitmap.Config.ALPHA_8);
303 |
304 |
305 | /*
306 | Log.v(LOG_TAG,"Creating previewBuffer size: " + imageWidth * imageHeight * ImageFormat.getBitsPerPixel(currentParams.getPreviewFormat())/8);
307 | previewBuffer = new byte[imageWidth * imageHeight * ImageFormat.getBitsPerPixel(currentParams.getPreviewFormat())/8];
308 | camera.addCallbackBuffer(previewBuffer);
309 | camera.setPreviewCallbackWithBuffer(this);
310 | */
311 |
312 | camera.startPreview();
313 | previewRunning = true;
314 | }
315 | catch (IOException e) {
316 | Log.v(LOG_TAG,e.getMessage());
317 | e.printStackTrace();
318 | }
319 | }
320 |
321 | public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
322 | Log.v(LOG_TAG,"Surface Changed: width " + width + " height: " + height);
323 |
324 | // We would do this if we want to reset the camera parameters
325 | /*
326 | if (!recording) {
327 | if (previewRunning){
328 | camera.stopPreview();
329 | }
330 |
331 | try {
332 | //Camera.Parameters cameraParameters = camera.getParameters();
333 | //p.setPreviewSize(imageWidth, imageHeight);
334 | //p.setPreviewFrameRate(frameRate);
335 | //camera.setParameters(cameraParameters);
336 |
337 | camera.setPreviewDisplay(holder);
338 | camera.startPreview();
339 | previewRunning = true;
340 | }
341 | catch (IOException e) {
342 | Log.e(LOG_TAG,e.getMessage());
343 | e.printStackTrace();
344 | }
345 | }
346 | */
347 |
348 | // Get the current parameters
349 | Camera.Parameters currentParams = camera.getParameters();
350 | Log.v(LOG_TAG,"Preview Framerate: " + currentParams.getPreviewFrameRate());
351 | Log.v(LOG_TAG,"Preview imageWidth: " + currentParams.getPreviewSize().width + " imageHeight: " + currentParams.getPreviewSize().height);
352 |
353 | // Use these values
354 | imageWidth = currentParams.getPreviewSize().width;
355 | imageHeight = currentParams.getPreviewSize().height;
356 | frameRate = currentParams.getPreviewFrameRate();
357 |
358 | // Create the yuvIplimage if needed
359 | yuvIplimage = IplImage.create(imageWidth, imageHeight, IPL_DEPTH_8U, 2);
360 | //yuvIplimage = IplImage.create(imageWidth, imageHeight, IPL_DEPTH_32S, 2);
361 | }
362 |
363 | @Override
364 | public void surfaceDestroyed(SurfaceHolder holder) {
365 | try {
366 | camera.setPreviewCallback(null);
367 |
368 | previewRunning = false;
369 | camera.release();
370 |
371 | } catch (RuntimeException e) {
372 | Log.v(LOG_TAG,e.getMessage());
373 | e.printStackTrace();
374 | }
375 | }
376 |
377 | @Override
378 | public void onPreviewFrame(byte[] data, Camera camera) {
379 |
380 | if (yuvIplimage != null && recording) {
381 | videoTimestamp = 1000 * (System.currentTimeMillis() - startTime);
382 |
383 | // Put the camera preview frame right into the yuvIplimage object
384 | yuvIplimage.getByteBuffer().put(data);
385 |
386 | // FAQ about IplImage:
387 | // - For custom raw processing of data, getByteBuffer() returns an NIO direct
388 | // buffer wrapped around the memory pointed by imageData, and under Android we can
389 | // also use that Buffer with Bitmap.copyPixelsFromBuffer() and copyPixelsToBuffer().
390 | // - To get a BufferedImage from an IplImage, we may call getBufferedImage().
391 | // - The createFrom() factory method can construct an IplImage from a BufferedImage.
392 | // - There are also a few copy*() methods for BufferedImage<->IplImage data transfers.
393 |
394 | // Let's try it..
395 | // This works but only on transparency
396 | // Need to find the right Bitmap and IplImage matching types
397 |
398 | /*
399 | bitmap.copyPixelsFromBuffer(yuvIplimage.getByteBuffer());
400 | //bitmap.setPixel(10,10,Color.MAGENTA);
401 |
402 | canvas = new Canvas(bitmap);
403 | Paint paint = new Paint();
404 | paint.setColor(Color.GREEN);
405 | float leftx = 20;
406 | float topy = 20;
407 | float rightx = 50;
408 | float bottomy = 100;
409 | RectF rectangle = new RectF(leftx,topy,rightx,bottomy);
410 | canvas.drawRect(rectangle, paint);
411 |
412 | bitmap.copyPixelsToBuffer(yuvIplimage.getByteBuffer());
413 | */
414 | //Log.v(LOG_TAG,"Writing Frame");
415 |
416 | try {
417 |
418 | // Get the correct time
419 | recorder.setTimestamp(videoTimestamp);
420 |
421 | // Record the image into FFmpegFrameRecorder
422 | recorder.record(yuvIplimage);
423 |
424 | } catch (FFmpegFrameRecorder.Exception e) {
425 | Log.v(LOG_TAG,e.getMessage());
426 | e.printStackTrace();
427 | }
428 | }
429 | }
430 | }
431 | }
--------------------------------------------------------------------------------