From 9414aca1c59e27c5fe7c62eef8c53f6e06b7e630 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 13 Apr 2004 23:25:19 +0000 Subject: common/m4/gst-feature.m4: Call -config scripts with Original commit message from CVS: * common/m4/gst-feature.m4: Call -config scripts with --plugin-libs if it is supported. * gst/avi/gstavimux.c: (gst_avimux_vidsinkconnect): sequences of JPEG images are image/jpeg. * gst/debug/Makefile.am: * gst/debug/negotiation.c: (gst_negotiation_class_init), (gst_negotiation_getcaps), (gst_negotiation_pad_link), (gst_negotiation_update_caps), (gst_negotiation_get_property), (gst_negotiation_plugin_init): Add a property that acts like filter caps. * testsuite/gst-lint: Move license checking to be a standard test. --- ChangeLog | 15 +++++++++++++++ common | 2 +- gst/avi/gstavimux.c | 4 ++-- gst/debug/Makefile.am | 3 ++- gst/debug/negotiation.c | 35 ++++++++++++++++++++++++++++++++++- 5 files changed, 54 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2f73c60f..bd63b614 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2004-04-13 David Schleef + + * common/m4/gst-feature.m4: Call -config scripts with + --plugin-libs if it is supported. + * gst/avi/gstavimux.c: (gst_avimux_vidsinkconnect): sequences of + JPEG images are image/jpeg. + * gst/debug/Makefile.am: + * gst/debug/negotiation.c: (gst_negotiation_class_init), + (gst_negotiation_getcaps), (gst_negotiation_pad_link), + (gst_negotiation_update_caps), (gst_negotiation_get_property), + (gst_negotiation_plugin_init): Add a property that acts like + filter caps. + * testsuite/gst-lint: Move license checking to be a standard + test. + 2004-04-13 David Schleef * gst/avi/gstavidemux.c: (gst_avi_demux_reset): Fix memleak. diff --git a/common b/common index 99901894..c4fb9e5b 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 99901894a48091bfed16826702c38c4063e64954 +Subproject commit c4fb9e5b7bc69f9420a0f008230e3028fdc2b097 diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c index d613d0cc..f90ec53a 100644 --- a/gst/avi/gstavimux.c +++ b/gst/avi/gstavimux.c @@ -71,7 +71,7 @@ static GstStaticPadTemplate video_sink_factory = "format = (fourcc) { YUY2, I420 }, " "width = (int) [ 16, 4096 ], " "height = (int) [ 16, 4096 ]; " - "video/x-jpeg, " + "image/jpeg, " "width = (int) [ 16, 4096 ], " "height = (int) [ 16, 4096 ]; " "video/x-divx, " @@ -317,7 +317,7 @@ gst_avimux_vidsinkconnect (GstPad * pad, const GstCaps * vscaps) /* find format */ if (!strcmp (mimetype, "video/x-huffyuv")) { avimux->vids.compression = GST_MAKE_FOURCC ('H', 'F', 'Y', 'U'); - } else if (!strcmp (mimetype, "video/x-jpeg")) { + } else if (!strcmp (mimetype, "image/jpeg")) { avimux->vids.compression = GST_MAKE_FOURCC ('M', 'J', 'P', 'G'); } else if (!strcmp (mimetype, "video/x-divx")) { gint divxversion; diff --git a/gst/debug/Makefile.am b/gst/debug/Makefile.am index f1ca6bba..3f34ae72 100644 --- a/gst/debug/Makefile.am +++ b/gst/debug/Makefile.am @@ -11,7 +11,8 @@ libgstnavigationtest_la_SOURCES = gstnavigationtest.c libgstnavigationtest_la_CFLAGS = $(GST_CFLAGS) -I$(top_srcdir)/gst/videofilter libgstnavigationtest_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -libgstdebug_la_SOURCES = gstdebug.c \ +libgstdebug_la_SOURCES = \ + gstdebug.c \ breakmydata.c \ negotiation.c \ gstnavseek.c diff --git a/gst/debug/negotiation.c b/gst/debug/negotiation.c index 3e71e11f..25f30024 100644 --- a/gst/debug/negotiation.c +++ b/gst/debug/negotiation.c @@ -48,6 +48,8 @@ struct _GstNegotiation GstElement element; GstPad *sinkpad, *srcpad; + + GstCaps *caps; }; struct _GstNegotiationClass @@ -75,7 +77,8 @@ enum enum { - ARG_0 + ARG_0, + ARG_ALLOWED_CAPS }; static GstStaticPadTemplate gst_negotiation_sink_factory = @@ -103,6 +106,7 @@ static void gst_negotiation_set_property (GObject * object, guint prop_id, static void gst_negotiation_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); +static void gst_negotiation_update_caps (GstNegotiation * negotiation); static void gst_negotiation_chain (GstPad * pad, GstData * _data); static GstElementClass *parent_class = NULL; @@ -164,6 +168,11 @@ gst_negotiation_class_init (GstNegotiationClass * klass) gobject_class->set_property = gst_negotiation_set_property; gobject_class->get_property = gst_negotiation_get_property; + + g_object_class_install_property (gobject_class, ARG_ALLOWED_CAPS, + g_param_spec_boxed ("allowed-caps", "Caps", + "The range of formats allowed by " "this element's peers", + GST_TYPE_CAPS, G_PARAM_READABLE)); } static void @@ -200,6 +209,8 @@ gst_negotiation_getcaps (GstPad * pad) GST_ERROR ("getcaps called on %" GST_PTR_FORMAT ", returning %" GST_PTR_FORMAT, pad, caps); + gst_negotiation_update_caps (negotiation); + return caps; } @@ -221,6 +232,25 @@ gst_negotiation_pad_link (GstPad * pad, const GstCaps * caps) return ret; } +static void +gst_negotiation_update_caps (GstNegotiation * negotiation) +{ + GstCaps *srccaps; + GstCaps *sinkcaps; + GstCaps *icaps; + + srccaps = gst_pad_get_allowed_caps (negotiation->srcpad); + sinkcaps = gst_pad_get_allowed_caps (negotiation->sinkpad); + + icaps = gst_caps_intersect (srccaps, sinkcaps); + gst_caps_free (srccaps); + gst_caps_free (sinkcaps); + + gst_caps_replace (&negotiation->caps, icaps); + g_object_notify (G_OBJECT (negotiation), "allowed-caps"); + g_print ("notify %s", gst_caps_to_string (icaps)); +} + static void gst_negotiation_chain (GstPad * pad, GstData * _data) { @@ -255,6 +285,9 @@ gst_negotiation_get_property (GObject * object, guint prop_id, filter = GST_NEGOTIATION (object); switch (prop_id) { + case ARG_ALLOWED_CAPS: + g_value_set_boxed (value, filter->caps); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; -- cgit