CameraManager | Simple Swift class to provide all the configurations | iOS library
kandi X-RAY | CameraManager Summary
kandi X-RAY | CameraManager Summary
This is a simple Swift class to provide all the configurations you need to create custom camera view in your app. It follows orientation change and updates UI accordingly, supports front and rear camera selection, pinch to zoom, tap to focus, exposure slider, different flash modes, inputs and outputs and QRCode detection. Just drag, drop and use.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of CameraManager
CameraManager Key Features
CameraManager Examples and Code Snippets
Community Discussions
Trending Discussions on CameraManager
QUESTION
Recently I got notified about a crash from firebase and this is the message:
...ANSWER
Answered 2021-Jun-03 at 05:31I could imagine that layer.session = nil
will cause a re-configuration of the capture session (since the connection to the preview layer is removed). And since you are calling stopRunning()
async, I guess you can run into race conditions where stopRunning()
gets called right in the middle of the configuration change.
I would suggest you either try to make the cleanup calls synchronous (queue.sync { ... }
) or move the layer cleanup into the async
block as well.
QUESTION
I have an app which records videos, it has about 80K current installations (more than 100K downloads), Crashlytics statistics seems to be good - Crash-free users 99.66% and rating on Google Play is also OK - 4.5
But still for some of my users can happen the next errors (it may happened for such user once or a couple of times by now, so not often, but still happens from time to time):
android.hardware.camera2.CameraAccessException: CAMERA_DISABLED (1): connectHelper:1578: Camera "0" disabled by policy
android.hardware.camera2.CameraAccessException: CAMERA_DISCONNECTED (2): Camera service is currently unavailable
java.lang.IllegalArgumentException: supportsCameraApi:2096: Unknown camera ID 0
android.hardware.camera2.CameraAccessException: CAMERA_DISABLED (1): validateClientPermissionsLocked:1066: Caller "com.MY_APP_PACKAGE" (PID 10237, UID 21433) cannot open camera "1" when sensor privacy is enabled
on opening camera using camera2
API:
ANSWER
Answered 2021-Apr-28 at 23:02android.hardware.camera2.CameraAccessException: CAMERA_DISABLED (1): connectHelper:1578: Camera "0" disabled by policy
QUESTION
I am working on a React Native package to get information about the cameras on an Android device. The issue is that not all the cameras are showing up.
My code is the following:
...ANSWER
Answered 2021-Apr-29 at 23:31Unfortunately, not all manufacturers support the logical camera APIs, even when they ship a camera cluster. Until they do, it may not be possible to directly access the physical cameras.
Sometimes, there's not automatic switching on zoom either, so you are stuck with just the regular FOV camera entirely.
Most of these devices have OEM-specific ways to access all the cameras, but those vary by device, and may not be accessible to regular apps at all.
QUESTION
I am trying to find a way to capture a photo with Camera2, but with Landscape rotation without enabling the rotation option on my device. So what I am trying to do is to take a photo when is rotated to landscape physically, not using the Auto Rotate mode.So what have done is setted up a when function to count up the windowManager to every key value from 0 to 3 to have an effect. It doesn't work correctly and making photos in Portrait orientation and no effect. Here is the code:
...ANSWER
Answered 2021-Apr-22 at 13:06Ok, I found out the solution. So basically within the code there is this:
QUESTION
When rotating the screen, like a blender I want to rotate the screen to a point in the center of the screen. However, since the center of the screen, it is a 2d coordinate, so even if the screen center vector comes out, the corresponding point does not come out. Even though there is a vector that the camera shoots in a straight line, the point cannot be accurately known, so I do not know what center point zpos to rotate the screen based on.
I don't know how to specify the z-axis of the center coordinate of the screen so that it moves through the center of the screen like a blender. Is the grid tile based on the z-axis?
...ANSWER
Answered 2021-Apr-13 at 02:33 [SerializeField, Range(0.0f, 1.0f)]
float lerpRate;
float xRotation;
float yRotation;
float xMovement;
float yMovement;
UndoRedo undoRedo;
//CamVectorSaver camVectorSaver;
// RecordStarter recordStarter;
[Header("Set in inspector")]
public GameObject replyObj;
public static event MouseMoved MouseMoved;
private static void OnMouseMoved(float xmovement, float ymovement)
{
MouseMoved handler = MouseMoved;
if (handler != null) handler(xmovement, ymovement);
}
private void Rotate(float xMovement, float yMovement)
{
xRotation += xMovement;
yRotation += yMovement;
}
void Start()
{
undoRedo = ObjectManager.S.gameObject.GetComponent();
// recordStarter = replyObj.GetComponent();
//camVectorSaver = this.GetComponent();
MouseMoved += Rotate;
}
void LateUpdate()
{
if (!SubCamManager.S.checkInOut)
return;
if (SubCamManager.S.mouseClickMode == MouseClickMode.Drawline
&& SubCamManager.S.mouseClickMode == MouseClickMode.Lasootool)
return;
if (Input.GetMouseButton(1)||Input.GetMouseButton(0))
return;
//if (Input.GetMouseButtonDown(2) && recordStarter.booRecordOn)
//{
// // camVectorSaver.EnableScript(false);
// recordStarter.RecordTime();
//}
InvokeActionOnInput();
if (Input.GetMouseButton(2)||Input.GetButton("Horizontal")
|| Input.GetButton("Vertical") )
{
xRotation = Mathf.Lerp(xRotation, 0, lerpRate);
yRotation = Mathf.Lerp(yRotation, 0, lerpRate);
//Gimballock
//transform.eulerAngles += new Vector3(-yRotation, xRotation, 0);
Quaternion yRot = Quaternion.Euler(0f, xRotation, 0f);
Quaternion xRot = Quaternion.Euler(-yRotation, 0f, 0f);
transform.rotation = yRot * transform.rotation * xRot;
}
}
void OnDestroy()
{
MouseMoved += Rotate;
}
private void InvokeActionOnInput()
{
if (Input.GetMouseButton(2))
{
xMovement = Input.GetAxis("Mouse X");
yMovement = Input.GetAxis("Mouse Y");
OnMouseMoved(xMovement, yMovement);
}
//키보드 사용 하는 부분
if (Input.GetButton("Horizontal"))
{
xMovement = Input.GetAxis("Horizontal") * 0.7f;
OnMouseMoved(xMovement, 0);
}
if (Input.GetButton("Vertical"))
{
yMovement = Input.GetAxis("Vertical")*0.7f;
OnMouseMoved(0, yMovement);
}
}
QUESTION
Device: Huawei P40 Lite E dependencies:
...ANSWER
Answered 2021-Apr-08 at 21:37Simultaneous ImageCapture in YUV and ImageAnalysis in YUV isn't supported on all camera devices; if you switch the ImageCapture to JPEG you should be fine on all devices (if you want details, you can look at the tables in the underlying camera2 API's session creation). LIMITED-level camera devices only support 3 outputs if one of them is JPEG. FULL-level devices should support it, though.
That's why setBufferFormat is not part of the CameraX public API - using it easily pushes you out of the set of outputs that are commonly supported by camera devices.
QUESTION
In kotlin I have a function that returns MutableLiveData of type Boolean
...ANSWER
Answered 2021-Apr-11 at 10:08You can modify your function:
QUESTION
Please help me. I am developing a mobile application that needs to stream a video to a PC. One of the requirements is to start work with a locked phone. But every time I try to open CameraDevice it causes an exception.
...ANSWER
Answered 2021-Mar-31 at 18:47So, as a Muhammad Babar suggested to me, I can lower the target API level, and it will help. But I just found the right solution to the problem, if you interested -- read this docs:
https://developer.android.com/guide/components/foreground-services
QUESTION
I hope you can fix my problem: I have got a textureview to takes photos but when he capture photos, the file who need to contain the picture is empty. I don't know where and what is the problem. I just think that the problem is when the file is created. Thank you to help me.
This is a part of my code :
...ANSWER
Answered 2021-Mar-10 at 08:02Try with below code:
QUESTION
I have surfed all the internet and didn't find any solution, I am using Camera2 api to record a video from my front camera, I have tested on multiple devices and its working fine, but when I tried on my Samsung Galaxy 3, after I press the record button sometimes the recording work, and sometimes the camera preview freeze, you can find below the code I have implemented
- Create Preview and Record request by lazy loading
ANSWER
Answered 2021-Mar-07 at 17:41I did not see in your code the handling of the camera on a thread different from the Main/GUI. In fact I never saw a good tutorial to do that - so - this is what I have done:
Declare handlerThread
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install CameraManager
The Swift Package Manager is a tool for managing the distribution of Swift code.
Carthage is another dependency management tool written in Swift.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page