mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 13:41:48 +00:00
amc: properly deinit when ahcsrc register fails
In the androidmedia plugin_init, we initialize various resources on the Android device. If anything fails during this series of initializations, we need to deinitialize any initializations that already occurred. However, we don't do so if we fail to register the ahcsrc element. Fix this. https://bugzilla.gnome.org/show_bug.cgi?id=763065
This commit is contained in:
parent
ddebf1ff66
commit
a7d6c07b86
1 changed files with 11 additions and 6 deletions
|
@ -3327,22 +3327,27 @@ plugin_init (GstPlugin * plugin)
|
|||
|
||||
if (!gst_android_graphics_imageformat_init ()) {
|
||||
GST_ERROR ("Failed to init android image format");
|
||||
gst_android_graphics_surfacetexture_deinit ();
|
||||
return FALSE;
|
||||
goto failed_surfacetexture;
|
||||
}
|
||||
|
||||
if (!gst_android_hardware_camera_init ()) {
|
||||
gst_android_graphics_surfacetexture_deinit ();
|
||||
gst_android_graphics_imageformat_deinit ();
|
||||
return FALSE;
|
||||
goto failed_graphics_imageformat;
|
||||
}
|
||||
|
||||
if (!gst_element_register (plugin, "ahcsrc", GST_RANK_NONE, GST_TYPE_AHC_SRC)) {
|
||||
GST_ERROR ("Failed to register android camera source");
|
||||
return FALSE;
|
||||
goto failed_hardware_camera;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
failed_hardware_camera:
|
||||
gst_android_hardware_camera_deinit ();
|
||||
failed_graphics_imageformat:
|
||||
gst_android_graphics_imageformat_deinit ();
|
||||
failed_surfacetexture:
|
||||
gst_android_graphics_surfacetexture_deinit ();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue