diff --git a/ChangeLog b/ChangeLog index 14f46bdd30..ad676e46e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-10-10 Zaheer Abbas Merali + + * sys/v4l/gstv4lsrc.c: (gst_v4lsrc_src_link), (gst_v4lsrc_getcaps): + Fix for webcams that support only specific width or height + 2004-10-09 Tim-Philipp Müller Reviewed by: Ronald S. Bultje diff --git a/sys/v4l/gstv4lsrc.c b/sys/v4l/gstv4lsrc.c index cf9100fde6..51d787a1d6 100644 --- a/sys/v4l/gstv4lsrc.c +++ b/sys/v4l/gstv4lsrc.c @@ -640,7 +640,7 @@ gst_v4lsrc_src_link (GstPad * pad, const GstCaps * vscapslist) vwin->flags |= fps_index << 16; if (!gst_v4l_set_window_properties (GST_V4LELEMENT (v4lsrc))) { GST_ELEMENT_ERROR (v4lsrc, RESOURCE, SETTINGS, (NULL), - ("Could not set framerate of %d fps", fps)); + ("Could not set framerate of %f fps", fps)); } } switch (fourcc) { @@ -823,9 +823,18 @@ gst_v4lsrc_getcaps (GstPad * pad) vcap->minwidth, vcap->maxwidth, vcap->minheight, vcap->maxheight, fps, GPOINTER_TO_INT (item->data)); - gst_caps_set_simple (one, "width", GST_TYPE_INT_RANGE, vcap->minwidth, - vcap->maxwidth, "height", GST_TYPE_INT_RANGE, vcap->minheight, - vcap->maxheight, NULL); + if (vcap->minwidth < vcap->maxwidth) { + gst_caps_set_simple (one, "width", GST_TYPE_INT_RANGE, vcap->minwidth, + NULL); + } else { + gst_caps_set_simple (one, "width", G_TYPE_INT, vcap->minwidth, NULL); + } + if (vcap->minheight < vcap->maxheight) { + gst_caps_set_simple (one, "height", GST_TYPE_INT_RANGE, vcap->minheight, + vcap->maxheight, NULL); + } else { + gst_caps_set_simple (one, "height", G_TYPE_INT, vcap->minheight, NULL); + } if (fps_list) { GstStructure *structure = gst_caps_get_structure (one, 0);