gl/upload: fail propoerly if init fails

This commit is contained in:
Matthew Waters 2014-05-08 15:40:33 +10:00 committed by Tim-Philipp Müller
parent 857200ff40
commit 862df41b2d

View file

@ -50,7 +50,7 @@
static gboolean _upload_memory (GstGLUpload * upload); static gboolean _upload_memory (GstGLUpload * upload);
//static gboolean _do_upload_fill (GstGLContext * context, GstGLUpload * upload); //static gboolean _do_upload_fill (GstGLContext * context, GstGLUpload * upload);
//static gboolean _do_upload_make (GstGLContext * context, GstGLUpload * upload); //static gboolean _do_upload_make (GstGLContext * context, GstGLUpload * upload);
static void _init_upload (GstGLUpload * upload); static gboolean _init_upload (GstGLUpload * upload);
//static gboolean _init_upload_fbo (GstGLContext * context, GstGLUpload * upload); //static gboolean _init_upload_fbo (GstGLContext * context, GstGLUpload * upload);
static gboolean _gst_gl_upload_perform_with_data_unlocked (GstGLUpload * upload, static gboolean _gst_gl_upload_perform_with_data_unlocked (GstGLUpload * upload,
GLuint texture_id, gpointer data[GST_VIDEO_MAX_PLANES]); GLuint texture_id, gpointer data[GST_VIDEO_MAX_PLANES]);
@ -601,7 +601,7 @@ _gst_gl_upload_perform_with_data_unlocked (GstGLUpload * upload,
} }
/* Called in the gl thread */ /* Called in the gl thread */
static void static gboolean
_init_upload (GstGLUpload * upload) _init_upload (GstGLUpload * upload)
{ {
GstGLFuncs *gl; GstGLFuncs *gl;
@ -629,11 +629,10 @@ _init_upload (GstGLUpload * upload)
&out_info)) &out_info))
goto error; goto error;
upload->priv->result = TRUE; return TRUE;
return;
error: error:
upload->priv->result = FALSE; return FALSE;
} }
static gboolean static gboolean
@ -649,8 +648,11 @@ _upload_memory (GstGLUpload * upload)
in_width = GST_VIDEO_INFO_WIDTH (&upload->in_info); in_width = GST_VIDEO_INFO_WIDTH (&upload->in_info);
in_height = GST_VIDEO_INFO_HEIGHT (&upload->in_info); in_height = GST_VIDEO_INFO_HEIGHT (&upload->in_info);
if (!upload->initted) if (!upload->initted) {
_init_upload (upload); if (!_init_upload (upload)) {
return FALSE;
}
}
for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&upload->in_info); i++) { for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&upload->in_info); i++) {
if (!gst_memory_map ((GstMemory *) upload->in_tex[i], &map_infos[i], if (!gst_memory_map ((GstMemory *) upload->in_tex[i], &map_infos[i],