From bb5a22c504bfa512cd8e40fc252947a5946ffc23 Mon Sep 17 00:00:00 2001 From: Luis Zarrabeitia Date: Sun, 11 May 2014 19:00:14 -0400 Subject: [PATCH] highgui: fix segfault on CvCapture_GStreamer::retrieveFrame CvCapture_GStreamer::retrieveFrame assumes that RGB videos are 24BPP. This is not necesarily the case, unless we explicitly tell GStreamer that we want 24BPP RGB streams. Adding bpp=(int)24 to the appsink caps. --- modules/highgui/src/cap_gstreamer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/highgui/src/cap_gstreamer.cpp b/modules/highgui/src/cap_gstreamer.cpp index cafc803db4..72e19b16f0 100644 --- a/modules/highgui/src/cap_gstreamer.cpp +++ b/modules/highgui/src/cap_gstreamer.cpp @@ -400,6 +400,7 @@ bool CvCapture_GStreamer::open( int type, const char* filename ) gst_app_sink_set_max_buffers (GST_APP_SINK(sink), 1); gst_app_sink_set_drop (GST_APP_SINK(sink), stream); caps = gst_caps_new_simple("video/x-raw-rgb", + "bpp", G_TYPE_INT, 24, "red_mask", G_TYPE_INT, 0x0000FF, "green_mask", G_TYPE_INT, 0x00FF00, "blue_mask", G_TYPE_INT, 0xFF0000,