Giter VIP home page Giter VIP logo

sandrioscamera's Introduction

DEPRECATED

8

sandriosCamera

sandrios studios Android Arsenal Build Status API Download

Camera Library for Android

sandrios camera allows developers to integrate image and video capturing without dealing with the complicated camera APIs.

It includes image picker interface inside the cameraview enabling the user to access recent media from inside the camera module.

Download

You can download an aar from GitHub's releases page.

Or use Gradle:

repositories {
   jcenter()
}

dependencies {
  implementation 'com.sandrios.android:sandriosCamera:1.2.6'
}

Or Maven:

<dependency>
  <groupId>com.sandrios.android</groupId>
  <artifactId>sandriosCamera</artifactId>
  <version>1.2.6</version>
  <type>pom</type>
</dependency>

If you are planning to include the library as a module, then you will have to upgrade to Android Studio 3.0

How do I use Sandrios Camera?

Please check the sample project included for more examples:

  private static final int CAPTURE_MEDIA = 368;

  // showImagePicker is boolean value: Default is true
  // setAutoRecord() to start recording the video automatically if media action is set to video.
  private void launchCamera() {
     SandriosCamera
        .with()
        .setShowPicker(true)
        .setShowPickerType(CameraConfiguration.VIDEO)
        .setVideoFileSize(20)
        .setMediaAction(CameraConfiguration.MEDIA_ACTION_BOTH)
        .enableImageCropping(true)
        .launchCamera(activity); 

        @Override
        protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
            super.onActivityResult(requestCode, resultCode, data);
            if (resultCode == Activity.RESULT_OK
                    && requestCode == SandriosCamera.RESULT_CODE
                    && data != null) {
                if (data.getSerializableExtra(SandriosCamera.MEDIA) instanceof Media) {
                    Media media = (Media) data.getSerializableExtra(SandriosCamera.MEDIA);
    
                    Log.e("File", "" + media.getPath());
                    Log.e("Type", "" + media.getType());
                    Toast.makeText(getApplicationContext(), "Media captured.", Toast.LENGTH_SHORT).show();
                }
            }
        }
        
    }

ProGuard

Depending on your ProGuard (DexGuard) config and usage, you may need to include the following lines in your proguard.cfg

-keep public class com.sandrios.** { *; }

-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }

-keep public class * extends android.support.v4.view.ActionProvider {
    public <init>(android.content.Context);
}

-dontwarn android.support.**

#Glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}

#uCrop
-dontwarn com.yalantis.ucrop**
-keep class com.yalantis.ucrop** { *; }
-keep interface com.yalantis.ucrop** { *; }

-keepattributes *Annotation*
-keepclassmembers class ** {
    @com.squareup.otto.Subscribe public *;
    @com.squareup.otto.Produce public *;
}

-keep class com.google.**
-dontwarn com.google.**
-dontwarn sun.misc.**

Status

  • Migration to AndroidX
  • Flash Mode (Testing Needed)

Comments/bugs/questions/pull requests are always welcome! Please use develop branch for pull requests.

Compatibility

  • Android SDK: Sandrios Camera requires a minimum API level of 14.

Download

You may also find precompiled aar on the releases page.

Getting Help

To report a specific problem or feature request, open a new issue on Github. For questions, suggestions, or anything else -- [email protected]

Thanks

  • Glide for the Image Loading Framework
  • Dexter for the Permission Management in Android 23+
  • uCrop for the Image Cropping
  • Everyone who has contributed code and reported issues!

Author

sandrios studios - @sandrios on GitHub

License

MIT. See the LICENSE file for details.

sandrioscamera's People

Contributors

arpitgandhi9 avatar arpitignite avatar mackaber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sandrioscamera's Issues

Captured image orientation changes while upload to server

I had capture the photo using camera, it was good when displaying from preview screen, but after the image path has uplloaded then the orientation changed -90 degrees.
I tried to detect the orientation of file by ExifInterface, but always return 0.
How i can solve this?

Looks like android front flash is not supported ! [FEATURE-REQUEST]

I checked the source code. and found

@Override
    public void initializeCameraManager(ConfigurationProvider configurationProvider, Context context) {
        super.initializeCameraManager(configurationProvider, context);

        this.manager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE);

        WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        Display display = windowManager.getDefaultDisplay();
        Point size = new Point();
        display.getSize(size);
        windowSize = new Size(size.x, size.y);

        try {
            String[] ids = manager.getCameraIdList();
            numberOfCameras = ids.length;
            for (String id : ids) {
                CameraCharacteristics characteristics = manager.getCameraCharacteristics(id);

                int orientation = characteristics.get(CameraCharacteristics.LENS_FACING);
                if (orientation == CameraCharacteristics.LENS_FACING_FRONT) {
                    faceFrontCameraId = id;
                    faceFrontCameraOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
                    frontCameraCharacteristics = characteristics;
                } else {
                    faceBackCameraId = id;
                    faceBackCameraOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
                    backCameraCharacteristics = characteristics;
                }
            }
        } catch (Exception e) {
            Log.e(TAG, "Error during camera init");
        }
    }

looks like it is checking the lens orientation/facing, but did not find usage of FLASH_INFO_AVAILABLE anywhere.

Update README

In the example update the file path argument to

CameraConfiguration.Arguments.FILE_PATH

OS 4.4.4 Back Camera Fails

Hi,

It's a great library,. Works perfectly fine in higher end devices. In OS 4.4.4 back camera opens, but while triggering it gets stuck. but screen will be active. We can change into front camera and continue. But Back camera fails to capture.

On tapping capture button twice it give below exception.
java.lang.RuntimeException: takePicture failed
at android.hardware.Camera.native_takePicture(Native Method)
at android.hardware.Camera.takePicture(Camera.java:1312)
at android.hardware.Camera.takePicture(Camera.java:1257)
at com.sandrios.sandriosCamera.internal.manager.impl.Camera1Manager$3.run(Camera1Manager.java:118)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)

I tried to debug but unable to fix it. Please reply soon.

java.lang.OutOfMemoryError: Failed to allocate a 51916812 byte allocation with

USER_COMMENT=null
ANDROID_VERSION=6.0
APP_VERSION_NAME=1.0
BRAND=vivo
PHONE_MODEL=vivo 1601
CUSTOM_DATA=
STACK_TRACE=java.lang.OutOfMemoryError: Failed to allocate a 51916812 byte allocation with 4193552 free bytes and 44MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:677)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:653)
at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:433)
at com.sandrios.sandriosCamera.internal.ui.preview.PreviewActivity.rotateImageIfRequired(PreviewActivity.java:412)
at com.sandrios.sandriosCamera.internal.ui.preview.PreviewActivity.onClick(PreviewActivity.java:389)
at android.view.View.performClick(View.java:5272)
at android.view.View$PerformClick.run(View.java:21528)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5790)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1015)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876)

Preview size and actual image differs

The library is awesome but having the only issue of preview size and actual image is different.

Could you please provide any solution for this issue?

Thank you in advance

Error with the theme

When opening the camera for the first time (Before granting permissions) the program crash with this log message:
Unable to start activity ComponentInfo{com.mypackagename.myappname/com.gun0912.tedpermission.TedPermissionActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.

Note that when i grant the permissions from the App Settings the camera launches without that error

Video Zoom Issue

We tried Video Zoom while Recording but no option Video Zoom.pls provide the code

OutOfMemory exception

You are rotating image in PreviewActivity. Problem: it throws OutOfMemory exception if captured image is large and app crashes. You need to resize image first, or find some other way to rotate bitmap.

Enhancement Include Geo Location in Exif

Feature Request

  • I have test your library with different devices, I have observed exif information is preserved when saving image. I would like if you can include Geo tag information as well just like default camera application does, If location is on "They include Geo tag information in exif, If location service is disabled Geo tag information is null.

  • Include Location permission to accommodate Geo location exif tag

screenshot_2017-01-20-15-04-04

Recent Media doesn't show

Hello,

First of all thank you for library. I added your library with gradle. Recent media is showing. But I added your library with import module. But recent media doesn't show. Can you help me?

Thank you.

Mode

I like this library and it easy to used. But i found one problem
=> When you take photo in Portrait Mode...when upload to server, file rotate t landscape mode..

anybody can help me on this...TQ

How to take picture sequentially?

Hi
I want a user can take pictures as many as he/she wants on camera screen.
Without starting a previewActivity how can i achieve this?
Right now i found an unpleasant solution on BaseSandriosActivity.java . which is :

@Override
   public void onPhotoTaken() {
//        startPreviewActivity();
       getCameraController().onPause();
       getCameraController().onResume();
       Toast.makeText(this, "uri   :" +  getCameraController().getOutputFile().toString(), Toast.LENGTH_SHORT).show();
   }

and causes screen freeze 1-2 second.

Thanks in advance

Video Limitation with Duration

Thank you for this great library,
I was wondering if possible to add another limitation with duration for videos.
Thanks

Not working with Glide 4.6.1

Unable to upgrade Glide to the latest version, only supports Glide 3.8.0

java.lang.NoSuchMethodError: No virtual method load(Landroid/net/Uri;)Lcom/bumptech/glide/DrawableTypeRequest; in class Lcom/bumptech/glide/RequestManager; or its super classes (declaration of 'com.bumptech.glide.RequestManager' appears in /data/app/com.signaltest.signaltest-2/base.apk) at com.sandrios.sandriosCamera.internal.ui.view.ImageGalleryAdapter.onBindViewHolder(ImageGalleryAdapter.java:133) at com.sandrios.sandriosCamera.internal.ui.view.ImageGalleryAdapter.onBindViewHolder(ImageGalleryAdapter.java:25) at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6673) at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6714) at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5647) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5913) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5752) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5748) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2232) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1559) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1519) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:614) at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3812) at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3225)

Autofocus in video mode

Hello,

I'm trying to record video with the following code:

Intent cameraIntent;
if (CameraHelper.hasCamera2(this)) {
    cameraIntent = new Intent(this, Camera2Activity.class);
} else {
    cameraIntent = new Intent(this, Camera1Activity.class);
}
cameraIntent.putExtra(SandriosCameraConfiguration.Arguments.REQUEST_CODE, REQUEST_CODE_VIDEO);
cameraIntent.putExtra(SandriosCameraConfiguration.Arguments.SHOW_PICKER, false);
cameraIntent.putExtra(SandriosCameraConfiguration.Arguments.MEDIA_ACTION, SandriosCameraConfiguration.MEDIA_ACTION_VIDEO);
cameraIntent.putExtra(SandriosCameraConfiguration.Arguments.MEDIA_QUALITY, SandriosCameraConfiguration.MEDIA_QUALITY_HIGHEST);
startActivityForResult(cameraIntent, REQUEST_CODE_VIDEO);

but autofocus not working in preview and during recording.

But that is working when I'm trying to take a picture:

Intent cameraIntent;
if (CameraHelper.hasCamera2(this)) {
    cameraIntent = new Intent(this, Camera2Activity.class);
} else {
    cameraIntent = new Intent(this, Camera1Activity.class);
}
cameraIntent.putExtra(SandriosCameraConfiguration.Arguments.REQUEST_CODE, REQUEST_CODE_PICTURE);
cameraIntent.putExtra(SandriosCameraConfiguration.Arguments.SHOW_PICKER, false);
cameraIntent.putExtra(SandriosCameraConfiguration.Arguments.MEDIA_ACTION, SandriosCameraConfiguration.MEDIA_ACTION_PHOTO);
cameraIntent.putExtra(SandriosCameraConfiguration.Arguments.MEDIA_QUALITY, SandriosCameraConfiguration.MEDIA_QUALITY_HIGHEST);
startActivityForResult(cameraIntent, REQUEST_CODE_PICTURE);

Should I put any configuration to allow camera autofocus in video mode?

Also here is my manifest:

<uses-feature android:glEsVersion="0x00020000" android:required="false" />
<uses-feature android:name="android.hardware.camera2.full" android:required="false" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />

Thanks

java.lang.IllegalStateException: Handler (android.os.Handler) sending message to a Handler on a dead thread

Hi and thanks for such a nice library! Checked this out today and saw the issue

Steps to reproduce:

  • .setShowPicker(true)
  • launch SandriosCamera with picker
  • tap on any of previews

01-05 17:58:57.256 22321-22641/? W/MessageQueue: Handler (android.os.Handler) {3a72e4e} sending message to a Handler on a dead thread java.lang.IllegalStateException: Handler (android.os.Handler) {3a72e4e} sending message to a Handler on a dead thread at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543) at android.os.Handler.enqueueMessage(Handler.java:631) at android.os.Handler.sendMessageAtTime(Handler.java:600) at android.os.Handler.sendMessageDelayed(Handler.java:570) at android.os.Handler.post(Handler.java:326) at android.hardware.camera2.impl.CameraDeviceImpl.close(CameraDeviceImpl.java:1010) at com.sandrios.sandriosCamera.internal.manager.impl.Camera2Manager.closeCameraDevice(Camera2Manager.java:463) at com.sandrios.sandriosCamera.internal.manager.impl.Camera2Manager.closeCamera(Camera2Manager.java:442) at com.sandrios.sandriosCamera.internal.manager.impl.Camera2Manager.access$600(Camera2Manager.java:53) at com.sandrios.sandriosCamera.internal.manager.impl.Camera2Manager$4.run(Camera2Manager.java:225) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61)

Exception is handled, but will be good to fix.
Device - Nexus 5, Android 6.0.1

Show only photo

Hello,
First of all, Thank you so much for library. This library is great. I want to show only all photos from gallery when I click select image button. But I couldn't do it. When I click button, It shows both camera and photos. Can I make it with your library?

Thanks.

java.lang.OutOfMemoryError

Error in android 4.4.2 after taking a photo

01-08 21:07:24.126 27827-27827/uv.mx.varappmiento_app E/AndroidRuntime: FATAL EXCEPTION: main
Process: uv.mx.varappmiento_app, PID: 27827
java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:645)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:621)
at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:401)
at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:427)
at com.sandrios.sandriosCamera.internal.imageCropper.CropperView.loadNewImage(CropperView.java:183)
at com.sandrios.sandriosCamera.internal.ui.preview.PreviewActivity.showImagePreview(PreviewActivity.java:267)
at com.sandrios.sandriosCamera.internal.ui.preview.PreviewActivity.displayImage(PreviewActivity.java:263)
at com.sandrios.sandriosCamera.internal.ui.preview.PreviewActivity.onCreate(PreviewActivity.java:226)
at android.app.Activity.performCreate(Activity.java:5267)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1099)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2239)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1243)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5372)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:970)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:786)
at dalvik.system.NativeStart.main(Native Method)

Enhancements zoom and manual focus trigger ETC

Hi,
Really a nice library, I have tested it with for devices now and its working fine. It would be great if you provide zoom and focus trigger feature in next release. As I was testing on Samsung S6 Edge device video was not getting focus while moving around.

Following are few use case which I believe should be part of this library

  • Video record duration limit
  • Video file size limit
  • Control over hiding the Video size and Photo size option
  • Include cropping functionality when taking pictures. for this I would prefer using uCrop.
  • Separate Video and camera option via builder pattern, Because in many cases we would like user to take only video/ image in a particular screen of our application, showing these two options side by side may confuse some of them.

Really an awesome library this these features I am sure many developer would start using your library in production apps.

Directly open fullscreen camera for video record and start automatically

Hello,

its a great library to record videos. I want to start video recorder directly when user click on buttton, I want to open full screen view which will record video, user can stop video by pressing stop button. Can you suggest if i can do it with this library ? Maximum video recording seconds allow to 20. Can i directly fire such intent ?

Crash: RuntimeException: Camera is being used after Camera.release() was called

Version used;
v1.2.6
Android API 28

My logcat;

2019-09-18 10:56:07.866 26277-26917/com.sandrios.sandriosCamera.sample E/MediaExtractor: Trace connect 0x757369bb80 0x757368dc80
2019-09-18 10:56:12.367 26277-26277/com.sandrios.sandriosCamera.sample E/File: /data/user/0/com.sandrios.sandriosCamera.sample/files/IMG_2019_09_18_10_56_07.jpg
2019-09-18 10:56:12.367 26277-26277/com.sandrios.sandriosCamera.sample E/Type: 0
2019-09-18 10:56:13.817 26277-26973/com.sandrios.sandriosCamera.sample E/libc: Access denied finding property "camera.hal1.packagelist"
2019-09-18 10:56:13.942 26277-26277/com.sandrios.sandriosCamera.sample E/RecyclerView: No adapter attached; skipping layout
2019-09-18 10:56:14.003 26277-26277/com.sandrios.sandriosCamera.sample E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.sandrios.sandriosCamera.sample, PID: 26277
    java.lang.RuntimeException: Camera is being used after Camera.release() was called
        at android.hardware.Camera.native_getParameters(Native Method)
        at android.hardware.Camera.getParameters(Camera.java:2094)
        at com.sandrios.sandriosCamera.internal.manager.impl.Camera1Manager.getPhotoSizeForQuality(Camera1Manager.java:207)
        at com.sandrios.sandriosCamera.internal.ui.camera.Camera1Activity.getPhotoQualityOptions(Camera1Activity.java:57)
        at com.sandrios.sandriosCamera.internal.ui.BaseSandriosActivity.onCameraControllerReady(BaseSandriosActivity.java:132)
        at com.sandrios.sandriosCamera.internal.ui.SandriosCameraActivity.setCameraPreview(SandriosCameraActivity.java:112)
        at com.sandrios.sandriosCamera.internal.ui.BaseSandriosActivity.updateCameraPreview(BaseSandriosActivity.java:427)
        at com.sandrios.sandriosCamera.internal.controller.impl.Camera1Controller.onCameraOpened(Camera1Controller.java:131)
        at com.sandrios.sandriosCamera.internal.controller.impl.Camera1Controller.onCameraOpened(Camera1Controller.java:27)
        at com.sandrios.sandriosCamera.internal.manager.impl.Camera1Manager$1$1.run(Camera1Manager.java:71)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6518)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Fragment Support

Is it possible to use this library from within a fragment?

I am able to init the camera, however onActivityResult is never hit with the result.

Thanks

Couldn't find any suitable preview size

Hi,

Sony Z5 premium cant open front camera.

com.sandrios.sandriosCamera.sample E/BufferQueueProducer: [SurfaceTexture-0-21064-0] queueBuffer: BufferQueue has been abandoned
   com.sandrios.sandriosCamera.sample E/BufferQueueProducer: [SurfaceTexture-0-21064-0] queueBuffer: BufferQueue has been abandoned
   com.sandrios.sandriosCamera.sample E/BufferQueueProducer: [SurfaceTexture-0-21064-0] queueBuffer: BufferQueue has been abandoned
   com.sandrios.sandriosCamera.sample E/BufferQueueProducer: [SurfaceTexture-0-21064-0] queueBuffer: BufferQueue has been abandoned
   com.sandrios.sandriosCamera.sample E/BufferQueueProducer: [SurfaceTexture-0-21064-0] queueBuffer: BufferQueue has been abandoned
   com.sandrios.sandriosCamera.sample E/BufferQueueProducer: [SurfaceTexture-0-21064-0] queueBuffer: BufferQueue has been abandoned
   com.sandrios.sandriosCamera.sample E/BufferQueueProducer: [SurfaceTexture-0-21064-0] queueBuffer: BufferQueue has been abandoned
   com.sandrios.sandriosCamera.sample E/BufferQueueProducer: [SurfaceTexture-0-21064-0] queueBuffer: BufferQueue has been abandoned
   com.sandrios.sandriosCamera.sample E/GLConsumer: [SurfaceTexture-0-21064-0] detachFromContext: abandoned GLConsumer
   com.sandrios.sandriosCamera.sample E/OpenGLRenderer: Failed to detach SurfaceTexture from context -19
   com.sandrios.sandriosCamera.sample E/CameraHelper: Couldn't find any suitable preview size
   com.sandrios.sandriosCamera.sample E/Camera2Controller: onCameraOpenError

Video files can't be played in videoview.

I recorded a video and store its path. When i tried to play video using this code(Kotlin), i am getting a dialog that states "Can't Play this video" . Here is my code



             SandriosCamera(parentFragment.activity, REQUEST_IMAGE_CAPTURE)
                                  .setShowPicker(false)
                                  .setVideoFileSize(10) //File Size in MB: Default is no limit
                                  .setMediaAction(CameraConfiguration.MEDIA_ACTION_BOTH) // default is CameraConfiguration.MEDIA_ACTION_BOTH
                                  .enableImageCropping(true) // Default is false.
                                  .launchCamera();

to get path

val path : String = data!!.getStringExtra(CameraConfiguration.Arguments.FILE_PATH)

and to play

      videoView.setVideoPath(path)
        videoView.start()

device-2017-06-28-153139

Not able to change the file storage path

Hi,
First of all thanks for the very good camera API. The captured images and videos are saved in inside the application directory. Is there any possibility to save the media in external storage or user defined path. If yes please let me know how to achieve the same.

Thanks in Advance

Crash when "Do not keep activities" is enabled

Instructions to recreate:

  1. Enable 'Do not keep activities' in developer mode
  2. Launch camera, then press save on picture
  3. After hitting save, the following error occurs.

Process: com.coolfiresolutions.ronin.sa.base, PID: 17834 java.lang.NullPointerException: Attempt to invoke virtual method 'android.hardware.Camera$Parameters android.hardware.Camera.getParameters()' on a null object reference at com.sandrios.sandriosCamera.internal.manager.impl.Camera1Manager.getPhotoSizeForQuality(Camera1Manager.java:203)

I found that onPause is called in SandriosCameraActivity which calls onPause on cameraController which nulls out camera before Camera.getParameters is called

R.id errors in PreviewActivity Class

I used gradle dependecies to work with this library, but the PreviewActivity shows errors in every R.id.xxxx of the file. I cant understand why, someone has any clues??

java.lang.NoClassDefFoundError

I get this error after upgrading to version 1.0.8

Java.lang.NoClassDefFoundError: okhttp3.internal.Platform

This class is used by retrofit2 and was previously included
Do you have any recommendations to solve it?

Crash when getPhotoSizeForQuality "Camera is being used after Camera.release() was called"

Where is the call stacks

com.sandrios.sandriosCamera.internal.manager.impl.Camera1Manager.getPhotoSizeForQuality (Camera1Manager.java:207)
com.sandrios.sandriosCamera.internal.ui.camera2.Camera2Activity.getPhotoQualityOptions (Camera2Activity.java:64)
com.sandrios.sandriosCamera.internal.ui.BaseSandriosActivity.onCameraControllerReady (BaseSandriosActivity.java:132)
com.sandrios.sandriosCamera.internal.ui.SandriosCameraActivity.setCameraPreview (SandriosCameraActivity.java:112)
com.sandrios.sandriosCamera.internal.ui.BaseSandriosActivity.updateCameraPreview (BaseSandriosActivity.java:427)
com.sandrios.sandriosCamera.internal.controller.impl.Camera2ControllerAPI24.onCameraOpened (Camera2ControllerAPI24.java:133)
com.sandrios.sandriosCamera.internal.controller.impl.Camera2ControllerAPI24.onCameraOpened (Camera2ControllerAPI24.java:28)
com.sandrios.sandriosCamera.internal.manager.impl.Camera1Manager$1$1.run (Camera1Manager.java:71)

Change save folder

Hello guys,

somebody there who could show me an easy way to change the Default save Folder from sandrios for saving Pictures and videos ?

Thanks for help!

after took photo the result rotate 90 degree

am using second button in Sample which doesnt implement cropping... i put the result into imageview as setImageBitmap(Bitmap bm) onActivityResult. But why i got rotating result after then?

Choose Image from gallery picker

When we choose file from the picker,it returns a NoSuchFileFoundException.

It returns a path from the intent as a "file://storage/emulated/0/" and throws this error.

Mirror effect

Hi , how can i do i i want that he preview is like the picture or video without mirror effect ?

Lib you use for permission crashes when called from within activity that extends appcompat.

new SandriosCamera()....launchCamera() crashes when launched inside of class that extends appcompat activity.

That's a problem of lib you use for permissions. It's known bug there and it's there for more than a year without resolution. So, please, either switch off to any other permission lib (dexter is the most famous and consistent one) or just make developers to ask for permissions themselves before starting a camera instance.

here's my error log:

08-10 22:36:33.890 21043-21043/org.tingr.teacher E/AndroidRuntime: FATAL EXCEPTION: main
                                                                   Process: org.tingr.teacher, PID: 21043
                                                                   java.lang.RuntimeException: Unable to start activity ComponentInfo{org.tingr.teacher/com.gun0912.tedpermission.TedPermissionActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
                                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2681)
                                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2742)
                                                                       at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1489)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                       at android.os.Looper.loop(Looper.java:154)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:6178)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781)
                                                                    Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
                                                                       at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:354)
                                                                       at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:323)
                                                                       at android.support.v7.app.AppCompatDelegateImplV9.onPostCreate(AppCompatDelegateImplV9.java:170)
                                                                       at android.support.v7.app.AppCompatActivity.onPostCreate(AppCompatActivity.java:97)
                                                                       at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1199)
                                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663

How to hide video record options?

Hi,

i need to know how to hide video record option?
I just wanna to use camera photo.

updated
And how to set the default quality.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.