summaryrefslogtreecommitdiffstats
path: root/sys/winks/gstksvideodevice.c
diff options
context:
space:
mode:
authorOle André Vadla Ravnås <ole.andre.ravnas@tandberg.com>2008-08-27 21:33:07 +0000
committerOle André Vadla Ravnås <ole.andre.ravnas@tandberg.com>2008-08-27 21:33:07 +0000
commit50a20db7ed4b04725afd49a73ea9f0c1a61194e1 (patch)
tree69b2491a6ea60494d3434ff80e55ed3ee123df0a /sys/winks/gstksvideodevice.c
parent001628d3414014e3f361cb1931ba3e8bd7854235 (diff)
downloadgst-plugins-bad-50a20db7ed4b04725afd49a73ea9f0c1a61194e1.tar.gz
gst-plugins-bad-50a20db7ed4b04725afd49a73ea9f0c1a61194e1.tar.bz2
gst-plugins-bad-50a20db7ed4b04725afd49a73ea9f0c1a61194e1.zip
sys/winks/gstksvideodevice.c (gst_ks_video_device_class_init, gst_ks_video_device_set_state):
Original commit message from CVS: * sys/winks/gstksvideodevice.c (gst_ks_video_device_class_init, gst_ks_video_device_set_state): Don't set the pin state to KSSTATE_RUN from the streaming thread. Skip KSSTATE_ACQUIRE when changing pin state downwards. Be nice and specify G_PARAM_STATIC_STRINGS. Remove unused finalize method. * sys/winks/gstksvideosrc.c (DEFAULT_ENABLE_QUIRKS, PROP_ENABLE_QUIRKS, enable_quirks, gst_ks_video_src_class_init, gst_ks_video_src_init, gst_ks_video_src_finalize, gst_ks_video_src_get_property, gst_ks_video_src_set_property, gst_ks_video_src_reset, gst_ks_video_src_apply_driver_quirks, gst_ks_video_src_change_state, gst_ks_video_src_set_caps): First driver quirk: work around Logitech's hostile driver software to improve stability and performance. See comments for details. Provide a property to disable driver quirks (enabled by default). Be nice and specify G_PARAM_STATIC_STRINGS. Remove unused dispose method. Tweak include order.
Diffstat (limited to 'sys/winks/gstksvideodevice.c')
-rw-r--r--sys/winks/gstksvideodevice.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/sys/winks/gstksvideodevice.c b/sys/winks/gstksvideodevice.c
index 8b385e7e..cb094831 100644
--- a/sys/winks/gstksvideodevice.c
+++ b/sys/winks/gstksvideodevice.c
@@ -88,7 +88,6 @@ typedef struct
GstKsVideoDevicePrivate))
static void gst_ks_video_device_dispose (GObject * object);
-static void gst_ks_video_device_finalize (GObject * object);
static void gst_ks_video_device_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static void gst_ks_video_device_set_property (GObject * object, guint prop_id,
@@ -111,19 +110,18 @@ gst_ks_video_device_class_init (GstKsVideoDeviceClass * klass)
g_type_class_add_private (klass, sizeof (GstKsVideoDevicePrivate));
gobject_class->dispose = gst_ks_video_device_dispose;
- gobject_class->finalize = gst_ks_video_device_finalize;
gobject_class->get_property = gst_ks_video_device_get_property;
gobject_class->set_property = gst_ks_video_device_set_property;
g_object_class_install_property (gobject_class, PROP_CLOCK,
g_param_spec_object ("clock", "Clock to use",
"Clock to use", GST_TYPE_KS_CLOCK,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_DEVICE_PATH,
g_param_spec_string ("device-path", "Device Path",
"The device path", DEFAULT_DEVICE_PATH,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
}
static void
@@ -154,14 +152,6 @@ gst_ks_video_device_dispose (GObject * object)
}
static void
-gst_ks_video_device_finalize (GObject * object)
-{
- GstKsVideoDevice *self = GST_KS_VIDEO_DEVICE (object);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
gst_ks_video_device_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
@@ -775,6 +765,10 @@ gst_ks_video_device_set_state (GstKsVideoDevice * self, KSSTATE state)
while (priv->state != state) {
KSSTATE next_state = priv->state + addend;
+ /* Skip the ACQUIRE step on the way down like DirectShow does */
+ if (addend < 0 && next_state == KSSTATE_ACQUIRE)
+ next_state = KSSTATE_STOP;
+
GST_DEBUG ("Changing pin state from %s to %s",
ks_state_to_string (priv->state), ks_state_to_string (next_state));
@@ -891,15 +885,6 @@ gst_ks_video_device_read_frame (GstKsVideoDevice * self, guint8 * buf,
g_assert (priv->cur_media_type != NULL);
- /* Set the state if needed */
- if (G_UNLIKELY (priv->state != KSSTATE_RUN)) {
- if (priv->clock != NULL)
- gst_ks_clock_start (priv->clock);
-
- if (!gst_ks_video_device_set_state (self, KSSTATE_RUN))
- goto error_set_state;
- }
-
/* First time we're called, submit the requests. */
if (G_UNLIKELY (!priv->requests_submitted)) {
priv->requests_submitted = TRUE;
@@ -1001,13 +986,6 @@ gst_ks_video_device_read_frame (GstKsVideoDevice * self, guint8 * buf,
return GST_FLOW_OK;
/* ERRORS */
-error_set_state:
- {
- gst_ks_video_device_parse_win32_error ("gst_ks_video_device_set_state",
- GetLastError (), error_code, error_str);
-
- return GST_FLOW_ERROR;
- }
error_request_failed:
{
return GST_FLOW_ERROR;