Comments (12)
So you just open app then set these dimensions?
from cameraview.
First i created my own app with your library, it has same issue. Then I clone your example, and it has same issue too.
from cameraview.
@Monster-king You didn't answer though :) please use the demo app, then describe clearly the steps to reproduce the bug, then post the logs you see in the logcat. The demo app will log a lot of useful things.
from cameraview.
@natario1 At the moment I've installed the app to my Samsung J1 2016 phone, changed the height to 480 (because in width is 480 too). When I pressed the update button I took the message "Height updated! Internal preview size: 640x480". Preview has black area like that screen. Here all logs.
new 2.txt
from cameraview.
@Monster-king thanks!
I just think the camera XML is wrong actually. Can you try modifying it?
If you open activity_main.xml
you can see that CameraView
is wrapped in a RelativeLayout
. That makes no sense. Can you remove the relative layout and try again?
from cameraview.
@natario1 Relative layout removed, nothing changed.
from cameraview.
That's disappointing :) I don't know what's wrong right now, but CameraView
looks to be measuring itself correctly. For the moment I guess you can just avoid to apply runtime changes to width / height. Or if you really need it, ensure you call requestLayout()
on the view or on its parent.
If you have some time, you could do the following test:
- add
background="@color/red"
to the RelativeLayout - add
background="@color/green"
to the CameraView - add to other views if you wish
Then tell me what colour you see in that area that is black now. Just to see what it belongs to. If it's red, then what if you remove the RelativeLayout?
from cameraview.
Nevermind, I was able to reproduce on another device. I will take a look myself
from cameraview.
So, this is a bug with low end devices that have isHardwareAccelerated()
return false.
In that case CameraView
will render in a SurfaceView
(instead of TextureView
) and we are not able to provide center crop behavior for surface views.
The current workaround for these devices is to use wrap content for both dimensions.
from cameraview.
I don't think so, because preview looks like compressed by height. Do you tested it in another device?
from cameraview.
@Monster-king can you try now? Demo app has changed and also a surface bug was fixed.
from cameraview.
@natario1 Fixed.
from cameraview.
Related Issues (20)
- Feature: Allow higher capture resolution
- cameraView.takePictureSnapshot() returns blank bitmap if app:cameraDrawHardwareOverlays="true"
- Create Bomrang like instagram HOT 1
- Need information on codecs, containers and formats of captured videos and photos.
- Can record video with foreground service without showing preview
- Preview Canvas Clipped HOT 1
- error when call takePicture() method? HOT 2
- Add proguard rules
- New crash in some Camera1 devices
- Snapshot video recording fails randomly
- IllegalStateException: Unable to update texture contents (see logcat for details) HOT 2
- demo can not match the `xml` file with `activity` file
- Camera2 memery leak
- Fatal Exception: android.media.MediaCodec$CodecException: start failed
- Can insert background music while recording a video?
- app:cameraPictureFormat="jpeg|dng"
- Exception java.lang.IllegalStateException: at android.media.MediaCodec.native_configure
- mirror issues HOT 1
- CameraView.destroy CameraEngine.destroy ANR (java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278))
- Video Recording not working on some device
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cameraview.