ximagesink, xvimagesink: use new GstVideoSink::show_frame() vfunc

This commit is contained in:
Tim-Philipp Müller 2009-09-08 17:43:26 +01:00
parent e2b4187fe3
commit 78b0413c5f
2 changed files with 13 additions and 9 deletions

View File

@ -1622,13 +1622,13 @@ gst_ximagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
} }
static GstFlowReturn static GstFlowReturn
gst_ximagesink_show_frame (GstBaseSink * bsink, GstBuffer * buf) gst_ximagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
{ {
GstXImageSink *ximagesink; GstXImageSink *ximagesink;
g_return_val_if_fail (buf != NULL, GST_FLOW_ERROR); 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 /* If this buffer has been allocated using our buffer management we simply
put the ximage which is in the PRIVATE pointer */ put the ximage which is in the PRIVATE pointer */
@ -1671,7 +1671,7 @@ gst_ximagesink_show_frame (GstBaseSink * bsink, GstBuffer * buf)
no_ximage: no_ximage:
{ {
/* No image available. That's very bad ! */ /* 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; return GST_FLOW_ERROR;
} }
no_window: no_window:
@ -2295,10 +2295,12 @@ gst_ximagesink_class_init (GstXImageSinkClass * klass)
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
GstBaseSinkClass *gstbasesink_class; GstBaseSinkClass *gstbasesink_class;
GstVideoSinkClass *videosink_class;
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass; gstbasesink_class = (GstBaseSinkClass *) klass;
videosink_class = (GstVideoSinkClass *) klass;
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
@ -2339,9 +2341,9 @@ gst_ximagesink_class_init (GstXImageSinkClass * klass)
gstbasesink_class->buffer_alloc = gstbasesink_class->buffer_alloc =
GST_DEBUG_FUNCPTR (gst_ximagesink_buffer_alloc); GST_DEBUG_FUNCPTR (gst_ximagesink_buffer_alloc);
gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_ximagesink_get_times); 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); gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_ximagesink_event);
videosink_class->show_frame = GST_DEBUG_FUNCPTR (gst_ximagesink_show_frame);
} }
/* ============================================================= */ /* ============================================================= */

View File

@ -2313,11 +2313,11 @@ gst_xvimagesink_get_times (GstBaseSink * bsink, GstBuffer * buf,
} }
static GstFlowReturn static GstFlowReturn
gst_xvimagesink_show_frame (GstBaseSink * bsink, GstBuffer * buf) gst_xvimagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
{ {
GstXvImageSink *xvimagesink; GstXvImageSink *xvimagesink;
xvimagesink = GST_XVIMAGESINK (bsink); xvimagesink = GST_XVIMAGESINK (vsink);
/* If this buffer has been allocated using our buffer management we simply /* If this buffer has been allocated using our buffer management we simply
put the ximage which is in the PRIVATE pointer */ put the ximage which is in the PRIVATE pointer */
@ -3368,10 +3368,12 @@ gst_xvimagesink_class_init (GstXvImageSinkClass * klass)
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
GstBaseSinkClass *gstbasesink_class; GstBaseSinkClass *gstbasesink_class;
GstVideoSinkClass *videosink_class;
gobject_class = (GObjectClass *) klass; gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass; gstbasesink_class = (GstBaseSinkClass *) klass;
videosink_class = (GstVideoSinkClass *) klass;
parent_class = g_type_class_peek_parent (klass); parent_class = g_type_class_peek_parent (klass);
@ -3490,9 +3492,9 @@ gst_xvimagesink_class_init (GstXvImageSinkClass * klass)
gstbasesink_class->buffer_alloc = gstbasesink_class->buffer_alloc =
GST_DEBUG_FUNCPTR (gst_xvimagesink_buffer_alloc); GST_DEBUG_FUNCPTR (gst_xvimagesink_buffer_alloc);
gstbasesink_class->get_times = GST_DEBUG_FUNCPTR (gst_xvimagesink_get_times); 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); gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_xvimagesink_event);
videosink_class->show_frame = GST_DEBUG_FUNCPTR (gst_xvimagesink_show_frame);
} }
/* ============================================================= */ /* ============================================================= */