Comments (7)
Oh nice one.
Could you provide the full exception?
Now I wonder, what will be the best answer to this issue.
Should we clamp focus rectangle >= 0?
Or should we cancel focus when we detect the issue?
Or somehow synchronize everything?
from streampack.
The relevant exception stack trace:
"main@15148" prio=5 tid=0x2 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at com.android.internal.util.Preconditions.checkArgumentNonnegative(Preconditions.java:324)
at android.hardware.camera2.params.MeteringRectangle.<init>(MeteringRectangle.java:138)
at io.github.thibaultbee.streampack.utils.FocusMetering$Companion.getMeteringRect(CameraSettings.kt:982)
at io.github.thibaultbee.streampack.utils.FocusMetering$Companion.getMeteringRectangles(CameraSettings.kt:926)
at io.github.thibaultbee.streampack.utils.FocusMetering$Companion.access$getMeteringRectangles(CameraSettings.kt:848)
at io.github.thibaultbee.streampack.utils.FocusMetering.startFocusAndMetering(CameraSettings.kt:719)
at io.github.thibaultbee.streampack.utils.FocusMetering.onTap(CameraSettings.kt:816)
at io.github.thibaultbee.streampack.views.PreviewView.performClick(PreviewView.kt:144)
at io.github.thibaultbee.streampack.views.PreviewView.onTouchEvent(PreviewView.kt:129)
at android.view.View.dispatchTouchEvent(View.java:16212)
Great question, I guess in the best of all worlds it would "just work" but that seems difficult. And also, in my specific case on an S22, what's happening under the covers, I believe, is that the camera is automatically switching to the wide-angle lens, which, on my device, is a fixed-field lens and thus, no focusing is possible.
I don't really see a clear best option, but I am certainly no expert. On my device, simply canceling the focus would be fine, since the fixed lens can't focus anyway. In any case you could argue that this is both easy and reasonable. I guess the second choice would be clamping. If it were me, I would cancel and log a message that leads the developer to understand that if they want, they could clamp it themselves.
from streampack.
I tried to reproduce this issue in the demo but I could not.
Does it happen when you zoom in or is it just when you zoom out? Have you changed something in the code?
I didn't know it was possible to have zoom < 1.
Unfortunately I don't have a device to test this.
Could you add log in the FocusMetering
class? Could you also log availableRatioRange
and everything you find usefull?
from streampack.
Could you test #98?
from streampack.
It does not crash when I zoom out, and there is lots of
2024-02-06 14:19:03.044 6781-6781 ViewRootIm...nActivity] io....thibaultbee.streampack.sample I ViewPostIme pointer 1
2024-02-06 14:19:03.056 6781-6781 >>TEST io....thibaultbee.streampack.sample E cropRegion: Rect(0, 0 - 4080, 3060)
2024-02-06 14:19:03.056 6781-6781 >>TEST io....thibaultbee.streampack.sample E adjustedPoint: PointF(0.6418467, 0.423781)
2024-02-06 14:19:03.056 6781-6781 >>TEST io....thibaultbee.streampack.sample E size: 0.16666667
2024-02-06 14:19:03.056 6781-6781 >>TEST io....thibaultbee.streampack.sample E centerX: 2618 - centerY: 1296
2024-02-06 14:19:03.056 6781-6781 >>TEST io....thibaultbee.streampack.sample E width: 680.0 - height: 510.0
2024-02-06 14:19:03.057 6781-6781 >>TEST io....thibaultbee.streampack.sample E focusRect1: Rect(2278, 1041 - 2958, 1551)
2024-02-06 14:19:03.057 6781-6781 >>TEST io....thibaultbee.streampack.sample E focusRect2: Rect(2278, 1041 - 2958, 1551)
2024-02-06 14:19:03.057 6781-6781 >>TEST io....thibaultbee.streampack.sample E cropRegion: Rect(0, 0 - 4080, 3060)
2024-02-06 14:19:03.057 6781-6781 >>TEST io....thibaultbee.streampack.sample E adjustedPoint: PointF(0.6418467, 0.423781)
2024-02-06 14:19:03.057 6781-6781 >>TEST io....thibaultbee.streampack.sample E size: 0.25
2024-02-06 14:19:03.057 6781-6781 >>TEST io....thibaultbee.streampack.sample E centerX: 2618 - centerY: 1296
2024-02-06 14:19:03.057 6781-6781 >>TEST io....thibaultbee.streampack.sample E width: 1020.0 - height: 765.0
2024-02-06 14:19:03.058 6781-6781 >>TEST io....thibaultbee.streampack.sample E focusRect1: Rect(2108, 913 - 3128, 1678)
2024-02-06 14:19:03.058 6781-6781 >>TEST io....thibaultbee.streampack.sample E focusRect2: Rect(2108, 913 - 3128, 1678)
2024-02-06 14:19:03.206 6781-6781 GestureDetector io....thibaultbee.streampack.sample I handleMessage TAP
When I tap outside of the 1x zoom rectangle, I see:
2024-02-06 14:21:13.480 6781-6781 ViewRootIm...nActivity] io....thibaultbee.streampack.sample I ViewPostIme pointer 1
2024-02-06 14:21:13.493 6781-6781 >>TEST io....thibaultbee.streampack.sample E cropRegion: Rect(0, 0 - 4080, 3060)
2024-02-06 14:21:13.493 6781-6781 >>TEST io....thibaultbee.streampack.sample E adjustedPoint: PointF(0.013833943, 0.6899047)
2024-02-06 14:21:13.493 6781-6781 >>TEST io....thibaultbee.streampack.sample E size: 0.16666667
2024-02-06 14:21:13.493 6781-6781 >>TEST io....thibaultbee.streampack.sample E centerX: 56 - centerY: 2111
2024-02-06 14:21:13.494 6781-6781 >>TEST io....thibaultbee.streampack.sample E width: 680.0 - height: 510.0
2024-02-06 14:21:13.494 6781-6781 >>TEST io....thibaultbee.streampack.sample E focusRect1: Rect(-284, 1856 - 396, 2366)
2024-02-06 14:21:13.494 6781-6781 >>TEST io....thibaultbee.streampack.sample E focusRect2: Rect(0, 1856 - 396, 2366)
2024-02-06 14:21:13.494 6781-6781 >>TEST io....thibaultbee.streampack.sample E cropRegion: Rect(0, 0 - 4080, 3060)
2024-02-06 14:21:13.495 6781-6781 >>TEST io....thibaultbee.streampack.sample E adjustedPoint: PointF(0.013833943, 0.6899047)
2024-02-06 14:21:13.495 6781-6781 >>TEST io....thibaultbee.streampack.sample E size: 0.25
2024-02-06 14:21:13.495 6781-6781 >>TEST io....thibaultbee.streampack.sample E centerX: 56 - centerY: 2111
2024-02-06 14:21:13.495 6781-6781 >>TEST io....thibaultbee.streampack.sample E width: 1020.0 - height: 765.0
2024-02-06 14:21:13.495 6781-6781 >>TEST io....thibaultbee.streampack.sample E focusRect1: Rect(-454, 1728 - 566, 2493)
2024-02-06 14:21:13.495 6781-6781 >>TEST io....thibaultbee.streampack.sample E focusRect2: Rect(0, 1728 - 566, 2493)
2024-02-06 14:21:16.767 6781-6781 ViewRootIm...nActivity] io....thibaultbee.streampack.sample I onDisplayChanged oldDisplayState=2 newDisplayState=2
from streampack.
Logs were unintentional.
I just removed them.
from streampack.
Released in 2.6.0
from streampack.
Related Issues (20)
- [Bug]: MP4 File appears to have time duration 00:01 in video player HOT 4
- [Bug]: When the higher video bit rate is used for SRT streaming, the video will frequently appear green screen or mosaic HOT 4
- Socket Exception while connect with encrypted srt server HOT 8
- Is it possible to use a dns to broadcast the streaming, say no-ip or others? HOT 2
- Connection Error HOT 2
- [Bug]: SrtProducer.connect(url) always throws "unknown host" when onConnectionListener is null HOT 2
- [Feat]: Get current bitrate of the stream HOT 3
- Video Capture Mirroring HOT 8
- [Feat]: Support for devices whose MountAngle is not general HOT 7
- [Feat]: Background RTMP Streaming HOT 4
- [Feat]: Lock resolution to starting orientation HOT 10
- [Feat]: Add SRTLA (SRT transport proxy with link aggregation for connection bonding) HOT 1
- [Bug]: Streaming the SRT video has a lot of lag HOT 2
- [Bug]: App crashes with "eglMakeCurrent failed" error HOT 2
- [Bug]: app crashes when start running HOT 2
- [Feat]: High latency when using the RTMP HOT 2
- [Bug]: When using SRT to push 1080P video, the latency is severe, about 7 seconds! HOT 3
- [Bug]: There are severe mosaics at higher bit rates(>2Mb/s). HOT 5
- [Bug]: "demo-camera" app crashes at startup HOT 7
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 streampack.