summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorOle André Vadla Ravnås <oravnas@cisco.com>2010-06-11 18:04:58 +0200
committerOle André Vadla Ravnås <oravnas@cisco.com>2010-10-28 17:08:41 +0200
commita7a04fe601b2d9010bdb1b3beae1ed3ae3567748 (patch)
tree8454f08b0dd8fe21e65f1e90b870ad5574d2dabd /sys
parent35ed06fba2992a9da71777addeff3fac78c76cb8 (diff)
winks: remove JPEG validation hack
This should clearly not be done in a video source.
Diffstat (limited to 'sys')
-rw-r--r--sys/winks/gstksvideodevice.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/sys/winks/gstksvideodevice.c b/sys/winks/gstksvideodevice.c
index 18f23839d..bc7de0fac 100644
--- a/sys/winks/gstksvideodevice.c
+++ b/sys/winks/gstksvideodevice.c
@@ -83,7 +83,6 @@ struct _GstKsVideoDevicePrivate
guint fps_n;
guint fps_d;
guint8 *rgb_swap_buf;
- gboolean is_mjpeg;
HANDLE pin_handle;
@@ -797,8 +796,6 @@ gst_ks_video_device_set_caps (GstKsVideoDevice * self, GstCaps * caps)
else
priv->rgb_swap_buf = NULL;
- priv->is_mjpeg = gst_structure_has_name (s, "image/jpeg");
-
priv->pin_handle = pin_handle;
priv->cur_fixed_caps = gst_caps_copy (caps);
@@ -994,54 +991,6 @@ error_ioctl:
}
}
-static void
-gst_ks_video_device_correct_or_drop_frame (GstKsVideoDevice * self,
- GstBuffer ** frame_buf)
-{
- GstKsVideoDevicePrivate *priv = GST_KS_VIDEO_DEVICE_GET_PRIVATE (self);
- gboolean valid = FALSE;
- guint padding = 0;
- guint8 *data;
- guint data_size;
-
- if (!priv->is_mjpeg)
- return;
-
- /*
- * Workaround for cameras/drivers that intermittently provide us
- * with incomplete or corrupted MJPEG frames.
- *
- * Happens with for instance Microsoft LifeCam VX-7000.
- */
-
- data = GST_BUFFER_DATA (*frame_buf);
- data_size = GST_BUFFER_SIZE (*frame_buf);
-
- if (data_size > MJPEG_MAX_PADDING) {
- /* JFIF SOI marker */
- if (data[0] == 0xff && data[1] == 0xd8) {
- guint8 *p = data + data_size - 2;
-
- /* JFIF EOI marker (but skip any padding) */
- while (padding < MJPEG_MAX_PADDING - 1 - 2 && !valid) {
- if (p[0] == 0xff && p[1] == 0xd9) {
- valid = TRUE;
- } else {
- padding++;
- p--;
- }
- }
- }
- }
-
- if (valid) {
- GST_BUFFER_SIZE (*frame_buf) -= padding;
- } else {
- gst_buffer_unref (*frame_buf);
- *frame_buf = NULL;
- }
-}
-
GstFlowReturn
gst_ks_video_device_read_frame (GstKsVideoDevice * self, GstBuffer ** buf,
GstClockTime * presentation_time, gulong * error_code, gchar ** error_str)
@@ -1152,9 +1101,6 @@ gst_ks_video_device_read_frame (GstKsVideoDevice * self, GstBuffer ** buf,
priv->last_timestamp = timestamp;
}
}
-
- if (*buf != NULL)
- gst_ks_video_device_correct_or_drop_frame (self, buf);
} else if (GetLastError () != ERROR_OPERATION_ABORTED) {
goto error_get_result;
}