summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2021-08-17 16:49:47 +0200
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-08-17 17:19:16 +0000
commitd1cd310e42933315b4722468c7b0929260cf9b4b (patch)
tree08c6057ca59e30f809324fa43199197b3d1804f8
parent286208576f1545b3b22d31246bc05b6e56e80bd5 (diff)
downloadgstreamer-plugins-good-d1cd310e42933315b4722468c7b0929260cf9b4b.tar.gz
videocrop: Fix icles tests.
Internally videcrop can call gst_video_crop_set_info() with NULL as in caps. Then critical messages are raised when the in caps are processed. To fix this the in caps are checked, and if they are present, its capsfeature is extracted, otherwise, the previous raw caps detection remains as before. Also the videocrop-test removes the format field in the structure because now its always passed. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1056>
-rw-r--r--gst/videocrop/gstvideocrop.c8
-rw-r--r--tests/icles/videocrop-test.c1
2 files changed, 6 insertions, 3 deletions
diff --git a/gst/videocrop/gstvideocrop.c b/gst/videocrop/gstvideocrop.c
index cc3175f00..8d4ba909c 100644
--- a/gst/videocrop/gstvideocrop.c
+++ b/gst/videocrop/gstvideocrop.c
@@ -802,9 +802,11 @@ gst_video_crop_set_info (GstVideoFilter * vfilter, GstCaps * in,
GST_LOG_OBJECT (crop, "incaps = %" GST_PTR_FORMAT ", outcaps = %"
GST_PTR_FORMAT, in, out);
- features = gst_caps_get_features (in, 0);
- crop->raw_caps = gst_caps_features_is_equal (features,
- GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY);
+ if (in) {
+ features = gst_caps_get_features (in, 0);
+ crop->raw_caps = gst_caps_features_is_equal (features,
+ GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY);
+ }
if (!crop->raw_caps)
goto beach;
diff --git a/tests/icles/videocrop-test.c b/tests/icles/videocrop-test.c
index 2acfa3373..bf5d437b1 100644
--- a/tests/icles/videocrop-test.c
+++ b/tests/icles/videocrop-test.c
@@ -156,6 +156,7 @@ video_crop_get_test_caps (GstElement * videocrop)
FRAMERATE, 1, NULL);
gst_structure_remove_field (new_structure, "width");
gst_structure_remove_field (new_structure, "height");
+ gst_structure_remove_field (new_structure, "format");
gst_caps_append_structure (single_caps, new_structure);
/* should be fixed without width/height */