Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gst-plugins-good.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorHou Qi <qi.hou@nxp.com>2020-12-11 06:24:14 +0300
committerHou Qi <qi.hou@nxp.com>2020-12-14 04:15:18 +0300
commitff1dd307f2e2733628590a3875f8838cb6d1d979 (patch)
tree1feb4dfe774c6a053ceddc704e52714e31ea1d3c /sys
parent6d4dcb430d5448f506bb9076c7abe19200a081c3 (diff)
v4l2object: Use active resolution during fallback colorspace probe
For legacy drivers that don't implement ENUM_FRAMESIZE, use active resolution to probe colorspace. This can improve the accuracy of the result when the colorspace depends on the resolution. This fixes a wrong colorspace issue on board with vendor bsp at resolution 2560x1440. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/830>
Diffstat (limited to 'sys')
-rw-r--r--sys/v4l2/gstv4l2object.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index c6d1f5fd8..e46eb72aa 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -2950,9 +2950,19 @@ default_frame_sizes:
pixelformat);
if (!v4l2object->skip_try_fmt_probes) {
+ gint probed_w, probed_h;
+ if (v4l2object->info.width >= min_w && v4l2object->info.width <= max_w &&
+ v4l2object->info.height >= min_h
+ && v4l2object->info.height <= max_h) {
+ probed_w = v4l2object->info.width;
+ probed_h = v4l2object->info.height;
+ } else {
+ probed_w = max_w;
+ probed_h = max_h;
+ }
/* We could consider to check colorspace for min too, in case it depends on
* the size. But in this case, min and max could not be enough */
- gst_v4l2_object_add_colorspace (v4l2object, tmp, max_w, max_h,
+ gst_v4l2_object_add_colorspace (v4l2object, tmp, probed_w, probed_h,
pixelformat);
}