diff --git a/ChangeLog b/ChangeLog index 008d5dcecb..7fa009aa40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-01-14 Ronald S. Bultje + + * sys/v4l/gstv4lsrc.c: (gst_v4lsrc_getcaps): + Set FPS correctly, even for webcams and the like. + * sys/v4l/v4l_calls.c: (gst_v4l_set_chan_norm): + Don error on setting while capturing. + 2005-01-14 Stephane LOEUILLET * ext/dv/gstdvdec.c: diff --git a/sys/v4l/gstv4lsrc.c b/sys/v4l/gstv4lsrc.c index 1c0eeb244a..30ba1992f2 100644 --- a/sys/v4l/gstv4lsrc.c +++ b/sys/v4l/gstv4lsrc.c @@ -826,21 +826,17 @@ gst_v4lsrc_getcaps (GstPad * pad) } fps = gst_v4lsrc_get_fps (v4lsrc); - /* - FIXME: if we choose a fixed one because we didn't probe, fixated caps don't - work. So comment this out for now. - if (!v4lsrc->fps_list) - fps = gst_v4lsrc_get_fps (v4lsrc); - */ - list = gst_caps_new_empty (); for (item = v4lsrc->colourspaces; item != NULL; item = item->next) { GstCaps *one; one = gst_v4lsrc_palette_to_caps (GPOINTER_TO_INT (item->data)); - if (!one) + if (!one) { GST_WARNING_OBJECT (v4lsrc, "Palette %d gave no caps\n", GPOINTER_TO_INT (item->data)); + continue; + } + GST_DEBUG_OBJECT (v4lsrc, "Device reports w: %d-%d, h: %d-%d, fps: %f for palette %d", vcap->minwidth, vcap->maxwidth, vcap->minheight, vcap->maxheight, fps, @@ -859,20 +855,19 @@ gst_v4lsrc_getcaps (GstPad * pad) gst_caps_set_simple (one, "height", G_TYPE_INT, vcap->minheight, NULL); } - if (v4lsrc->fps_list) { - GstStructure *structure = gst_caps_get_structure (one, 0); + if (v4lsrc->autoprobe_fps) { + if (v4lsrc->fps_list) { + GstStructure *structure = gst_caps_get_structure (one, 0); - gst_structure_set_value (structure, "framerate", v4lsrc->fps_list); + gst_structure_set_value (structure, "framerate", v4lsrc->fps_list); + } else { + gst_caps_set_simple (one, "framerate", G_TYPE_DOUBLE, fps, NULL); + } } else { - gst_caps_set_simple (one, "framerate", G_TYPE_DOUBLE, fps, NULL); + gst_caps_set_simple (one, "framerate", GST_TYPE_DOUBLE_RANGE, + (gdouble) 1.0, (gdouble) 100.0, NULL); } -/* see higher up why we comment this -else { - GstStructure *structure = gst_caps_get_structure (one, 0); - gst_structure_set (structure, "framerate", G_TYPE_DOUBLE, fps, NULL); - } -*/ GST_DEBUG_OBJECT (v4lsrc, "caps: %" GST_PTR_FORMAT, one); gst_caps_append (list, one); } diff --git a/sys/v4l/v4l_calls.c b/sys/v4l/v4l_calls.c index 5d2fb9aca6..6d28add707 100644 --- a/sys/v4l/v4l_calls.c +++ b/sys/v4l/v4l_calls.c @@ -395,7 +395,7 @@ gst_v4l_set_chan_norm (GstV4lElement * v4lelement, gint channel, gint norm) GST_DEBUG_OBJECT (v4lelement, "setting channel = %d, norm = %d (%s)", channel, norm, norm_name[norm]); GST_V4L_CHECK_OPEN (v4lelement); - GST_V4L_CHECK_NOT_ACTIVE (v4lelement); + //GST_V4L_CHECK_NOT_ACTIVE (v4lelement); v4lelement->vchan.channel = channel; v4lelement->vchan.norm = norm;