From 78b0413c5f3dfc2923b51829830de7daa7a2a250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 8 Sep 2009 17:43:26 +0100 Subject: [PATCH] ximagesink, xvimagesink: use new GstVideoSink::show_frame() vfunc --- sys/ximage/ximagesink.c | 12 +++++++----- sys/xvimage/xvimagesink.c | 10 ++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 3f1714c663..1d726ab4ed 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -1622,13 +1622,13 @@ gst_ximagesink_get_times (GstBaseSink * bsink, GstBuffer * buf, } static GstFlowReturn -gst_ximagesink_show_frame (GstBaseSink * bsink, GstBuffer * buf) +gst_ximagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf) { GstXImageSink *ximagesink; g_return_val_if_fail (buf != NULL, GST_FLOW_ERROR); - ximagesink = GST_XIMAGESINK (bsink); + ximagesink = GST_XIMAGESINK (vsink); /* If this buffer has been allocated using our buffer management we simply put the ximage which is in the PRIVATE pointer */ @@ -1671,7 +1671,7 @@ gst_ximagesink_show_frame (GstBaseSink * bsink, GstBuffer * buf) no_ximage: { /* No image available. That's very bad ! */ - GST_DEBUG ("could not create image"); + GST_WARNING_OBJECT (ximagesink, "could not create image"); return GST_FLOW_ERROR; } no_window: @@ -2295,10 +2295,12 @@ gst_ximagesink_class_init (GstXImageSinkClass * klass) GObjectClass *gobject_class; GstElementClass *gstelement_class; GstBaseSinkClass *gstbasesink_class; + GstVideoSinkClass *videosink_class; gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; gstbasesink_class = (GstBaseSinkClass *) klass; + videosink_class = (GstVideoSinkClass *) klass; parent_class = g_type_class_peek_parent (klass); @@ -2339,9 +2341,9 @@ gst_ximagesink_class_init (GstXImageSinkClass * klass) gstbasesink_class->buffer_alloc = GST_DEBUG_FUNCPTR (gst_ximagesink_buffer_alloc); gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_ximagesink_get_times); - gstbasesink_class->preroll = GST_DEBUG_FUNCPTR (gst_ximagesink_show_frame); - gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_ximagesink_show_frame); gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_ximagesink_event); + + videosink_class->show_frame = GST_DEBUG_FUNCPTR (gst_ximagesink_show_frame); } /* ============================================================= */ diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 456371e789..ec4eb4b266 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -2313,11 +2313,11 @@ gst_xvimagesink_get_times (GstBaseSink * bsink, GstBuffer * buf, } static GstFlowReturn -gst_xvimagesink_show_frame (GstBaseSink * bsink, GstBuffer * buf) +gst_xvimagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf) { GstXvImageSink *xvimagesink; - xvimagesink = GST_XVIMAGESINK (bsink); + xvimagesink = GST_XVIMAGESINK (vsink); /* If this buffer has been allocated using our buffer management we simply put the ximage which is in the PRIVATE pointer */ @@ -3368,10 +3368,12 @@ gst_xvimagesink_class_init (GstXvImageSinkClass * klass) GObjectClass *gobject_class; GstElementClass *gstelement_class; GstBaseSinkClass *gstbasesink_class; + GstVideoSinkClass *videosink_class; gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; gstbasesink_class = (GstBaseSinkClass *) klass; + videosink_class = (GstVideoSinkClass *) klass; parent_class = g_type_class_peek_parent (klass); @@ -3490,9 +3492,9 @@ gst_xvimagesink_class_init (GstXvImageSinkClass * klass) gstbasesink_class->buffer_alloc = GST_DEBUG_FUNCPTR (gst_xvimagesink_buffer_alloc); gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_xvimagesink_get_times); - gstbasesink_class->preroll = GST_DEBUG_FUNCPTR (gst_xvimagesink_show_frame); - gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_xvimagesink_show_frame); gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_xvimagesink_event); + + videosink_class->show_frame = GST_DEBUG_FUNCPTR (gst_xvimagesink_show_frame); } /* ============================================================= */