summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--configure.ac4
-rw-r--r--gst/deinterlace/Makefile.am7
-rw-r--r--gst/deinterlace/gstdeinterlace.c58
4 files changed, 51 insertions, 32 deletions
diff --git a/ChangeLog b/ChangeLog
index e73dedb3..9bf1b132 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2008-02-01 Tim-Philipp Müller <tim at centricular dot net>
+
+ * configure.ac:
+ Bump core/base requirements to released versions, to avoid confusion.
+
+ * gst/deinterlace/Makefile.am:
+ * gst/deinterlace/gstdeinterlace.c: (gst_deinterlace_set_caps):
+ Use the new GstVideoFormat API to get strides, plane offsets etc..
+ For Y42B we still need to calculate these ourselves, since the lib
+ in -base doesn't know about this format yet and we can't bump the
+ requirement to CVS right now. Fix the Y42B stride, offset and size
+ calculations for odd widths and heights while we're at it though
+ (to match those in videotestsrc).
+
2008-01-31 Edgard Lima <edgard.lima@indt.org.br>
* ext/metadata/metadata_mapping.htm:
diff --git a/configure.ac b/configure.ac
index f430be5b..bada2158 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,8 +45,8 @@ AM_PROG_LIBTOOL
dnl *** required versions of GStreamer stuff ***
dnl *** remove rtpmanager/equalizer stuff below when this is updated
-GST_REQ=0.10.15.1
-GSTPB_REQ=0.10.15.1
+GST_REQ=0.10.17
+GSTPB_REQ=0.10.17
dnl *** autotools stuff ****
diff --git a/gst/deinterlace/Makefile.am b/gst/deinterlace/Makefile.am
index 22a691b5..3c1b5f5a 100644
--- a/gst/deinterlace/Makefile.am
+++ b/gst/deinterlace/Makefile.am
@@ -1,9 +1,10 @@
plugin_LTLIBRARIES = libgstdeinterlace.la
-# NOTE: we don't need $(GST_PLUGINS_BASE_LIBS) at the moment
libgstdeinterlace_la_SOURCES = gstdeinterlace.c
-libgstdeinterlace_la_CFLAGS = $(GST_BASE_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS)
-libgstdeinterlace_la_LIBADD = $(GST_BASE_LIBS)
+libgstdeinterlace_la_CFLAGS = \
+ $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS)
+libgstdeinterlace_la_LIBADD = \
+ $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR) $(GST_BASE_LIBS)
libgstdeinterlace_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = gstdeinterlace.h
diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c
index e298c547..f0cc9880 100644
--- a/gst/deinterlace/gstdeinterlace.c
+++ b/gst/deinterlace/gstdeinterlace.c
@@ -178,54 +178,58 @@ gst_deinterlace_set_caps (GstBaseTransform * trans, GstCaps * incaps,
GstCaps * outcaps)
{
GstDeinterlace *filter;
+ GstVideoFormat fmt;
GstStructure *s;
- gint picsize;
+ guint32 fourcc;
+ gint picsize, w, h;
filter = GST_DEINTERLACE (trans);
g_assert (gst_caps_is_equal_fixed (incaps, outcaps));
s = gst_caps_get_structure (incaps, 0);
- if (!gst_structure_get_int (s, "width", &filter->width) ||
- !gst_structure_get_int (s, "height", &filter->height)) {
+ if (!gst_structure_get_int (s, "width", &w) ||
+ !gst_structure_get_int (s, "height", &h) ||
+ !gst_structure_get_fourcc (s, "format", &fourcc)) {
return FALSE;
}
- if (!gst_structure_get_fourcc (s, "format", &filter->fourcc))
- return FALSE;
-
- GST_LOG_OBJECT (filter, "width x height = %d x %d", filter->width,
- filter->height);
+ filter->width = w;
+ filter->height = h;
+ filter->fourcc = fourcc;
- /*4:2:0 */
- filter->uv_height = filter->height / 2;
- filter->y_stride = GST_ROUND_UP_4 (filter->width);
- filter->u_stride = GST_ROUND_UP_8 (filter->width) / 2;
- filter->v_stride = GST_ROUND_UP_8 (filter->width) / 2;
+ GST_DEBUG_OBJECT (filter, "width x height = %d x %d, fourcc: %"
+ GST_FOURCC_FORMAT, w, h, GST_FOURCC_ARGS (fourcc));
- filter->y_off = 0;
- filter->u_off = 0 + filter->y_stride * GST_ROUND_UP_2 (filter->height);
- filter->v_off =
- filter->u_off + filter->u_stride * (GST_ROUND_UP_2 (filter->height) / 2);
+ fmt = gst_video_format_from_fourcc (fourcc);
- picsize =
- (filter->v_off +
- (filter->v_stride * GST_ROUND_UP_2 (filter->height) / 2));
+ if (fmt == GST_VIDEO_FORMAT_UNKNOWN) {
+ /* this is Y42B (4:2:2 planar) which -base <= 0.10.17 doesn't know about */
+ /* FIXME: remove this once we can depend on -base >= 0.10.17.1 */
+ g_assert (fourcc == GST_MAKE_FOURCC ('Y', '4', '2', 'B'));
- /*4:2:2 */
- if (filter->fourcc == GST_MAKE_FOURCC ('Y', '4', '2', 'B')) {
filter->uv_height = filter->height;
filter->y_stride = GST_ROUND_UP_4 (filter->width);
filter->u_stride = GST_ROUND_UP_8 (filter->width) / 2;
filter->v_stride = GST_ROUND_UP_8 (filter->width) / 2;
filter->y_off = 0;
- filter->u_off = 0 + filter->y_stride * GST_ROUND_UP_2 (filter->height);
- filter->v_off =
- filter->u_off + filter->u_stride * (GST_ROUND_UP_2 (filter->height));
+ filter->u_off = 0 + filter->y_stride * filter->height;
+ filter->v_off = filter->u_off + filter->u_stride * filter->height;
+
+ picsize = filter->v_off + (filter->v_stride * filter->height);
+ } else {
+ filter->y_stride = gst_video_format_get_row_stride (fmt, 0, w);
+ filter->u_stride = gst_video_format_get_row_stride (fmt, 1, w);
+ filter->v_stride = gst_video_format_get_row_stride (fmt, 2, w);
+
+ filter->uv_height = gst_video_format_get_component_height (fmt, 1, h);
+
+ filter->y_off = gst_video_format_get_component_offset (fmt, 0, w, h);
+ filter->u_off = gst_video_format_get_component_offset (fmt, 1, w, h);
+ filter->v_off = gst_video_format_get_component_offset (fmt, 2, w, h);
- picsize =
- (filter->v_off + (filter->v_stride * GST_ROUND_UP_2 (filter->height)));
+ picsize = gst_video_format_get_size (fmt, w, h);
}
if (filter->picsize != picsize) {