diff options
author | Edgard Lima <edgard.lima@indt.org.br> | 2006-08-24 00:40:07 +0000 |
---|---|---|
committer | Edgard Lima <edgard.lima@indt.org.br> | 2006-08-24 00:40:07 +0000 |
commit | d7ef60b0c4301178a164a3f5b4a82841a921ea65 (patch) | |
tree | eb2a8b64ee26bfa93e65463cfac84a71483b5250 /sys/v4l2/gstv4l2src.c | |
parent | e91b76790cb2c23b09448d1bb4d6adbe54716add (diff) |
Fix set_caps to set width and height to the values the driver is really working with.
Original commit message from CVS:
Fix set_caps to set width and height to the values the driver is really working with.
Diffstat (limited to 'sys/v4l2/gstv4l2src.c')
-rw-r--r-- | sys/v4l2/gstv4l2src.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index bf8a2dd4..d5cb1940 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -807,12 +807,15 @@ gst_v4l2src_set_caps (GstBaseSrc * src, GstCaps * caps) GST_DEBUG_OBJECT (v4l2src, "trying to set_capture %dx%d, format %s", w, h, format->description); /* this only fills in v4l2src->mmap values */ - if (!gst_v4l2src_set_capture (v4l2src, format, w, h)) { + if (!gst_v4l2src_set_capture (v4l2src, format, &w, &h)) { GST_WARNING_OBJECT (v4l2src, "could not set_capture %dx%d, format %s", w, h, format->description); return FALSE; } + gst_structure_set (structure, "width", G_TYPE_INT, w, "height", G_TYPE_INT, h, + NULL); + if (!gst_v4l2src_capture_init (v4l2src)) return FALSE; @@ -881,8 +884,9 @@ gst_v4l2src_get_read (GstV4l2Src * v4l2src, GstBuffer ** buf) continue; } else { GST_ELEMENT_ERROR (v4l2src, RESOURCE, SYNC, (NULL), - ("error read()ing a buffer on device %s: %s", - v4l2src->v4l2object->videodev, g_strerror (errno))); + ("error read()ing %d bytes on device %s: %d - %s", + buffersize, v4l2src->v4l2object->videodev, errno, + g_strerror (errno))); gst_buffer_unref (*buf); return GST_FLOW_ERROR; } |