summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2016-12-01 21:13:23 -0500
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2016-12-01 21:15:28 -0500
commit831735fc1cec8895ac36d58af14bda4c97a8cade (patch)
treea23b8270164d38a4e5906f9b3d79370ecc64a466
parentf7b039e7df3bdcd950c65a74284f3735096d0ba1 (diff)
downloadgstreamer-plugins-bad-831735fc1cec8895ac36d58af14bda4c97a8cade.tar.gz
opencv: Remove uneeded buffer writability check
When set to in_place, the BaseTransform class will guaranty that buffers passed to transform_ip() function are writable. https://bugzilla.gnome.org/show_bug.cgi?id=775378
-rw-r--r--ext/opencv/gstfacedetect.cpp11
-rw-r--r--ext/opencv/gstmotioncells.cpp1
2 files changed, 1 insertions, 11 deletions
diff --git a/ext/opencv/gstfacedetect.cpp b/ext/opencv/gstfacedetect.cpp
index 3c82ce0df..503b9e70f 100644
--- a/ext/opencv/gstfacedetect.cpp
+++ b/ext/opencv/gstfacedetect.cpp
@@ -590,19 +590,10 @@ gst_face_detect_transform_ip (GstOpencvVideoFilter * base, GstBuffer * buf,
vector < Rect > mouth;
vector < Rect > nose;
vector < Rect > eyes;
- gboolean do_display = FALSE;
gboolean post_msg = FALSE;
Mat mtxOrg (cv::cvarrToMat (img));
- if (filter->display) {
- if (gst_buffer_is_writable (buf)) {
- do_display = TRUE;
- } else {
- GST_LOG_OBJECT (filter, "Buffer is not writable, not drawing faces.");
- }
- }
-
cvCvtColor (img, filter->cvGray, CV_RGB2GRAY);
gst_face_detect_run_detector (filter, filter->cvFaceDetect,
@@ -719,7 +710,7 @@ gst_face_detect_transform_ip (GstOpencvVideoFilter * base, GstBuffer * buf,
s = NULL;
}
- if (do_display) {
+ if (filter->display) {
CvPoint center;
Size axes;
gdouble w, h;
diff --git a/ext/opencv/gstmotioncells.cpp b/ext/opencv/gstmotioncells.cpp
index 33f314a64..0aedbd8ba 100644
--- a/ext/opencv/gstmotioncells.cpp
+++ b/ext/opencv/gstmotioncells.cpp
@@ -857,7 +857,6 @@ gst_motion_cells_transform_ip (GstOpencvVideoFilter * base, GstBuffer * buf,
cellscolor motioncellscolor;
motioncellidx *motioncellsidx;
- buf = gst_buffer_make_writable (buf);
if (filter->firstframe) {
setPrevFrame (img, filter->id);
filter->firstframe = FALSE;