camerabin: cleanup used caps when going to NULL

Resets used caps so that camerabin doesn't try to use them
when restarting, where elements/properties might have changed
and the old caps be incompatible
This commit is contained in:
Thiago Santos 2010-09-20 08:42:41 -03:00
parent ca16d951ba
commit 73a909c0e3

View file

@ -851,6 +851,15 @@ camerabin_destroy_elements (GstCameraBin * camera)
camera->active_bin = NULL; camera->active_bin = NULL;
/* Reset caps data as the elements might be completely different next
* time we 'start' */
if (camera->view_finder_caps) {
gst_caps_replace (&camera->view_finder_caps, NULL);
}
gst_caps_replace (&camera->allowed_caps, NULL);
camera->fps_n = camera->fps_d = 0;
camera->width = camera->height = 0;
/* Remove elements */ /* Remove elements */
gst_camerabin_remove_elements_from_bin (GST_BIN (camera)); gst_camerabin_remove_elements_from_bin (GST_BIN (camera));
} }