|
|
|
@ -16,6 +16,7 @@ import android.content.IntentFilter;
|
|
|
|
|
import android.graphics.Bitmap;
|
|
|
|
|
import android.graphics.BitmapFactory;
|
|
|
|
|
import android.graphics.ImageDecoder;
|
|
|
|
|
import android.graphics.Matrix;
|
|
|
|
|
import android.location.Location;
|
|
|
|
|
import android.location.LocationListener;
|
|
|
|
|
import android.location.LocationManager;
|
|
|
|
@ -401,6 +402,8 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
final boolean result = intent.getBooleanExtra("result", false);
|
|
|
|
|
final String path = intent.getStringExtra("path");
|
|
|
|
|
final long videoId = intent.getLongExtra("videoId", 0);
|
|
|
|
|
final int orientation = intent.getIntExtra("orientation", 0);
|
|
|
|
|
final boolean frontCamera = intent.getBooleanExtra("frontCamera", false);
|
|
|
|
|
Log.i(TAG, "Recording received(" + Long.toString(videoId) + "):" + path);
|
|
|
|
|
|
|
|
|
|
if (photoOrVideo) {
|
|
|
|
@ -426,6 +429,17 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
} else {
|
|
|
|
|
bm = BitmapFactory.decodeFile(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (orientation != 0 || frontCamera) {
|
|
|
|
|
Matrix matrix = new Matrix();
|
|
|
|
|
if (orientation != 0) {
|
|
|
|
|
matrix.postRotate(orientation);
|
|
|
|
|
}
|
|
|
|
|
if (frontCamera) {
|
|
|
|
|
matrix.postScale(-1, 1);
|
|
|
|
|
}
|
|
|
|
|
bm = Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight(), matrix, true);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
}
|
|
|
|
|
mService.captureFinished(mService.mNativeHandle, photoOrVideo, result && bm != null, bm, videoId);
|
|
|
|
|