v4l2object: always set the GstV4l2Error on error

Some of the error case were conditional to using try_fmt or not.
This is slightly unexpected, always set the error so the caller
can decide.

https://bugzilla.gnome.org/show_bug.cgi?id=785156
This commit is contained in:
Nicolas Dufresne 2017-07-19 22:07:32 -04:00
parent 059ccf9749
commit 7d3b2628df

View File

@ -3596,36 +3596,30 @@ set_fmt_failed:
} }
invalid_dimensions: invalid_dimensions:
{ {
if (!try_only) { GST_V4L2_ERROR (error, RESOURCE, SETTINGS,
GST_V4L2_ERROR (error, RESOURCE, SETTINGS, (_("Device '%s' cannot capture at %dx%d"),
(_("Device '%s' cannot capture at %dx%d"), v4l2object->videodev, width, height),
v4l2object->videodev, width, height), ("Tried to capture at %dx%d, but device returned size %dx%d",
("Tried to capture at %dx%d, but device returned size %dx%d", width, height, format.fmt.pix.width, format.fmt.pix.height));
width, height, format.fmt.pix.width, format.fmt.pix.height));
}
return FALSE; return FALSE;
} }
invalid_pixelformat: invalid_pixelformat:
{ {
if (!try_only) { GST_V4L2_ERROR (error, RESOURCE, SETTINGS,
GST_V4L2_ERROR (error, RESOURCE, SETTINGS, (_("Device '%s' cannot capture in the specified format"),
(_("Device '%s' cannot capture in the specified format"), v4l2object->videodev),
v4l2object->videodev), ("Tried to capture in %" GST_FOURCC_FORMAT
("Tried to capture in %" GST_FOURCC_FORMAT ", but device returned format" " %" GST_FOURCC_FORMAT,
", but device returned format" " %" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (pixelformat),
GST_FOURCC_ARGS (pixelformat), GST_FOURCC_ARGS (format.fmt.pix.pixelformat)));
GST_FOURCC_ARGS (format.fmt.pix.pixelformat)));
}
return FALSE; return FALSE;
} }
invalid_planes: invalid_planes:
{ {
if (!try_only) { GST_V4L2_ERROR (error, RESOURCE, SETTINGS,
GST_V4L2_ERROR (error, RESOURCE, SETTINGS, (_("Device '%s' does support non-contiguous planes"),
(_("Device '%s' does support non-contiguous planes"), v4l2object->videodev),
v4l2object->videodev), ("Device wants %d planes", format.fmt.pix_mp.num_planes));
("Device wants %d planes", format.fmt.pix_mp.num_planes));
}
return FALSE; return FALSE;
} }
invalid_field: invalid_field: