From: Wim Taymans Date: Tue, 14 Mar 2006 11:11:59 +0000 (+0000) Subject: gst/: Re-enable QoS after the release. X-Git-Tag: 1.19.3~511^2~12080 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3150ac3b64e837f2756a973f157cecaded247227;p=platform%2Fupstream%2Fgstreamer.git gst/: Re-enable QoS after the release. Original commit message from CVS: * gst-libs/gst/video/gstvideofilter.c: (gst_video_filter_init): * gst-libs/gst/video/gstvideosink.c: (gst_video_sink_init): * gst/ffmpegcolorspace/gstffmpegcolorspace.c: (gst_ffmpegcsp_init): * gst/videoscale/gstvideoscale.c: (gst_video_scale_class_init), (gst_video_scale_init), (gst_video_scale_src_event): Re-enable QoS after the release. Rework videoscale to use the base class src_event handler. --- diff --git a/ChangeLog b/ChangeLog index 64acec6..d1e08fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-03-14 Wim Taymans + + * gst-libs/gst/video/gstvideofilter.c: (gst_video_filter_init): + * gst-libs/gst/video/gstvideosink.c: (gst_video_sink_init): + * gst/ffmpegcolorspace/gstffmpegcolorspace.c: (gst_ffmpegcsp_init): + * gst/videoscale/gstvideoscale.c: (gst_video_scale_class_init), + (gst_video_scale_init), (gst_video_scale_src_event): + Re-enable QoS after the release. + Rework videoscale to use the base class src_event handler. + 2006-03-14 Tim-Philipp Müller * configure.ac: diff --git a/gst-libs/gst/video/gstvideofilter.c b/gst-libs/gst/video/gstvideofilter.c index c1bb15d..02c7a67 100644 --- a/gst-libs/gst/video/gstvideofilter.c +++ b/gst-libs/gst/video/gstvideofilter.c @@ -24,8 +24,11 @@ * * * - * Provides useful functions and a base class for video filters. Right now it's - * mostly used as a place holder for adding common code later on. + * Provides useful functions and a base class for video filters. + * + * + * The videofilter will by default enable QoS on the parent GstBaseTransform + * to implement frame dropping. * * */ @@ -95,4 +98,6 @@ gst_video_filter_init (GTypeInstance * instance, gpointer g_class) GST_DEBUG_OBJECT (videofilter, "gst_video_filter_init"); videofilter->inited = FALSE; + /* enable QoS */ + gst_base_transform_set_qos_enabled (GST_BASE_TRANSFORM (videofilter), TRUE); } diff --git a/gst-libs/gst/video/gstvideosink.c b/gst-libs/gst/video/gstvideosink.c index 7ce289f..0441373 100644 --- a/gst-libs/gst/video/gstvideosink.c +++ b/gst-libs/gst/video/gstvideosink.c @@ -104,7 +104,8 @@ gst_video_sink_init (GstVideoSink * videosink) videosink->width = 0; videosink->height = 0; - gst_base_sink_set_max_lateness (GST_BASE_SINK (videosink), -1); + /* 20ms is more than enough, 80-130ms is noticable */ + gst_base_sink_set_max_lateness (GST_BASE_SINK (videosink), 20 * GST_MSECOND); } static void diff --git a/gst/ffmpegcolorspace/gstffmpegcolorspace.c b/gst/ffmpegcolorspace/gstffmpegcolorspace.c index f8d5059..7fcc798 100644 --- a/gst/ffmpegcolorspace/gstffmpegcolorspace.c +++ b/gst/ffmpegcolorspace/gstffmpegcolorspace.c @@ -371,6 +371,7 @@ gst_ffmpegcsp_class_init (GstFFMpegCspClass * klass) static void gst_ffmpegcsp_init (GstFFMpegCsp * space) { + gst_base_transform_set_qos_enabled (GST_BASE_TRANSFORM (space), TRUE); space->from_pixfmt = space->to_pixfmt = PIX_FMT_NB; space->palette = NULL; } diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index 9dfdaf2..3a6fbe3 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -177,7 +177,7 @@ gst_video_scale_sink_template_factory (void) static void gst_video_scale_base_init (gpointer g_class); static void gst_video_scale_class_init (GstVideoScaleClass * klass); static void gst_video_scale_init (GstVideoScale * videoscale); -static gboolean gst_video_scale_handle_src_event (GstPad * pad, +static gboolean gst_video_scale_src_event (GstBaseTransform * trans, GstEvent * event); /* base transform vmethods */ @@ -261,6 +261,7 @@ gst_video_scale_class_init (GstVideoScaleClass * klass) GST_DEBUG_FUNCPTR (gst_video_scale_get_unit_size); trans_class->transform = GST_DEBUG_FUNCPTR (gst_video_scale_transform); trans_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_video_scale_fixate_caps); + trans_class->src_event = GST_DEBUG_FUNCPTR (gst_video_scale_src_event); trans_class->passthrough_on_same_caps = TRUE; @@ -270,10 +271,7 @@ gst_video_scale_class_init (GstVideoScaleClass * klass) static void gst_video_scale_init (GstVideoScale * videoscale) { - GstBaseTransform *trans = GST_BASE_TRANSFORM (videoscale); - - gst_pad_set_event_function (trans->srcpad, gst_video_scale_handle_src_event); - + gst_base_transform_set_qos_enabled (GST_BASE_TRANSFORM (videoscale), TRUE); videoscale->tmp_buf = NULL; videoscale->method = DEFAULT_PROP_METHOD; } @@ -754,14 +752,14 @@ unknown_mode: } static gboolean -gst_video_scale_handle_src_event (GstPad * pad, GstEvent * event) +gst_video_scale_src_event (GstBaseTransform * trans, GstEvent * event) { GstVideoScale *videoscale; gboolean ret; double a; GstStructure *structure; - videoscale = GST_VIDEO_SCALE (gst_pad_get_parent (pad)); + videoscale = GST_VIDEO_SCALE (trans); GST_DEBUG_OBJECT (videoscale, "handling %s event", GST_EVENT_TYPE_NAME (event)); @@ -781,13 +779,13 @@ gst_video_scale_handle_src_event (GstPad * pad, GstEvent * event) a * videoscale->from_height / videoscale->to_height, NULL); } break; + case GST_EVENT_QOS: + break; default: break; } - ret = gst_pad_event_default (pad, event); - - gst_object_unref (videoscale); + ret = GST_BASE_TRANSFORM_CLASS (parent_class)->src_event (trans, event); return ret; }