Skip to content

Commit

Permalink
release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
livotov committed Jun 26, 2015
1 parent b5a7e14 commit d17854d
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import android.content.Context;
import android.hardware.Camera;
import android.os.AsyncTask;
import android.util.Log;

import java.util.ArrayList;
Expand Down
31 changes: 18 additions & 13 deletions CAMView/src/main/java/eu/livotov/labs/android/camview/CAMView.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,18 @@ public void run()
{
surfaceHolder.removeCallback(CAMView.this);
}
} catch (Throwable err)
}
catch (Throwable err)
{
Log.e(CAMView.class.getSimpleName(),err.getMessage(),err);
} finally
Log.e(CAMView.class.getSimpleName(), err.getMessage(), err);
}
finally
{
cameraIsLive.set(false);
cameraIsStopping.set(false);
cameraIsStarting.set(false);

if (camViewListener!=null)
if (camViewListener != null)
{
uiHandler.post(new Runnable()
{
Expand All @@ -221,7 +223,7 @@ public synchronized void start(final int cameraId)
{
if (cameraIsLive.get())
{
if (cameraId!=lastUsedCameraId)
if (cameraId != lastUsedCameraId)
{
throw new RuntimeException("You cannot start a new camera while another camera is still running. Please stop your current camera first.");
}
Expand Down Expand Up @@ -256,7 +258,7 @@ public void onCameraOpenError(Throwable error)
cameraIsStarting.set(false);
cameraIsStopping.set(false);

if (camViewListener!=null)
if (camViewListener != null)
{
camViewListener.onCameraOpenError(error);
}
Expand Down Expand Up @@ -583,10 +585,12 @@ public void run()
{
surfaceHolder.removeCallback(CAMView.this);
}
} catch (Throwable err)
}
catch (Throwable err)
{
// ignored
} finally
}
finally
{
cameraIsLive.set(false);
cameraIsStopping.set(false);
Expand All @@ -597,7 +601,7 @@ public void run()
@Override
public void run()
{
if (camViewListener!=null)
if (camViewListener != null)
{
camViewListener.onCameraStopped();
}
Expand Down Expand Up @@ -626,7 +630,7 @@ public void run()

public void onPreviewFrame(byte[] data, Camera camera)
{
if (cameraIsLive.compareAndSet(false,true))
if (cameraIsLive.compareAndSet(false, true))
{
if (camViewListener != null)
{
Expand Down Expand Up @@ -704,7 +708,7 @@ public void run()
int retriesCount = 5;
Throwable lastError = null;

while (cam==null && retriesCount>0)
while (cam == null && retriesCount > 0)
{
try
{
Expand All @@ -725,7 +729,7 @@ public void run()
}
}

if (cam!=null)
if (cam != null)
{
camera = cam;

Expand All @@ -737,7 +741,8 @@ public void run()
callback.onCameraOpened(camera);
}
});
} else
}
else
{
final Throwable lastOpenError = lastError;
uiHandler.post(new Runnable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
import android.os.Looper;
import android.os.Message;

import java.util.concurrent.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Executor;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;

Expand Down Expand Up @@ -125,25 +130,30 @@ public void execInCurrThread(Params... params)
if (!mCancelled.get())
{
sHandler.dispatchPostExecute(result);
} else
}
else
{
sHandler.dispatchCancel(result);
}
} catch (Throwable throwable)
}
catch (Throwable throwable)
{
if (!mCancelled.get())
{
sHandler.dispatchError(result);
} else
}
else
{
sHandler.dispatchCancel(result);
}
}
} else
}
else
{
sHandler.dispatchCancel(result);
}
} else
}
else
{
sHandler.dispatchCancel(result);
}
Expand Down Expand Up @@ -279,7 +289,8 @@ public void sendMessage(Message message, long delayMillis)
try
{
mLock.wait();
} catch (InterruptedException e)
}
catch (InterruptedException e)
{
e.printStackTrace();
}
Expand All @@ -289,7 +300,8 @@ public void sendMessage(Message message, long delayMillis)
if (delayMillis <= 0)
{
this.mHandler.sendMessage(message);
} else
}
else
{
mHandler.sendMessageDelayed(message, delayMillis);
}
Expand All @@ -307,7 +319,8 @@ public void post(Runnable runnable, long delayMillis)
try
{
mLock.wait();
} catch (InterruptedException e)
}
catch (InterruptedException e)
{
e.printStackTrace();
}
Expand All @@ -318,7 +331,8 @@ public void post(Runnable runnable, long delayMillis)
if (delayMillis <= 0)
{
this.mHandler.post(runnable);
} else
}
else
{
mHandler.postDelayed(runnable, delayMillis);
}
Expand Down
Binary file removed CAMView/src/main/res/drawable-hdpi/ic_launcher.png
Binary file not shown.
Binary file removed CAMView/src/main/res/drawable-mdpi/ic_launcher.png
Binary file not shown.
Binary file not shown.
Binary file removed CAMView/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary file not shown.
3 changes: 0 additions & 3 deletions CAMView/src/main/res/values/strings.xml

This file was deleted.

11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ CAMView
Status
======

- Current stable version: 1.0.3
- Current development version: 1.1.0-SNAPSHOT
- Current stable version: 1.1.0
- Current development version: 2.0.0-SNAPSHOT

Please feel free to share your comments and suggestions, report any bugs or submit your pull requests
(which is even better :)
(second is even better :)

Note, 1.x branch is the last one, supports Android 2.x SDK. Branch 2.x will be focused for 4.0+ SDK only, while
1.x branch will be on maintenance for critical bugs only.


Get It
Expand All @@ -39,7 +42,7 @@ repositories {
}
compile group: "eu.livotov.labs", name: "camview", version: "1.0.3", ext: "aar"
compile group: "eu.livotov.labs", name: "camview", version: "1.1.0", ext: "aar"
```

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# org.gradle.parallel=true


VERSION_NAME=1.1.0-SNAPSHOT
VERSION_NAME=1.1.0
VERSION_CODE=1
GROUP=eu.livotov.labs
POM_DESCRIPTION=Android CAMView
Expand Down

0 comments on commit d17854d

Please sign in to comment.