|
|
|
@ -60,6 +60,10 @@ public class Camera2VideoActivity extends AppCompatActivity {
|
|
|
|
|
public static final String ACTION_FINISH = "com.xypower.mvapp.ACT_FINISH";
|
|
|
|
|
public static final String ACTION_MP_VIDEO_FINISHED = "com.xypower.mpapp.ACT_V_FINISHED";
|
|
|
|
|
|
|
|
|
|
public static final int RESULT_TYPE_NONE = 0;
|
|
|
|
|
public static final int RESULT_TYPE_ACTIVITY_RESULT = 1;
|
|
|
|
|
public static final int RESULT_TYPE_BROADCAST = 2;
|
|
|
|
|
|
|
|
|
|
public final static int REQUEST_CODE_RECORDING = 2;
|
|
|
|
|
|
|
|
|
|
private static final int DEFAULT_FONT_SIZE = 32;
|
|
|
|
@ -104,7 +108,7 @@ public class Camera2VideoActivity extends AppCompatActivity {
|
|
|
|
|
private int mTimeMask = 0;
|
|
|
|
|
private int mStatusBarHeight = -1;
|
|
|
|
|
|
|
|
|
|
private boolean mActivityResult = false;
|
|
|
|
|
private int mResultType = RESULT_TYPE_NONE;
|
|
|
|
|
|
|
|
|
|
private static class OSD_ITEM
|
|
|
|
|
{
|
|
|
|
@ -257,7 +261,7 @@ public class Camera2VideoActivity extends AppCompatActivity {
|
|
|
|
|
mOSDRightTop = intent.getStringExtra("rightTopOsd");
|
|
|
|
|
mOSDMargin = intent.getIntExtra("margin", 12);
|
|
|
|
|
|
|
|
|
|
mActivityResult = intent.getBooleanExtra("ActivityResult", false);
|
|
|
|
|
mResultType = intent.getIntExtra("resultType", RESULT_TYPE_BROADCAST);
|
|
|
|
|
|
|
|
|
|
mCameraWidth = mVideoWidth;
|
|
|
|
|
mCameraHeight = mVideoHeight;
|
|
|
|
@ -330,7 +334,9 @@ public class Camera2VideoActivity extends AppCompatActivity {
|
|
|
|
|
mHandler.postDelayed(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
mNextVideoAbsolutePath = getVideoFilePath();
|
|
|
|
|
if (TextUtils.isEmpty(mNextVideoAbsolutePath)) {
|
|
|
|
|
mNextVideoAbsolutePath = getVideoFilePath();
|
|
|
|
|
}
|
|
|
|
|
if (mGPUCameraRecorder != null) {
|
|
|
|
|
mGPUCameraRecorder.start(mNextVideoAbsolutePath);
|
|
|
|
|
} else {
|
|
|
|
@ -735,7 +741,7 @@ public class Camera2VideoActivity extends AppCompatActivity {
|
|
|
|
|
private void setUpCamera() {
|
|
|
|
|
setUpCameraView();
|
|
|
|
|
|
|
|
|
|
if (mNextVideoAbsolutePath == null || mNextVideoAbsolutePath.isEmpty()) {
|
|
|
|
|
if (TextUtils.isEmpty(mNextVideoAbsolutePath)) {
|
|
|
|
|
mNextVideoAbsolutePath = getVideoFilePath(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -832,6 +838,10 @@ public class Camera2VideoActivity extends AppCompatActivity {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mResultType == RESULT_TYPE_NONE) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Context context = getApplicationContext();
|
|
|
|
|
String receiverName = MicroPhotoService.AlarmReceiver.class.getName();
|
|
|
|
|
String packageName = context.getPackageName();
|
|
|
|
@ -845,7 +855,7 @@ public class Camera2VideoActivity extends AppCompatActivity {
|
|
|
|
|
|
|
|
|
|
// intent.setComponent(new ComponentName(packageName, receiverName));
|
|
|
|
|
|
|
|
|
|
if (mActivityResult) {
|
|
|
|
|
if (mResultType == RESULT_TYPE_ACTIVITY_RESULT) {
|
|
|
|
|
setResult(RESULT_OK, intent);
|
|
|
|
|
} else {
|
|
|
|
|
// Log.i(TAG, "Notify recording videoId=" + Long.toString(mVideoId) + " " + path);
|
|
|
|
|