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.
This commit is contained in:
parent
2acdb01bc9
commit
892d8d515f
@ -26,72 +26,6 @@
|
|||||||
#include "gstopencvutils.h"
|
#include "gstopencvutils.h"
|
||||||
#include <opencv2/core/types_c.h>
|
#include <opencv2/core/types_c.h>
|
||||||
|
|
||||||
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
|
gboolean
|
||||||
gst_opencv_parse_iplimage_params_from_caps (GstCaps * caps, gint * width,
|
gst_opencv_parse_iplimage_params_from_caps (GstCaps * caps, gint * width,
|
||||||
|
@ -31,15 +31,10 @@
|
|||||||
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
gboolean
|
|
||||||
gst_opencv_get_ipldepth (gint depth, gint bpp, gint * ipldepth);
|
|
||||||
|
|
||||||
gboolean gst_opencv_parse_iplimage_params_from_caps
|
gboolean gst_opencv_parse_iplimage_params_from_caps
|
||||||
(GstCaps * caps, gint * width, gint * height, gint * depth,
|
(GstCaps * caps, gint * width, gint * height, gint * depth,
|
||||||
gint * channels, GError ** err);
|
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);
|
GstCaps * gst_opencv_caps_from_cv_image_type (int cv_type);
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user