Commit 7bfdb236 authored by Andy Wingo Wingo's avatar Andy Wingo Wingo
Browse files

sys/v4l/gstv4lsrc.c (gst_v4lsrc_stop): Fix a spurious warning.

Original commit message from CVS:
2005-07-13  Andy Wingo  <wingo@pobox.com>

* sys/v4l/gstv4lsrc.c (gst_v4lsrc_stop): Fix a spurious warning.
(gst_v4lsrc_fixate): Fixate on format as well.
parent d4ceba9d
2005-07-13 Andy Wingo <wingo@pobox.com> 2005-07-13 Andy Wingo <wingo@pobox.com>
   
* sys/v4l/gstv4lsrc.c (gst_v4lsrc_stop): Fix a spurious warning.
(gst_v4lsrc_fixate): Fixate on format as well.
* sys/xvimage/xvimagesink.c (gst_xvimage_buffer_destroy) * sys/xvimage/xvimagesink.c (gst_xvimage_buffer_destroy)
(gst_xvimagesink_xvimage_new): Ref the xvimagesink while the (gst_xvimagesink_xvimage_new): Ref the xvimagesink while the
buffer points to it. buffer points to it.
......
...@@ -232,6 +232,7 @@ gst_v4lsrc_fixate (GstPad * pad, GstCaps * caps) ...@@ -232,6 +232,7 @@ gst_v4lsrc_fixate (GstPad * pad, GstCaps * caps)
for (i = 0; i < gst_caps_get_size (caps); ++i) { for (i = 0; i < gst_caps_get_size (caps); ++i) {
structure = gst_caps_get_structure (caps, i); structure = gst_caps_get_structure (caps, i);
const GValue *v;
gst_caps_structure_fixate_field_nearest_int (structure, "width", gst_caps_structure_fixate_field_nearest_int (structure, "width",
targetwidth); targetwidth);
...@@ -239,6 +240,16 @@ gst_v4lsrc_fixate (GstPad * pad, GstCaps * caps) ...@@ -239,6 +240,16 @@ gst_v4lsrc_fixate (GstPad * pad, GstCaps * caps)
targetheight); targetheight);
gst_caps_structure_fixate_field_nearest_double (structure, "framerate", gst_caps_structure_fixate_field_nearest_double (structure, "framerate",
7.5); 7.5);
v = gst_structure_get_value (structure, "format");
if (G_VALUE_TYPE (v) != GST_TYPE_FOURCC) {
guint32 fourcc;
g_return_if_fail (G_VALUE_TYPE (v) == GST_TYPE_LIST);
fourcc = gst_value_get_fourcc (gst_value_list_get_value (v, 0));
gst_structure_set (structure, "format", GST_TYPE_FOURCC, fourcc, NULL);
}
} }
} }
...@@ -613,7 +624,7 @@ gst_v4lsrc_stop (GstBaseSrc * src) ...@@ -613,7 +624,7 @@ gst_v4lsrc_stop (GstBaseSrc * src)
{ {
GstV4lSrc *v4lsrc = GST_V4LSRC (src); GstV4lSrc *v4lsrc = GST_V4LSRC (src);
if (!gst_v4lsrc_capture_stop (v4lsrc)) if (GST_V4L_IS_ACTIVE (v4lsrc) && !gst_v4lsrc_capture_stop (v4lsrc))
return FALSE; return FALSE;
if (GST_V4LELEMENT (v4lsrc)->buffer != NULL) { if (GST_V4LELEMENT (v4lsrc)->buffer != NULL) {
......
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