Commit a6019fc0 authored by William M. Brack's avatar William M. Brack Committed by Tim-Philipp Müller
Browse files

sys/v4l2/v4l2src_calls.c: Make sure the probed frame sizes are reversed in the...

sys/v4l2/v4l2src_calls.c: Make sure the probed frame sizes are reversed in the resulting caps also when using V4L2_FR...

Original commit message from CVS:
Patch by: William M. Brack <wbrack at mmm com hk>
* sys/v4l2/v4l2src_calls.c:
(gst_v4l2src_probe_caps_for_format_and_size),
(gst_v4l2src_probe_caps_for_format):
Make sure the probed frame sizes are reversed in the resulting
caps also when using V4L2_FRMSIZE_STEPWISE (so they end up
highest resolution first); also remove unused variable.
(Partly fixes #520092)
parent 110a0ea5
2008-03-17 Tim-Philipp Müller <tim at centricular dot net>
Patch by: William M. Brack <wbrack at mmm com hk>
* sys/v4l2/v4l2src_calls.c:
(gst_v4l2src_probe_caps_for_format_and_size),
(gst_v4l2src_probe_caps_for_format):
Make sure the probed frame sizes are reversed in the resulting
caps also when using V4L2_FRMSIZE_STEPWISE (so they end up
highest resolution first); also remove unused variable.
(Partly fixes #520092)
2008-03-17 Wim Taymans <wim.taymans@collabora.co.uk> 2008-03-17 Wim Taymans <wim.taymans@collabora.co.uk>
Patch by: Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com> Patch by: Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>
......
...@@ -573,15 +573,12 @@ gst_v4l2src_probe_caps_for_format_and_size (GstV4l2Src * v4l2src, ...@@ -573,15 +573,12 @@ gst_v4l2src_probe_caps_for_format_and_size (GstV4l2Src * v4l2src,
guint32 pixelformat, guint32 pixelformat,
guint32 width, guint32 height, const GstStructure * template) guint32 width, guint32 height, const GstStructure * template)
{ {
GstCaps *ret;
gint fd = v4l2src->v4l2object->video_fd; gint fd = v4l2src->v4l2object->video_fd;
struct v4l2_frmivalenum ival; struct v4l2_frmivalenum ival;
guint32 num, denom; guint32 num, denom;
GstStructure *s; GstStructure *s;
GValue rates = { 0, }; GValue rates = { 0, };
ret = gst_caps_new_empty ();
memset (&ival, 0, sizeof (struct v4l2_frmivalenum)); memset (&ival, 0, sizeof (struct v4l2_frmivalenum));
ival.index = 0; ival.index = 0;
ival.pixel_format = pixelformat; ival.pixel_format = pixelformat;
...@@ -787,6 +784,9 @@ gst_v4l2src_probe_caps_for_format (GstV4l2Src * v4l2src, guint32 pixelformat, ...@@ -787,6 +784,9 @@ gst_v4l2src_probe_caps_for_format (GstV4l2Src * v4l2src, guint32 pixelformat,
tmp = gst_v4l2src_probe_caps_for_format_and_size (v4l2src, pixelformat, tmp = gst_v4l2src_probe_caps_for_format_and_size (v4l2src, pixelformat,
w, h, template); w, h, template);
/* we get low res to high res, but want high res to low res in caps, so
* prepend structs to results list, we'll reverse the order later then */
if (tmp) if (tmp)
results = g_list_prepend (results, tmp); results = g_list_prepend (results, tmp);
...@@ -801,8 +801,11 @@ gst_v4l2src_probe_caps_for_format (GstV4l2Src * v4l2src, guint32 pixelformat, ...@@ -801,8 +801,11 @@ gst_v4l2src_probe_caps_for_format (GstV4l2Src * v4l2src, guint32 pixelformat,
tmp = gst_v4l2src_probe_caps_for_format_and_size (v4l2src, pixelformat, tmp = gst_v4l2src_probe_caps_for_format_and_size (v4l2src, pixelformat,
w, h, template); w, h, template);
/* we get low res to high res, but want high res to low res in caps, so
* prepend structs to results list, we'll reverse the order later then */
if (tmp) if (tmp)
gst_caps_append_structure (ret, tmp); results = g_list_prepend (results, tmp);
} }
} else if (size.type == V4L2_FRMSIZE_TYPE_CONTINUOUS) { } else if (size.type == V4L2_FRMSIZE_TYPE_CONTINUOUS) {
guint32 maxw, maxh; guint32 maxw, maxh;
...@@ -818,6 +821,8 @@ gst_v4l2src_probe_caps_for_format (GstV4l2Src * v4l2src, guint32 pixelformat, ...@@ -818,6 +821,8 @@ gst_v4l2src_probe_caps_for_format (GstV4l2Src * v4l2src, guint32 pixelformat,
gst_structure_set (tmp, "width", GST_TYPE_INT_RANGE, (gint) w, gst_structure_set (tmp, "width", GST_TYPE_INT_RANGE, (gint) w,
(gint) maxw, "height", GST_TYPE_INT_RANGE, (gint) h, (gint) maxh, (gint) maxw, "height", GST_TYPE_INT_RANGE, (gint) h, (gint) maxh,
NULL); NULL);
/* no point using the results list here, since there's only one struct */
gst_caps_append_structure (ret, tmp); gst_caps_append_structure (ret, tmp);
} }
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment