camerabin: Add an assertion to preview pipeline generation

Adds an assertion in case the preview pipeline is NULL and also
explicitly initializes preview caps to NULL for clarity.
This commit is contained in:
Lasse Laukkanen 2011-03-15 09:15:35 -03:00 committed by Thiago Santos
parent 48e8c093dc
commit fbe4f5f610
2 changed files with 3 additions and 0 deletions

View file

@ -206,6 +206,7 @@ gst_camerabin_preview_convert (GstCameraBinPreviewPipelineData * data,
GstFlowReturn fret;
g_return_val_if_fail (GST_BUFFER_CAPS (buf) != NULL, NULL);
g_return_val_if_fail (data != NULL, NULL);
if (data->pipeline == NULL) {
GST_WARNING ("pipeline is NULL");

View file

@ -3320,6 +3320,8 @@ gst_camerabin_init (GstCameraBin * camera, GstCameraBinClass * gclass)
camera->pad_view_vid = NULL;
camera->video_preview_buffer = NULL;
camera->preview_caps = NULL;
camera->video_preview_caps = NULL;
/* image capture bin */
camera->imgbin = g_object_new (GST_TYPE_CAMERABIN_IMAGE, NULL);