summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b13405b)
raw | patch | inline | side by side (parent: b13405b)
author | Harinarayan Bhatta <harinarayan@ti.com> | |
Tue, 8 Apr 2014 10:13:24 +0000 (15:43 +0530) | ||
committer | Harinarayan Bhatta <harinarayan@ti.com> | |
Tue, 8 Apr 2014 10:13:24 +0000 (15:43 +0530) |
Increased to 4 from 2.
Signed-off-by: Harinarayan Bhatta <harinarayan@ti.com>
Signed-off-by: Harinarayan Bhatta <harinarayan@ti.com>
sys/kms/gstkmssink.c | patch | blob | history | |
sys/kms/gstkmssink.h | patch | blob | history |
diff --git a/sys/kms/gstkmssink.c b/sys/kms/gstkmssink.c
index 58b028d3bd81e9f6d882353c5f99a3d6c5099ec0..65ee71988c476c7993f58277d03a501cf53a6cc5 100644 (file)
--- a/sys/kms/gstkmssink.c
+++ b/sys/kms/gstkmssink.c
PROP_CONNECTOR_NAME,
};
+static inline void
+display_bufs_queue (GstKMSSink * sink, GstBuffer * buf)
+{
+ int i;
+ for (i = 0; i < (NUM_DISPLAY_BUFS - 1); i++)
+ gst_buffer_replace (&sink->display_bufs[i], sink->display_bufs[i + 1]);
+ gst_buffer_replace (&sink->display_bufs[i], buf);
+}
+
+static inline void
+display_bufs_free (GstKMSSink * sink)
+{
+ int i;
+ for (i = 0; i < NUM_DISPLAY_BUFS; i++)
+ gst_buffer_replace (&sink->display_bufs[i], NULL);
+}
+
static gboolean
gst_kms_sink_calculate_aspect_ratio (GstKMSSink * sink, gint width,
gint height, gint video_par_n, gint video_par_d)
if (ret)
goto set_plane_failed;
- gst_buffer_replace (&sink->last_buf, sink->display_buf);
- gst_buffer_replace (&sink->display_buf, buf);
+ display_bufs_queue (sink, buf);
out:
GST_INFO_OBJECT (sink, "exit");
- /* TODO: we probably want to unref after displaying the *next* frame */
if (buf)
gst_buffer_unref (buf);
return flow_ret;
sink->resources = NULL;
}
- gst_buffer_replace (&sink->last_buf, NULL);
- gst_buffer_replace (&sink->display_buf, NULL);
+ display_bufs_free (sink);
if (sink->dev) {
dce_deinit (sink->dev);
diff --git a/sys/kms/gstkmssink.h b/sys/kms/gstkmssink.h
index a7c8135885ffb31dc82b0e5399b939f3986a3753..7ae73f67b4acbb2de212cb278892707e35498a58 100644 (file)
--- a/sys/kms/gstkmssink.h
+++ b/sys/kms/gstkmssink.h
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_KMS_SINK))
#define GST_IS_KMS_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_KMS_SINK))
-
typedef struct _GstKMSSink GstKMSSink;
typedef struct _GstKMSSinkClass GstKMSSinkClass;
+#define NUM_DISPLAY_BUFS 4
+
struct _GstKMSSink
{
GstVideoSink videosink;
drmModePlane *plane;
GstDRMBufferPool *pool;
/* current displayed buffer and last displayed buffer: */
- GstBuffer *display_buf, *last_buf;
+ GstBuffer *display_bufs[NUM_DISPLAY_BUFS];
gboolean scale;
};