mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
sys/v4l/gstv4lsrc.c: Fix for webcams that support only specific width or height
Original commit message from CVS: 2004-10-10 Zaheer Abbas Merali <zaheerabbas at merali dot org> * sys/v4l/gstv4lsrc.c: (gst_v4lsrc_src_link), (gst_v4lsrc_getcaps): Fix for webcams that support only specific width or height
This commit is contained in:
parent
e58bfc2d84
commit
1b27bea7ad
2 changed files with 18 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-10-10 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
||||
|
||||
* 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 <t.i.m@zen.co.uk>
|
||||
|
||||
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue