+ /* preview buffer - get resolution from caps */
+ pad = gst_element_get_static_pad(sc->element[_MMCAMCORDER_VIDEOSRC_FILT].gst, "src");
+ mmf_return_val_if_fail(pad, FALSE);
+
+ caps = gst_pad_get_allowed_caps(pad);
+ if (!caps) {
+ _mmcam_dbg_err("failed to get caps from pad %p", pad);
+ gst_object_unref(pad);
+ return FALSE;
+ }
+
+ structure = gst_caps_get_structure(caps, 0);
+ if (!structure) {
+ _mmcam_dbg_err("failed to get structure from caps %p", caps);
+ gst_caps_unref(caps);
+ gst_object_unref(pad);
+ return FALSE;
+ }
+
+ gst_structure_get_int(structure, "width", &stream.width);
+ gst_structure_get_int(structure, "height", &stream.height);
+
+ gst_caps_unref(caps);
+ caps = NULL;
+ gst_object_unref(pad);
+ pad = NULL;