From 8a763856ed807cd8329165225af818e353dd8ff0 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Jul 21 2008 14:58:30 +0000 Subject: - gst-plugins-good-0.10.8-v4l2-progressive-fix.patch: Backport v4l2 interlace/progressive fixes. (#454534) --- diff --git a/gst-plugins-good-0.10.8-v4l2-progressive-fix.patch b/gst-plugins-good-0.10.8-v4l2-progressive-fix.patch new file mode 100644 index 0000000..b71b851 --- /dev/null +++ b/gst-plugins-good-0.10.8-v4l2-progressive-fix.patch @@ -0,0 +1,82 @@ + +From: Daniel Drake + +http://bugzilla.gnome.org/show_bug.cgi?id=541956 + +Index: gst-plugins-good-0.10.8/sys/v4l2/v4l2src_calls.c +=================================================================== +--- gst-plugins-good-0.10.8.orig/sys/v4l2/v4l2src_calls.c ++++ gst-plugins-good-0.10.8/sys/v4l2/v4l2src_calls.c +@@ -1149,11 +1149,23 @@ gst_v4l2src_set_capture (GstV4l2Src * v4 + format.fmt.pix.width = width; + format.fmt.pix.height = height; + format.fmt.pix.pixelformat = pixelformat; +- /* request whole frames; change when gstreamer supports interlaced video */ ++ /* request whole frames; change when gstreamer supports interlaced video ++ * (INTERLACED mode returns frames where the fields have already been ++ * combined, there are other modes for requesting fields individually) */ + format.fmt.pix.field = V4L2_FIELD_INTERLACED; + +- if (ioctl (fd, VIDIOC_S_FMT, &format) < 0) +- goto set_fmt_failed; ++ if (ioctl (fd, VIDIOC_S_FMT, &format) < 0) { ++ if (errno != EINVAL) ++ goto set_fmt_failed; ++ ++ /* try again with progressive video */ ++ format.fmt.pix.width = width; ++ format.fmt.pix.height = height; ++ format.fmt.pix.pixelformat = pixelformat; ++ format.fmt.pix.field = V4L2_FIELD_NONE; ++ if (ioctl (fd, VIDIOC_S_FMT, &format) < 0) ++ goto set_fmt_failed; ++ } + + if (format.fmt.pix.width != width || format.fmt.pix.height != height) + goto invalid_dimensions; +@@ -1473,6 +1485,7 @@ gst_v4l2src_get_nearest_size (GstV4l2Src + { + struct v4l2_format fmt; + int fd; ++ int r; + + g_return_val_if_fail (width != NULL, FALSE); + g_return_val_if_fail (height != NULL, FALSE); +@@ -1491,7 +1504,17 @@ gst_v4l2src_get_nearest_size (GstV4l2Src + fmt.fmt.pix.pixelformat = pixelformat; + fmt.fmt.pix.field = V4L2_FIELD_INTERLACED; + +- if (ioctl (fd, VIDIOC_TRY_FMT, &fmt) < 0) { ++ r = ioctl (fd, VIDIOC_TRY_FMT, &fmt); ++ if (r < 0 && errno == EINVAL) { ++ /* try again with progressive video */ ++ fmt.fmt.pix.width = *width; ++ fmt.fmt.pix.height = *height; ++ fmt.fmt.pix.pixelformat = pixelformat; ++ fmt.fmt.pix.field = V4L2_FIELD_NONE; ++ r = ioctl (fd, VIDIOC_TRY_FMT, &fmt); ++ } ++ ++ if (r < 0) { + /* The driver might not implement TRY_FMT, in which case we will try + S_FMT to probe */ + if (errno != ENOTTY) +@@ -1508,7 +1531,17 @@ gst_v4l2src_get_nearest_size (GstV4l2Src + fmt.fmt.pix.width = *width; + fmt.fmt.pix.height = *height; + +- if (ioctl (fd, VIDIOC_S_FMT, &fmt) < 0) ++ r = ioctl (fd, VIDIOC_S_FMT, &fmt); ++ if (r < 0 && errno == EINVAL) { ++ /* try again with progressive video */ ++ fmt.fmt.pix.width = *width; ++ fmt.fmt.pix.height = *height; ++ fmt.fmt.pix.pixelformat = pixelformat; ++ fmt.fmt.pix.field = V4L2_FIELD_NONE; ++ r = ioctl (fd, VIDIOC_S_FMT, &fmt); ++ } ++ ++ if (r < 0) + return FALSE; + } + diff --git a/gstreamer-plugins-good.spec b/gstreamer-plugins-good.spec index f871076..5b381f9 100644 --- a/gstreamer-plugins-good.spec +++ b/gstreamer-plugins-good.spec @@ -6,7 +6,7 @@ Name: %{gstreamer}-plugins-good Version: 0.10.8 -Release: 7%{?dist} +Release: 8%{?dist} Summary: GStreamer plug-ins with good code and licensing Group: Applications/Multimedia @@ -16,8 +16,10 @@ Source: http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugin Patch0: gst-plugins-good-0.10.8-docs.patch # http://bugzilla.gnome.org/show_bug.cgi?id=536317 Patch1: gst-plugins-good-v4l2-new-kernel.patch -# bug #451391 +# rh bug #451391 Patch2: gst-plugins-good-0.10.8-speex-nego.patch +# rh bug #454534 +Patch3: gst-plugins-good-0.10.8-v4l2-progressive-fix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: %{gstreamer} >= %{_gst} @@ -102,6 +104,7 @@ pushd sys/v4l2 %patch1 -p0 -b .new-kernel popd %patch2 -p1 -b .speex-nego +%patch3 -p1 -b .v4l2-progressive %build @@ -243,6 +246,10 @@ export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/gstreamer-%{majorminor}.schemas > /dev/null || : %changelog +* Mon Jul 21 2008 Adam Jackson 0.10.8-8 +- gst-plugins-good-0.10.8-v4l2-progressive-fix.patch: Backport v4l2 + interlace/progressive fixes. (#454534) + * Thu Jun 19 2008 Adam Jackson 0.10.8-7 - gst-plugins-good-0.10.8-speex-nego.patch: Backport speex channel and rate negotiation from 0.10.9. (#451391)