Merge lp:~fboucault/qtubuntu-camera/no_black_screens into lp:qtubuntu-camera

Proposed by Florian Boucault
Status: Merged
Approved by: Bill Filler
Approved revision: 99
Merged at revision: 99
Proposed branch: lp:~fboucault/qtubuntu-camera/no_black_screens
Merge into: lp:qtubuntu-camera
Diff against target: 60 lines (+2/-16)
2 files modified
src/aalcameraservice.cpp (+2/-15)
src/aalcameraservice.h (+0/-1)
To merge this branch: bzr merge lp:~fboucault/qtubuntu-camera/no_black_screens
Reviewer Review Type Date Requested Status
Jim Hodapp (community) code Approve
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+227601@code.launchpad.net

Commit message

Fixed disconnection so that it always happens and reconnection always works.
Removed never executed code that was supposed to work around deletion issues.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

tested, works

review: Approve
Revision history for this message
Jim Hodapp (jhodapp) wrote :

Looks good, thanks

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/aalcameraservice.cpp'
--- src/aalcameraservice.cpp 2014-07-08 15:12:58 +0000
+++ src/aalcameraservice.cpp 2014-07-21 15:59:58 +0000
@@ -39,8 +39,7 @@
39AalCameraService::AalCameraService(QObject *parent):39AalCameraService::AalCameraService(QObject *parent):
40 QMediaService(parent),40 QMediaService(parent),
41 m_androidControl(0),41 m_androidControl(0),
42 m_androidListener(0),42 m_androidListener(0)
43 m_oldAndroidControl(0)
44{43{
45 m_service = this;44 m_service = this;
4645
@@ -77,8 +76,6 @@
77 delete m_videoOutput;76 delete m_videoOutput;
78 delete m_viewfinderControl;77 delete m_viewfinderControl;
79 delete m_exposureControl;78 delete m_exposureControl;
80 if (m_oldAndroidControl)
81 android_camera_delete(m_oldAndroidControl);
82 if (m_androidControl)79 if (m_androidControl)
83 android_camera_delete(m_androidControl);80 android_camera_delete(m_androidControl);
84 delete m_storageManager;81 delete m_storageManager;
@@ -148,15 +145,6 @@
148 if (m_androidControl)145 if (m_androidControl)
149 return true;146 return true;
150147
151 if (m_oldAndroidControl){
152 /// FIXME
153 /// becasue android_camera_disconnect() is asynchronous, it's not deleted directly when calling disconnect
154 /// properly implemented, whe should be notified when it can be deleted
155 /// in case 2 switches happend very fast, this delete might happen too eraly
156 android_camera_delete(m_oldAndroidControl);
157 }
158 m_oldAndroidControl = m_androidControl;
159
160 CameraType device = BACK_FACING_CAMERA_TYPE;148 CameraType device = BACK_FACING_CAMERA_TYPE;
161 if (!isBackCameraUsed())149 if (!isBackCameraUsed())
162 device = FRONT_FACING_CAMERA_TYPE;150 device = FRONT_FACING_CAMERA_TYPE;
@@ -190,8 +178,7 @@
190178
191void AalCameraService::disconnectCamera()179void AalCameraService::disconnectCamera()
192{180{
193 if (m_service->videoOutputControl()->isViewfinderRunning())181 m_service->videoOutputControl()->stopPreview();
194 m_service->videoOutputControl()->stopPreview();
195182
196 if (m_androidControl) {183 if (m_androidControl) {
197 android_camera_disconnect(m_androidControl);184 android_camera_disconnect(m_androidControl);
198185
=== modified file 'src/aalcameraservice.h'
--- src/aalcameraservice.h 2014-07-08 15:12:58 +0000
+++ src/aalcameraservice.h 2014-07-21 15:59:58 +0000
@@ -105,7 +105,6 @@
105105
106 CameraControl *m_androidControl;106 CameraControl *m_androidControl;
107 CameraControlListener *m_androidListener;107 CameraControlListener *m_androidListener;
108 CameraControl *m_oldAndroidControl;
109108
110 StorageManager *m_storageManager;109 StorageManager *m_storageManager;
111};110};

Subscribers

People subscribed via source and target branches