GNOME Bugzilla – Bug 655622
[opencv] [PATCH] Feature requests and bug fixes for gstOpenCV
Last modified: 2016-02-21 23:27:14 UTC
You can ask useful features for gstOpenCV elements and send bug fixes for these elements.
Created attachment 192902 [details] [review] update motioncells sink and src caps
Comment on attachment 192902 [details] [review] update motioncells sink and src caps like discussed in the facedetect/blur patch we don't need to constain the resolutiojn in the element to satisfy cpu-load concerns
one change that could be done for motioncells is to remove the custom mutex and protect the property accessors (_set_property and _get_property) with the GST_OBJECT_LOCK()/_UNLOCK() like done in the tee element in core.
Stefan, I replace all mutex lock/ unlock with GST_OBJECT_LOCK / UNLOCK and I tried test motioncells with this simple pipeline and after some first frames it freeze ... :( gst-launch-0.10 v4l2src device=/dev/video0 ! video/x-raw-yuv,width=320,height=240,framerate=10/1 ! ffmpegcolorspace ! motioncells ! ffmpegcolorspace ! xvimagesink GST_DEBUG=5 show me this : 0:00:18.028794952 23100 0x223de50 DEBUG default MotionCells.cpp:195:performDetectionMotionCells: DETECT MOTION 0:00:18.032094324 23100 0x223de50 LOG GST_MESSAGE gstmessage.c:185:gst_message_init: new message 0x2252080 0:00:18.066879396 23100 0x223de50 LOG GST_MESSAGE gstmessage.c:271:gst_message_new_custom: source motioncells0: creating new message 0x2252080 element I dont know what's wrong ... Robert
It works fine now. I made something wrong, but fix it now. Attached the patch :) Robert
Created attachment 193197 [details] [review] replace gmutex with GST_OBJECT_LOCK/UNLOCK
What is the reasoning behind restricting the caps? Please put that in the commit message. Also, please merge these two commits and attach the merged patch.
I made this caps limitations because I optimized OpenCV code for 320x240 and 352x288 resolution. It works fine with these resolutions. And I think I can guarantee with this patch that motioncells works fine. Maybe I can work on this that we can remove this limitations and it will work with any resolutions. But I need more time for this. Robert
Review of attachment 193197 [details] [review]: I think we can get rid of the propset_mutex totally (remove the instance variable).
Hi Stefan, today I applied your patch: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=f241dafe5c55c02d81f153de2a59e0a83d12d1c9 now valgrind show several new possibly lost: ==5510== 24 bytes in 1 blocks are possibly lost in loss record 1,213 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0x13D71C31: ??? (in /lib/libusb-1.0.so.0.0.0) ==5510== by 0x13D72FF8: ??? (in /lib/libusb-1.0.so.0.0.0) ==5510== by 0x13D70072: libusb_init (in /lib/libusb-1.0.so.0.0.0) ==5510== by 0xEE3303D: ??? (in /usr/lib/libdc1394.so.22.1.4) ==5510== by 0xEE21C87: dc1394_new (in /usr/lib/libdc1394.so.22.1.4) ==5510== by 0xB850518: CvDC1394::CvDC1394() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB85065F: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== ==5510== 24 bytes in 1 blocks are possibly lost in loss record 1,214 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0x13D71C31: ??? (in /lib/libusb-1.0.so.0.0.0) ==5510== by 0x13D73033: ??? (in /lib/libusb-1.0.so.0.0.0) ==5510== by 0x13D70072: libusb_init (in /lib/libusb-1.0.so.0.0.0) ==5510== by 0xEE3303D: ??? (in /usr/lib/libdc1394.so.22.1.4) ==5510== by 0xEE21C87: dc1394_new (in /usr/lib/libdc1394.so.22.1.4) ==5510== by 0xB850518: CvDC1394::CvDC1394() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB85065F: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== ==5510== 27 bytes in 1 blocks are possibly lost in loss record 1,226 of 2,863 ==5510== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261) ==5510== by 0xC4B0E6C: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B108D: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B125B: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xB85B6C3: cv::BmpDecoder::BmpDecoder() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB844E1C: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,235 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB844E37: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,236 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB844EEF: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,237 of 2,863 ==5510== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261) ==5510== by 0xC4B0E6C: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B108D: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B125B: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xB85CC3F: cv::JpegDecoder::JpegDecoder() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB844F8C: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,238 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB844FA7: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,239 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB84505F: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,240 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB845117: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,241 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB8451CF: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,242 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB845287: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,243 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB84533C: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,244 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB8453E2: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,245 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB845488: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,246 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB84552E: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,247 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB8455D4: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,248 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB84567A: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 28 bytes in 1 blocks are possibly lost in loss record 1,249 of 2,863 ==5510== at 0x4C28FAC: malloc (vg_replace_malloc.c:236) ==5510== by 0xC017B24: cv::fastMalloc(unsigned long) (in /usr/lib/libcxcore.so.2.1.0) ==5510== by 0xB845720: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== by 0x312F30313D657460: ??? ==5510== by 0x706D666600210021: ??? ==5510== by 0x73726F6C6F636764: ??? ==5510== ==5510== 29 bytes in 1 blocks are possibly lost in loss record 1,255 of 2,863 ==5510== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261) ==5510== by 0xC4B0E6C: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B108D: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B125B: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xB86327D: cv::SunRasterDecoder::SunRasterDecoder() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB8450FC: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== ==5510== 33 bytes in 1 blocks are possibly lost in loss record 1,504 of 2,863 ==5510== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261) ==5510== by 0xC4B0E6C: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B108D: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B125B: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xB85FACF: cv::PngDecoder::PngDecoder() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB845516: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== ==5510== 37 bytes in 1 blocks are possibly lost in loss record 1,516 of 2,863 ==5510== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261) ==5510== by 0xC4B0E6C: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B1BFA: std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B1CDF: std::string::reserve(unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B223E: std::string::append(std::string const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xB85DE3F: cv::Jpeg2KDecoder::Jpeg2KDecoder() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB845662: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== ==5510== 48 bytes in 1 blocks are possibly lost in loss record 1,757 of 2,863 ==5510== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261) ==5510== by 0xC4B0E6C: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B108D: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B125B: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xB85EE6F: cv::Jpeg2KEncoder::Jpeg2KEncoder() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB845708: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== ==5510== 50 bytes in 1 blocks are possibly lost in loss record 1,765 of 2,863 ==5510== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261) ==5510== by 0xC4B0E6C: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B108D: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B125B: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xB8642BF: cv::TiffEncoder::TiffEncoder() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB845470: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== ==5510== 53 bytes in 1 blocks are possibly lost in loss record 1,771 of 2,863 ==5510== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261) ==5510== by 0xC4B0E6C: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B108D: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B125B: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xB85B7CF: cv::BmpEncoder::BmpEncoder() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB844ED4: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== ==5510== 54 bytes in 1 blocks are possibly lost in loss record 1,774 of 2,863 ==5510== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261) ==5510== by 0xC4B0E6C: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B108D: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B125B: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xB86337F: cv::SunRasterEncoder::SunRasterEncoder() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB8451B4: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== ==5510== 56 bytes in 1 blocks are possibly lost in loss record 1,806 of 2,863 ==5510== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261) ==5510== by 0xC4B0E6C: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B108D: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B125B: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xB85D3AF: cv::JpegEncoder::JpegEncoder() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB845044: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== ==5510== 64 bytes in 1 blocks are possibly lost in loss record 1,918 of 2,863 ==5510== at 0x4C28B42: operator new(unsigned long) (vg_replace_malloc.c:261) ==5510== by 0xC4B0E6C: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B108D: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xC4B125B: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.14) ==5510== by 0xB85FFCF: cv::PngEncoder::PngEncoder() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB8455BC: cv::ImageCodecInitializer::ImageCodecInitializer() (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB865215: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0xB83C26A: ??? (in /usr/lib/libhighgui.so.2.1.0) ==5510== by 0x7FF000367: ??? ==5510== by 0x75616C2D7473672E: ??? ==5510== by 0x30312E302D68636D: ??? ==5510== by 0x637273326C3475FF: ??? ==5510== by 0x6F656469760020FF: ??? ==5510== by 0x6300210065746171: ??? ==5510== by 0x65746C6966737060: ??? ==5510== by 0x763D656D616E0071: ??? ==5510== by 0x7370616300737065: ??? ==5510== by 0x2F6F65646976223C: ??? ==5510== by 0x75792D7761722D77: ??? ==5510== by 0x72656D6172662C75: ??? ==5510== are these related to the new static variables and so safe to ignore? (monitoring ram usage show no memory increase over the time) Nicola
Created attachment 193880 [details] [review] motioncells: fixed valgrind warning fixed this valgrind warning: ==1608== Conditional jump or move depends on uninitialised value(s) ==1608== at 0xB087933: MotionCells::performDetectionMotionCells(_IplImage*, double, double, int, int, long, bool, bool, int, motionmaskcoordrect*, int, motioncellidx*, cellscolor, int, motioncellidx*, long, char*, bool, int) (MotionCells.cpp:328) ==1608== by 0xB08430B: perform_detection_motion_cells (motioncells_wrapper.cpp:90) ==1608== by 0xB0838CF: ??? (gstmotioncells.c:952) ==1608== by 0x4E88DB1: gst_pad_chain_data_unchecked (gstpad.c:4247) ==1608== by 0x4E8962A: gst_pad_push_data (gstpad.c:4479) ==1608== by 0x4E8C42C: gst_pad_push (gstpad.c:4704) ==1608== by 0x8B613C5: gst_base_transform_chain (gstbasetransform.c:2458) ==1608== by 0x4E88DB1: gst_pad_chain_data_unchecked (gstpad.c:4247) ==1608== by 0x4E8962A: gst_pad_push_data (gstpad.c:4479) ==1608== by 0x4E8C42C: gst_pad_push (gstpad.c:4704) ==1608== by 0x8B613C5: gst_base_transform_chain (gstbasetransform.c:2458) ==1608== by 0x4E88DB1: gst_pad_chain_data_unchecked (gstpad.c:4247) ==1608== by 0x4E8962A: gst_pad_push_data (gstpad.c:4479) ==1608== by 0x4E8C42C: gst_pad_push (gstpad.c:4704) ==1608== by 0xA9D662D: gst_video_rate_chain (gstvideorate.c:863) ==1608== by 0x4E8C53B: gst_pad_push (gstpad.c:4684) ==1608== by 0x8B59697: gst_base_src_loop (gstbasesrc.c:2516) ==1608== by 0x4EB2BEF: gst_task_func (gsttask.c:318) ==1608== by 0x55D7B15: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.2800.6) ==1608== by 0x55D53E3: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.2800.6) the valgrind warnings reported in my previous comment seems disappeared after a new sync with the latest -bad and a recompilation so probably I had some local change that caused that. Now motioncells seems completly valgrind friendly. I tested with this pipeline: gst-launch -m -t v4l2src ! videorate ! capsfilter caps="video/x-raw-yuv,framerate=10/1,width=320,heigth=240" ! ffmpegcolorspace ! motioncells sensitivity=0.8 postnomotion=10 ! ffmpegcolorspace ! xvimagesink sync=false Nicola
Created attachment 193886 [details] [review] added an additional cvReleaseImage this patch is just a security measure and can't do nothing bad
Hi Stefan, about your comment 9 I would like to finalize the patch, I think the mutex is not more needed here: g_mutex_lock (filter->propset_mutex); filter->id = motion_cells_init (); g_mutex_unlock (filter->propset_mutex); but it is still useful is gst_motion_cells_chain and in gst_motion_cells_set_property to make dynamic property change without set the element in READY state, what do you think about? Nicola
We (Stefan and I ) talked about this. And in set property we need to use GST_OBJECT_LOCK and we can remove mutex from chain , because it's protected with GST_OBJECT_LOCK. I tested it and it works fine. But I was very busy and I didn't have make patch for this. Robert
Created attachment 193898 [details] [review] replace propset_mutex with GST_OBJECT_LOCK/UNLOCK
Comment on attachment 193898 [details] [review] replace propset_mutex with GST_OBJECT_LOCK/UNLOCK this patch need some more work: GST_OBJECT_LOCK (filter) make PROP_GRID_X/PROP_GRID_Y doesn't work anymore since these properties try to change filter state and the filter is locked, I would like to change these setter this way: case PROP_GRID_X: //ret = gst_element_get_state (GST_ELEMENT (filter), // &filter->state, NULL, 250 * GST_NSECOND); filter->gridx = g_value_get_int (value); if (filter->prevgridx != filter->gridx) // && ret == GST_STATE_CHANGE_SUCCESS // && filter->state == GST_STATE_PLAYING) { { filter->changed_gridx = true; } filter->prevgridx = filter->gridx; break; what do you think about?
I did the patch changing the setter for PROP_GRID_X/Y and PROP_DATE avoiding to change pipeline state and it seems to work. Robert I'll post this patch if you agree to remove the state_change since from the prop setters: the dynamic change should be protected using: GST_OBJECT_LOCK (filter) Nicola
it isn't good because if you change grid x/y before pipeline in PLAYING state it caused changed_datafile event and datafile index will be 1 not 0 example: first_datafile-1.vamc not first_datafile-0.vamc Robert
Sorry Robert, I didn't tested the datafile thing, I looked at the code and we can do something like this then: case PROP_GRID_X: //ret = gst_element_get_state (GST_ELEMENT (filter), // &filter->state, NULL, 250 * GST_NSECOND); filter->gridx = g_value_get_int (value); if (filter->prevgridx != filter->gridx && !filter->firstframe) // && ret == GST_STATE_CHANGE_SUCCESS // && filter->state == GST_STATE_PLAYING) { { filter->changed_gridx = true; } filter->prevgridx = filter->gridx; break; I think this is however better than query the pipeline state since an application could change the state, there is already a firstframe variable and we could use this to do the same check, what do you think about? Nicola
Created attachment 194013 [details] [review] Move the cvReleaseImage for the previous frame just before storing the current frame as previous frame, only for readaility of the code
Created attachment 194014 [details] [review] replace propset_mutex with GST_OBJECT_LOCK/UNLOCK This fix the case described by Robert. Use the firstframe property ensure a correct behaviour even if an application put the element in NULL state. Tested properties change in a running pipeline and work fine.
Hi Nicola, I checked your patches and it seems good :) I will test these patch this evening and I found a bug in motioncells and fixed it, but I haven't time send the patch yet. But I will make it in next days. Thanks. Robert
Comment on attachment 194014 [details] [review] replace propset_mutex with GST_OBJECT_LOCK/UNLOCK we only run gst-indent on c files. It would be nice to get a patch that only does the "replace propset_mutex with GST_OBJECT_LOCK". if you like to reformat the source please split that into a separate patch.
Created attachment 194861 [details] [review] replace propset_mutex with GST_OBJECT_LOCK/UNLOCK
Created attachment 194863 [details] [review] replace propset_mutex with GST_OBJECT_LOCK/UNLOCK the previous patch was wrong, this one is the right one, please review
it seems good, I have already this patch too :) But Sorry guys, I'm very busy recently. I debug a bug with datafiles, I will try my test program on this version and if it will works same like my version I will share my test program with you and pls help me in debug. I can try this begin of next week. Robert
Created attachment 195169 [details] motion cells dynamic mt test program test the latest patch with this test program
Nicola and Stefan, pls test the latest Nicola patch with this test app. It shows that chain isn't protect with GST_OBJECT_LOCK and we need do that with manual. Thanks, Robert
Comment on attachment 195169 [details] motion cells dynamic mt test program In this test you are calling setproperty from a thread != the main thread. Would you still get the error, if you run setProperty from a timeout-handler (g_timeout_add).
yes , it's right, but we would like simulate that we call setProperty from other external threads like gstreamer-java Robert
Created attachment 195191 [details] [review] another try ... Robert, I did minimal testing with the datafile things, please let me know if this patch break something, Nicola
Nicola, your patch isn't the safest solution. we need to use own mutex that it's protect set/get property, chain and other functions what uses resources. I'm working on my latest patch now, I will post it soon. Robert
Hi Guys, Finally I can attach my latest patch. It contains follow modifications: - add motion at night and on noisy frames - check light change and skip detect it as motion - add motion duration property - add EOS event receiver function - replace g_mutex with g_static_rec_mutex (this is reentrant mutex) motioncells element is thread safe now. Pls test this patch and I'm waiting for your advice. Thanks, Robert
Created attachment 196162 [details] [review] some important and useful fixes
Robert I did some check with valgrind and looking at the cpu usage and I found no regression, great! The patch didn't applyed cleanly for me but maybe I'm not using the current -bad. However motioncells seems less sensible to the motion now, for example this pipeline doesn't give motion events anymore: gst-launch-0.10 -v -m -t videotestsrc pattern=18 ! videorate ! videoscale ! video/x-raw-yuv,width=320,height=240,framerate=5/1 ! ffmpegcolorspace ! motioncells ! ffmpegcolorspace ! xvimagesink I have to set sensitivity=1.0 to have some motions (or increase the framerate and sensitivity). I think it works with the previous version, Nicola
Comment on attachment 196162 [details] [review] some important and useful fixes This patch does not apply for me, also the description could be a bit better. Please update it and I will push it.
Hi Stefan, I'll have time on this weekend and I can do that. It's okay for you ? Robert
Hi guys, I made a patch, I think it contains some useful basic imageprocessing functions, what anybody can use who would like make some useful opencv gstreamer element. I have some own gstreamer opencv elements and I use these functions often. Pls check this patch. Thanks your time. Robert
Created attachment 216698 [details] [review] add imageprocessingfunctions collection
Created attachment 216801 [details] [review] facedetect: avoid to post a bus message for each frame if no faces are detected This patch does not change the api for facedetect (so existing apps should continue to work with no modifications) but, instead of post a bus message for each frame if no faces are detected, bus messages are posted only when a face is detected or no face is detected and a face was detected in the previous frame. So an app is notified when we don't see the face anymore (http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?h=0.10&id=fbcee587f456dfca7c8dd2fbf163d12804ffd81c) but the bus messages are reduced
Created attachment 216873 [details] [review] new property to control bus update messages this patch must be applied after the previous one and add a new property and an enum to control bus message updates as asked by Stefan
Created attachment 216968 [details] [review] added a new value to bus updates enum This patch should be applied after the previous ones. With this an app can choose to have bus messages updates: 1) on each frame, actual behaviour 2) on change, when a face is detected or no face is detected (only one time) 3) on face, when a face is detected, this was the previous behaviour 4) no update at all
Created attachment 223151 [details] [review] New property to control bus update messages this patch is against 1.0 and contains the latest 3 facedetect patches posted for 0.10
Created attachment 223152 [details] [review] New property to control bus update messages patch for 0.10 216873 216968 and 216801 as only one patch, please review
Comment on attachment 223151 [details] [review] New property to control bus update messages commit e481ecbf2229468873296b350c1ff5b3ea28a71f Author: Nicola Murino <nicola.murino@gmail.com> Date: Sat Sep 1 20:46:43 2012 +0200 facedetect: new property to control bus messages updates https://bugzilla.gnome.org/show_bug.cgi?id=655622
What's left to be done here? What's the point of the unreviewed imageprocessing patch that adds API that is not used anywhere?
Thanks for all the patches. Quite a few of them have been merged over the years, but it looks like the others have bitrotten and there was no interest in updating them, so let's close this bug. Please open new bugs with updated patches for recent git if needed, thanks!