private static final int BUFFER_SIZE = 2048 * 1280;
private static final int ERROR_LIMIT = 30;
private boolean isStart = false;
+ private Socket lvSocket = null;
FujiXLiveViewControl(@NonNull Activity activity, String ip, int portNumber)
{
if (isStart)
{
// すでに受信スレッド動作中なので抜ける
+ Log.v(TAG, " LIVE VIEW IS ALREADY STARTED.");
return;
}
+ Log.v(TAG, " START LIVEVIEW... ");
isStart = true;
Thread thread = new Thread(new Runnable()
{
{
try
{
- Socket socket = new Socket(ipAddress, portNumber);
- startReceive(socket);
+ if (lvSocket == null)
+ {
+ lvSocket = new Socket(ipAddress, portNumber);
+ }
+ startReceive(lvSocket);
}
catch (Exception e)
{
Log.v(TAG, " IP : " + ipAddress + " port : " + portNumber);
e.printStackTrace();
}
+ //lvSocket = null;
+ Log.v(TAG, " STOP LIVEVIEW... ");
}
});
try
{
isStart = false;
}
+
/*
private void startReceivePrevious(Socket socket)
{
Log.v(TAG, "===== startReceive() aborted.");
return;
}
+ Log.v(TAG, " Receive (wait) image...");
boolean findJpeg = false;
boolean finishJpeg = false;
isStart = false;
}
}
+/*
try
{
isr.close();
{
e.printStackTrace();
}
+*/
}
}
public void updateCameraFileInfo(ICameraFileInfo info)
{
// なにもしない
+ Log.v(TAG, " updateCameraFileInfo() : " + info.getDatetime());
}
@Override
{
start = 1;
}
- String indexStr = name.substring(start, name.indexOf("."));
- Log.v(TAG, "FujiX::downloadContent() : " + path + " " + name + " " + indexStr);
- int index = Integer.parseInt(indexStr);
- //FujiXImageContentInfo contentInfo = imageContentInfo.get(index); // 特にデータを更新しないから大丈夫か?
+ int index = getIndexNumber(start, name);
+ Log.v(TAG, "FujiX::downloadContent() : " + path + " " + name + " " + index);
if ((index > 0)&&(index <= imageContentInfo.size()))
{
IFujiXCommandPublisher publisher = provider.getCommandPublisher();
*
*/
@Override
- public void onAttach(Context context)
+ public void onAttach(@NonNull Context context)
{
super.onAttach(context);
Log.v(TAG, "onAttach()");
@Override
public void startLiveView()
{
+ Log.v(TAG, " LiveViewFragment::startLiveView() ");
ICameraConnection.CameraConnectionMethod connectionMethod = interfaceProvider.getCammeraConnectionMethod();
if (liveViewControl == null)
{