From 892d8d515f060cb9124670c86c444ee077eaf4bc Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Sat, 12 Dec 2015 19:31:55 +0000 Subject: [PATCH] opencv: remove unused functions in gstopencvutils Since commit 45ca8876b2f5267f7edb842b6d56d7a6c271ccb3 nobody is using gst_opencv_get_ipl_depth_and_channels() or gst_opencv_parse_iplimage_params_from_structure(). Remove this dead code. --- ext/opencv/gstopencvutils.cpp | 66 ----------------------------------- ext/opencv/gstopencvutils.h | 5 --- 2 files changed, 71 deletions(-) diff --git a/ext/opencv/gstopencvutils.cpp b/ext/opencv/gstopencvutils.cpp index f146b5ad6d..da6eea9a61 100644 --- a/ext/opencv/gstopencvutils.cpp +++ b/ext/opencv/gstopencvutils.cpp @@ -26,72 +26,6 @@ #include "gstopencvutils.h" #include -static gboolean -gst_opencv_get_ipl_depth_and_channels (GstStructure * structure, - gint * ipldepth, gint * channels, GError ** err) -{ - GstVideoFormat format = GST_VIDEO_FORMAT_UNKNOWN; - const GstVideoFormatInfo *info; - gint depth = 0; - guint i; - const gchar *s; - - if (gst_structure_has_name (structure, "video/x-raw")) { - if (!(s = gst_structure_get_string (structure, "format"))) - return FALSE; - format = gst_video_format_from_string (s); - if (format == GST_VIDEO_FORMAT_UNKNOWN) - return FALSE; - } - - info = gst_video_format_get_info (format); - - if (GST_VIDEO_FORMAT_INFO_IS_RGB (info)) - *channels = 3; - else if (GST_VIDEO_FORMAT_INFO_IS_GRAY (info)) - *channels = 1; - else { - g_set_error (err, GST_CORE_ERROR, GST_CORE_ERROR_NEGOTIATION, - "Unsupported structure %s", gst_structure_get_name (structure)); - return FALSE; - } - - for (i = 0; i < GST_VIDEO_FORMAT_INFO_N_COMPONENTS (info); i++) - depth += GST_VIDEO_FORMAT_INFO_DEPTH (info, i); - - if (depth / *channels == 8) { - /* TODO signdness? */ - *ipldepth = IPL_DEPTH_8U; - } else if (depth / *channels == 16) { - *ipldepth = IPL_DEPTH_16U; - } else { - g_set_error (err, GST_CORE_ERROR, GST_CORE_ERROR_NEGOTIATION, - "Unsupported depth/channels %d/%d", depth, *channels); - return FALSE; - } - - return TRUE; -} - -gboolean -gst_opencv_parse_iplimage_params_from_structure (GstStructure * structure, - gint * width, gint * height, gint * ipldepth, gint * channels, - GError ** err) -{ - if (!gst_opencv_get_ipl_depth_and_channels (structure, ipldepth, channels, - err)) { - return FALSE; - } - - if (!gst_structure_get_int (structure, "width", width) || - !gst_structure_get_int (structure, "height", height)) { - g_set_error (err, GST_CORE_ERROR, GST_CORE_ERROR_NEGOTIATION, - "No width/height in caps"); - return FALSE; - } - - return TRUE; -} gboolean gst_opencv_parse_iplimage_params_from_caps (GstCaps * caps, gint * width, diff --git a/ext/opencv/gstopencvutils.h b/ext/opencv/gstopencvutils.h index e248dc8b44..13dfd9e078 100644 --- a/ext/opencv/gstopencvutils.h +++ b/ext/opencv/gstopencvutils.h @@ -31,15 +31,10 @@ G_BEGIN_DECLS -gboolean -gst_opencv_get_ipldepth (gint depth, gint bpp, gint * ipldepth); gboolean gst_opencv_parse_iplimage_params_from_caps (GstCaps * caps, gint * width, gint * height, gint * depth, gint * channels, GError ** err); -gboolean gst_opencv_parse_iplimage_params_from_structure - (GstStructure * structure, gint * width, gint * height, gint * depth, - gint * channels, GError ** err); GstCaps * gst_opencv_caps_from_cv_image_type (int cv_type); G_END_DECLS