SUPER HACK! completly recreate camera hal to restart preview (hammerhead) #10
Conversation
…head) This is a massive SUPER HACK! it completely destroy and recreate camera hal to restart preview. ¯\_(ツ)_/¯ Kinda fixes: ubports/ubuntu-touch#611
here at ubports we don't just do hacks, we do SUPER HACKS |
I think it's better not to actually change the state, but to call If the camera app needs to do something when this happen, see my |
@@ -54,6 +57,10 @@ AalImageCaptureControl::AalImageCaptureControl(AalCameraService *service, QObjec | |||
m_audioPlayer->setMedia(QUrl::fromLocalFile("/system/media/audio/ui/camera_click.ogg")); | |||
m_audioPlayer->setAudioRole(QAudio::NotificationRole); | |||
|
|||
char name[PROP_VALUE_MAX] = ""; | |||
property_get("ro.product.device", name, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be broken again under device-info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
@@ -172,7 +179,13 @@ void AalImageCaptureControl::saveJpeg(const QByteArray& data) | |||
|
|||
// Restart the viewfinder and notify that the camera is ready to capture again | |||
if (m_service->androidControl()) { | |||
android_camera_start_preview(m_service->androidControl()); | |||
// SUPER HACK! completly destroy and recreate camera hal to restart preview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem also occurs when flipping from front to rear camera or when entering video recording mode, so the workaround will have to happen there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix that
Not needed: fixed by ubports/android_kernel_lge_hammerhead#6 |
This is a massive SUPER HACK! it completely destroy and recreate camera
hal to restart preview. ¯_(ツ)_/¯
Kinda fixes: ubports/ubuntu-touch#611
Lets keep this open as last resort if we don't find a better fix in time