Commit fe60a519 by Kim Jinsung

撮影したあと、Wi-Fi機能をOFFにした場合、ダイアログが2個表示される問題対応

parent 0e1c9ffd
...@@ -111,6 +111,14 @@ public class MJpegView extends SurfaceView implements SurfaceHolder.Callback { ...@@ -111,6 +111,14 @@ public class MJpegView extends SurfaceView implements SurfaceHolder.Callback {
play(); play();
} }
/**
* Get source stream for receiving motion JPEG
* @return Source stream
*/
public MJpegInputStream getSource() {
return mMJpegInputStream;
}
@Override @Override
public void surfaceCreated(SurfaceHolder holder) { public void surfaceCreated(SurfaceHolder holder) {
existSurface = true; existSurface = true;
......
...@@ -49,6 +49,8 @@ public class ThetaActivity extends ABVUIActivity { ...@@ -49,6 +49,8 @@ public class ThetaActivity extends ABVUIActivity {
if (mWifiScanType == Constant.WifiScanType.CloseCameraActivity) { if (mWifiScanType == Constant.WifiScanType.CloseCameraActivity) {
//THETAカメラのWi-Fi機能を無効にするAPI送信 //THETAカメラのWi-Fi機能を無効にするAPI送信
new FinishWlanTask((ThetaCameraActivity) ActivityHandlingHelper.getInstance().getCurrentActivity()).execute(); new FinishWlanTask((ThetaCameraActivity) ActivityHandlingHelper.getInstance().getCurrentActivity()).execute();
} else if (mWifiScanType == Constant.WifiScanType.ThetaConnectError) {
thetaCameraWifiConnected();
} }
} else { } else {
Logger.d(TAG, "ThetaカメラWi-Fi非接続状態"); Logger.d(TAG, "ThetaカメラWi-Fi非接続状態");
...@@ -96,4 +98,9 @@ public class ThetaActivity extends ABVUIActivity { ...@@ -96,4 +98,9 @@ public class ThetaActivity extends ABVUIActivity {
mWifiManager.startScan(); mWifiManager.startScan();
mWifiScanType = Constant.WifiScanType.CloseCameraActivity; mWifiScanType = Constant.WifiScanType.CloseCameraActivity;
} }
/**
* 子クラスで定義
*/
protected void thetaCameraWifiConnected() {}
} }
...@@ -203,13 +203,7 @@ public class ThetaCameraActivity extends ThetaActivity { ...@@ -203,13 +203,7 @@ public class ThetaCameraActivity extends ThetaActivity {
@Override @Override
public void run() { public void run() {
mShootBtn.setEnabled(true); mShootBtn.setEnabled(true);
if (fileId.equals(ABookValues.FAIL)) { if (!fileId.equals(ABookValues.FAIL)) {
mLiveView.play();
if (mLivePreviewTask != null) {
mLivePreviewTask.cancel(true);
mLivePreviewTask = new ShowLiveViewTask(ThetaCameraActivity.this);
mLivePreviewTask.execute();
}
thetaConnectError(R.string.msg_theta_shoot_fail); thetaConnectError(R.string.msg_theta_shoot_fail);
} else { } else {
Intent intent = new Intent(); Intent intent = new Intent();
...@@ -275,4 +269,20 @@ public class ThetaCameraActivity extends ThetaActivity { ...@@ -275,4 +269,20 @@ public class ThetaCameraActivity extends ThetaActivity {
Logger.e(TAG, "setOptionExposureTaskFinish fail"); Logger.e(TAG, "setOptionExposureTaskFinish fail");
} }
} }
/**
* 撮影したあと、THETAカメラと通信失敗時、
* Wi-Fiが接続状態の場合、ライブ映像を再表示
*/
@Override
protected void thetaCameraWifiConnected() {
if (mLiveView.getSource() == null) {
if (mLivePreviewTask != null) {
mLivePreviewTask.cancel(true);
mLivePreviewTask = new ShowLiveViewTask(ThetaCameraActivity.this);
mLivePreviewTask.execute();
}
mLiveView.play();
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment