Comments (12)
from tabiancustomcamera.
I'm pretty sure it's your mPreviewSize variable. For some reason it's being set to that tiny size. Are you sure you copied my copy correctly? To test, write this write this just below the two log outputs that print the preview width and height at the bottom of the file.
mPreviewSize = new Size(1280, 720);
Log.d(TAG, "setUpCameraOutputs: preview width: " + mPreviewSize.getWidth());
Log.d(TAG, "setUpCameraOutputs: preview height: " + mPreviewSize.getHeight());
If that works then we know it's a problem with the mPreviewSize variable.
from tabiancustomcamera.
Wow, writing that line did solve the issue. "mPreviewSize = new Size(1920, 1080)" worked as well.
Would putting the line "mPreviewSize = new Size(1920, 1080);" at this location prevent future issues regarding resolution? Or is there some place else that should be fixed?
from tabiancustomcamera.
Print a log to see what size is selected from this part
if(largest != null){
mPreviewSize = Utility.chooseOptimalSize(map.getOutputSizes(SurfaceTexture.class),
rotatedPreviewWidth, rotatedPreviewHeight, maxPreviewWidth,
maxPreviewHeight, largest);
// print a log here
}
from tabiancustomcamera.
The size selected here is 256:144. I also checked the screenshots of my log from branch 24 end and branch 25 end and it shows 1920:1080 shrinking to 256:144.. hm..
from tabiancustomcamera.
Then the "ChooseOptimalSize" method is flawed (I doubt that), or one of the inputs to that method are incorrect.
I'll take a look at that later.
from tabiancustomcamera.
Just checked to see if my Utility class is different from your code in branch 2.5, and it looks they are identical. Thanks for helping me out!
from tabiancustomcamera.
This is very strange. I own an s8 and the screen is almost identical.
There isn't much I can do on my end to debug this unfortunately since I don't have an S9.
Replace the "largest != null" if statement with this and show me the log again please.
if(largest != null){
Log.d(TAG, "setUpCameraOutputs: largest: " + largest.toString());
mPreviewSize = Utility.chooseOptimalSize(map.getOutputSizes(SurfaceTexture.class),
rotatedPreviewWidth, rotatedPreviewHeight, maxPreviewWidth,
maxPreviewHeight, largest);
}
from tabiancustomcamera.
Hey Mitch, logcat says
largest: 3264x1836
Thanks for your help!
from tabiancustomcamera.
I'm honestly really not sure. It's very strange.
Just to confirm, have you tried cloning the repository fresh, going to branch 2.5, and running it?
If you have, does it still give you the issue?
from tabiancustomcamera.
Hi Mitch, I haven't tried to clone it because I am not familiar with github. But I will try it and check the logs again, get back to you. Thanks!
from tabiancustomcamera.
I'm pretty sure I show you in this video: https://codingwithmitch.com/courses/android-custom-camera/how-use-source-code/
from tabiancustomcamera.
Related Issues (20)
- Crashes when capture picture using back camera and while previewing it. HOT 4
- Drag and resizing not working HOT 6
- the preview you see in the room before the shot is deformed, after shot the image is instead well proportioned. HOT 6
- Samsung Exinos phone
- Preview Front and Back Camera is too dark HOT 1
- Distorted preview just sometimes HOT 3
- How to capture video
- Issue With Camera Load HOT 1
- Just ask.. not issue
- java.lang.NullPointerException: Attempt to invoke virtual method 'int android.util.Size.getWidth()' on a null object reference HOT 1
- video feature HOT 1
- int android.util.Size.getWidth()' on a null object reference
- Crashes when you change the camera view away from you and take a picture. HOT 2
- On LG NExus 5x unnecessary padding shows HOT 2
- Image Captured By Camera (Front & Back ) Is Always A Focused Circle Shape HOT 8
- Actually its not an issue , but i wanna ask something // HOT 1
- front camera appears grainy on first load HOT 1
- Glide crashes with glide.Registry$NoModelLoaderAvailableException upon taking a picture HOT 6
- App Crash HOT 1
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 tabiancustomcamera.