From 88e398b0ea98cd9ec39984a36c434117c1dce9e5 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 10 Nov 2011 11:03:18 +0100 Subject: [PATCH] update for removed fixate function --- ext/aalib/gstaasink.c | 15 +++++++-------- ext/jpeg/gstjpegdec.c | 2 +- ext/pulse/pulsesrc.c | 4 ++-- sys/v4l2/gstv4l2src.c | 2 +- sys/ximage/gstximagesrc.c | 10 +++++----- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/ext/aalib/gstaasink.c b/ext/aalib/gstaasink.c index 74cd0685f6..62a885b6e3 100644 --- a/ext/aalib/gstaasink.c +++ b/ext/aalib/gstaasink.c @@ -71,8 +71,9 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("I420")) ); -static gboolean gst_aasink_setcaps (GstBaseSink * pad, GstCaps * caps); -static void gst_aasink_get_times (GstBaseSink * sink, GstBuffer * buffer, +static void gst_aasink_fixate (GstBaseSink * bsink, GstCaps * caps); +static gboolean gst_aasink_setcaps (GstBaseSink * bsink, GstCaps * caps); +static void gst_aasink_get_times (GstBaseSink * bsink, GstBuffer * buffer, GstClockTime * start, GstClockTime * end); static GstFlowReturn gst_aasink_render (GstBaseSink * basesink, GstBuffer * buffer); @@ -212,6 +213,7 @@ gst_aasink_class_init (GstAASinkClass * klass) gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_aasink_change_state); + gstbasesink_class->fixate = GST_DEBUG_FUNCPTR (gst_aasink_fixate); gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_aasink_setcaps); gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_aasink_get_times); gstbasesink_class->preroll = GST_DEBUG_FUNCPTR (gst_aasink_render); @@ -219,7 +221,7 @@ gst_aasink_class_init (GstAASinkClass * klass) } static void -gst_aasink_fixate (GstPad * pad, GstCaps * caps) +gst_aasink_fixate (GstBaseSink * bsink, GstCaps * caps) { GstStructure *structure; @@ -228,6 +230,8 @@ gst_aasink_fixate (GstPad * pad, GstCaps * caps) gst_structure_fixate_field_nearest_int (structure, "width", 320); gst_structure_fixate_field_nearest_int (structure, "height", 240); gst_structure_fixate_field_nearest_fraction (structure, "framerate", 30, 1); + + GST_BASE_SINK_CLASS (parent_class)->fixate (bsink, caps); } static gboolean @@ -256,11 +260,6 @@ invalid_caps: static void gst_aasink_init (GstAASink * aasink) { - GstPad *pad; - - pad = GST_BASE_SINK_PAD (aasink); - gst_pad_set_fixatecaps_function (pad, gst_aasink_fixate); - memcpy (&aasink->ascii_surf, &aa_defparams, sizeof (struct aa_hardware_params)); aasink->ascii_parms.bright = 0; diff --git a/ext/jpeg/gstjpegdec.c b/ext/jpeg/gstjpegdec.c index ab4ed1aecc..42cf0e6bf4 100644 --- a/ext/jpeg/gstjpegdec.c +++ b/ext/jpeg/gstjpegdec.c @@ -1264,7 +1264,7 @@ gst_jpeg_dec_negotiate (GstJpegDec * dec, gint width, gint height, gint clrspc) gst_caps_unref (caps); caps = gst_caps_copy_nth (allowed_caps, i); /* sigh, ds and _parse_caps need fixed caps for parsing, fixate */ - gst_pad_fixate_caps (dec->srcpad, caps); + gst_caps_fixate (caps); GST_LOG_OBJECT (dec, "checking caps %" GST_PTR_FORMAT, caps); if (!gst_video_info_from_caps (&tmpinfo, caps)) diff --git a/ext/pulse/pulsesrc.c b/ext/pulse/pulsesrc.c index 112d41bec9..33c5828a7c 100644 --- a/ext/pulse/pulsesrc.c +++ b/ext/pulse/pulsesrc.c @@ -952,7 +952,7 @@ gst_pulsesrc_negotiate (GstBaseSrc * basesrc) /* now fixate */ if (!gst_caps_is_empty (caps)) { - gst_pad_fixate_caps (GST_BASE_SRC_PAD (basesrc), caps); + GST_BASE_SRC_CLASS (parent_class)->fixate (basesrc, caps); GST_DEBUG_OBJECT (basesrc, "fixated to: %" GST_PTR_FORMAT, caps); if (gst_caps_is_any (caps)) { @@ -1084,7 +1084,7 @@ gst_pulsesrc_success_cb (pa_stream * s, int success, void *userdata) { GstPulseSrc *pulsesrc = GST_PULSESRC_CAST (userdata); - pulsesrc->operation_success = !!success; + pulsesrc->operation_success = ! !success; pa_threaded_mainloop_signal (pulsesrc->mainloop, 0); } diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index 06e4c7c1d5..7ff03304a9 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -402,7 +402,7 @@ gst_v4l2src_negotiate (GstBaseSrc * basesrc) /* now fixate */ if (!gst_caps_is_empty (caps)) { - gst_pad_fixate_caps (GST_BASE_SRC_PAD (basesrc), caps); + gst_v4l2src_fixate (basesrc, caps); GST_DEBUG_OBJECT (basesrc, "fixated to: %" GST_PTR_FORMAT, caps); LOG_CAPS (basesrc, caps); diff --git a/sys/ximage/gstximagesrc.c b/sys/ximage/gstximagesrc.c index af0b8a2f76..2741dbe17f 100644 --- a/sys/ximage/gstximagesrc.c +++ b/sys/ximage/gstximagesrc.c @@ -78,7 +78,7 @@ enum #define gst_ximage_src_parent_class parent_class G_DEFINE_TYPE (GstXImageSrc, gst_ximage_src, GST_TYPE_PUSH_SRC); -static void gst_ximage_src_fixate (GstPad * pad, GstCaps * caps); +static void gst_ximage_src_fixate (GstBaseSrc * bsrc, GstCaps * caps); static void gst_ximage_src_clear_bufpool (GstXImageSrc * ximagesrc); /* Called when a buffer is returned from the pipeline */ @@ -1131,7 +1131,7 @@ gst_ximage_src_set_caps (GstBaseSrc * bs, GstCaps * caps) } static void -gst_ximage_src_fixate (GstPad * pad, GstCaps * caps) +gst_ximage_src_fixate (GstBaseSrc * bsrc, GstCaps * caps) { gint i; GstStructure *structure; @@ -1141,6 +1141,7 @@ gst_ximage_src_fixate (GstPad * pad, GstCaps * caps) gst_structure_fixate_field_nearest_fraction (structure, "framerate", 25, 1); } + GST_BASE_SRC_CLASS (parent_class)->fixate (bsrc, caps); } static void @@ -1269,12 +1270,13 @@ gst_ximage_src_class_init (GstXImageSrcClass * klass) "Zaheer Merali "); gst_element_class_add_pad_template (ec, gst_static_pad_template_get (&t)); - push_class->create = gst_ximage_src_create; + bc->fixate = gst_ximage_src_fixate; bc->get_caps = gst_ximage_src_get_caps; bc->set_caps = gst_ximage_src_set_caps; bc->start = gst_ximage_src_start; bc->stop = gst_ximage_src_stop; bc->unlock = gst_ximage_src_unlock; + push_class->create = gst_ximage_src_create; } static void @@ -1282,8 +1284,6 @@ gst_ximage_src_init (GstXImageSrc * ximagesrc) { gst_base_src_set_format (GST_BASE_SRC (ximagesrc), GST_FORMAT_TIME); gst_base_src_set_live (GST_BASE_SRC (ximagesrc), TRUE); - gst_pad_set_fixatecaps_function (GST_BASE_SRC_PAD (ximagesrc), - gst_ximage_src_fixate); ximagesrc->pool_lock = g_mutex_new (); ximagesrc->x_lock = g_mutex_new ();