package net.osdn.gokigen.gr2control.camera.ricohgr2.wrapper;
-import android.support.annotation.NonNull;
import android.util.Log;
import net.osdn.gokigen.gr2control.camera.ILiveViewControl;
import net.osdn.gokigen.gr2control.liveview.liveviewlistener.CameraLiveViewListenerImpl;
import net.osdn.gokigen.gr2control.liveview.liveviewlistener.ILiveViewListener;
+import androidx.annotation.NonNull;
+
/**
*
*
{
private final String TAG = toString();
private final CameraLiveViewListenerImpl liveViewListener;
- private String liveViewUrl = "http://192.168.0.1/v1/display";
+ private final boolean useGrCommand;
+ private String cameraDisplayUrl = "http://192.168.0.1/v1/display"; // カメラの画面をコピーする場合...
+ private String liveViewUrl = "http://192.168.0.1/v1/liveview"; // 何も表示しない(ライブビューモード)の場合...
private float cropScale = 1.0f;
private boolean whileFetching = false;
private static final int FETCH_ERROR_MAX = 30;
*
*
*/
- RicohGr2LiveViewControl()
+ RicohGr2LiveViewControl(boolean useGrControl)
{
+ this.useGrCommand = useGrControl;
liveViewListener = new CameraLiveViewListenerImpl();
}
/*
public void setLiveViewAddress(@NonNull String address, @NonNull String page)
{
- liveViewUrl = "http://" + address + "/" + page;
+ cameraDisplayUrl = "http://" + address + "/" + page;
}
*/
public void changeLiveViewSize(String size)
{
//
-
}
@Override
- public void startLiveView()
+ public void startLiveView(final boolean useCameraScreen)
{
+ final boolean isCameraScreen = useGrCommand && useCameraScreen;
Log.v(TAG, "startLiveView()");
try
{
{
try
{
- start(liveViewUrl);
+ if (isCameraScreen)
+ {
+ start(cameraDisplayUrl);
+ }
+ else
+ {
+ start(liveViewUrl);
+ }
}
catch (Exception e)
{
@Override
public void stopLiveView()
{
-
+ Log.v(TAG, "stopLiveView()");
+ whileFetching = false;
}