mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
androidcamera: Small refactor in case open doesn't throw an exception but returns null
This commit is contained in:
parent
acfb1c44a7
commit
11b28224b5
1 changed files with 21 additions and 20 deletions
|
@ -1790,7 +1790,7 @@ gst_ah_camera_get_parameters (GstAHCamera * self)
|
|||
GstAHCParameters *params = NULL;
|
||||
|
||||
object = AHC_CALL (return NULL, Object, getParameters);
|
||||
|
||||
if (object) {
|
||||
params = g_slice_new0 (GstAHCParameters);
|
||||
params->object = (*env)->NewGlobalRef (env, object);
|
||||
(*env)->DeleteLocalRef (env, object);
|
||||
|
@ -1800,6 +1800,7 @@ gst_ah_camera_get_parameters (GstAHCamera * self)
|
|||
g_slice_free (GstAHCParameters, params);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
|
@ -1822,7 +1823,7 @@ gst_ah_camera_open (gint camera_id)
|
|||
GstAHCamera *camera = NULL;
|
||||
|
||||
object = AHC_STATIC_CALL (goto done, Object, open, camera_id);
|
||||
|
||||
if (object) {
|
||||
camera = g_slice_new0 (GstAHCamera);
|
||||
camera->object = (*env)->NewGlobalRef (env, object);
|
||||
(*env)->DeleteLocalRef (env, object);
|
||||
|
@ -1830,12 +1831,12 @@ gst_ah_camera_open (gint camera_id)
|
|||
GST_ERROR ("Failed to create global reference");
|
||||
(*env)->ExceptionClear (env);
|
||||
g_slice_free (GstAHCamera, camera);
|
||||
goto done;
|
||||
camera = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return camera;
|
||||
done:
|
||||
return NULL;
|
||||
return camera;
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
|
Loading…
Reference in a new issue