GStreamer 1.0: show preroll frames.

We need to implement the show_frame() function from GstVideoSink, which
handles both preroll and normal frames, instead of just
GstBaseSink.render(), which is called only for normal frames.
This was changed for GStreamer 0.10 by 3b20608f.

Change-Id: I4823a575d499cd0d6f9f4cb62e0420e070a05214
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
This commit is contained in:
Yoann Lopes
2015-03-23 12:07:47 +01:00
parent 6e7a3657dd
commit f3ee857564
2 changed files with 5 additions and 3 deletions

View File

@@ -415,12 +415,14 @@ void QGstVideoRendererSink::class_init(gpointer g_class, gpointer class_data)
sink_parent_class = reinterpret_cast<GstVideoSinkClass *>(g_type_class_peek_parent(g_class));
GstVideoSinkClass *video_sink_class = reinterpret_cast<GstVideoSinkClass *>(g_class);
video_sink_class->show_frame = QGstVideoRendererSink::show_frame;
GstBaseSinkClass *base_sink_class = reinterpret_cast<GstBaseSinkClass *>(g_class);
base_sink_class->get_caps = QGstVideoRendererSink::get_caps;
base_sink_class->set_caps = QGstVideoRendererSink::set_caps;
base_sink_class->propose_allocation = QGstVideoRendererSink::propose_allocation;
base_sink_class->stop = QGstVideoRendererSink::stop;
base_sink_class->render = QGstVideoRendererSink::render;
GstElementClass *element_class = reinterpret_cast<GstElementClass *>(g_class);
element_class->change_state = QGstVideoRendererSink::change_state;
@@ -517,7 +519,7 @@ gboolean QGstVideoRendererSink::stop(GstBaseSink *base)
return TRUE;
}
GstFlowReturn QGstVideoRendererSink::render(GstBaseSink *base, GstBuffer *buffer)
GstFlowReturn QGstVideoRendererSink::show_frame(GstVideoSink *base, GstBuffer *buffer)
{
VO_SINK(base);
return sink->delegate->render(buffer);

View File

@@ -153,7 +153,7 @@ private:
static gboolean stop(GstBaseSink *sink);
static GstFlowReturn render(GstBaseSink *sink, GstBuffer *buffer);
static GstFlowReturn show_frame(GstVideoSink *sink, GstBuffer *buffer);
private:
QVideoSurfaceGstDelegate *delegate;