summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ed1131f)
raw | patch | inline | side by side (parent: ed1131f)
author | Rob Clark <rob@ti.com> | |
Thu, 14 Jun 2012 00:27:13 +0000 (19:27 -0500) | ||
committer | Rob Clark <rob@ti.com> | |
Thu, 14 Jun 2012 00:33:08 +0000 (19:33 -0500) |
Use GstDRMBufferPool instead of own private bufferpool, and use
dmabuf to import buffers (either allocated by our bufferpool or
by downstream element) and qdata to attach our own private data
to the buffer. In this way the differences in code path between
using our own buffers and a downstream element's buffers is
minimized.
dmabuf to import buffers (either allocated by our bufferpool or
by downstream element) and qdata to attach our own private data
to the buffer. In this way the differences in code path between
using our own buffers and a downstream element's buffers is
minimized.
src/Makefile.am | patch | blob | history | |
src/gstducatibuffer.c | [deleted file] | patch | blob | history |
src/gstducatibuffer.h | [deleted file] | patch | blob | history |
src/gstducatibufferpool.c | [deleted file] | patch | blob | history |
src/gstducatibufferpool.h | [deleted file] | patch | blob | history |
src/gstducatibufferpriv.c | [new file with mode: 0644] | patch | blob |
src/gstducatibufferpriv.h | [new file with mode: 0644] | patch | blob |
src/gstducatidrmbuffer.c | [deleted file] | patch | blob | history |
src/gstducatidrmbuffer.h | [deleted file] | patch | blob | history |
src/gstducatividdec.c | patch | blob | history | |
src/gstducatividdec.h | patch | blob | history |
diff --git a/src/Makefile.am b/src/Makefile.am
index eaa8cf1c4ca12b5a42e2ec7c5a7b800dd995e5e7..fcb2c82c0bbd196e0f87a84e734d82c9862d03fd 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
gstducatih264enc.h \
gstducatimpeg4enc.h \
gstducatividenc.h \
- gstducatibufferpool.h \
- gstducatibuffer.h \
- gstducatidrmbuffer.h \
+ gstducatibufferpriv.h \
gstducati.h
# sources used to compile this plug-in
gstducatimpeg4dec.c \
gstducatih264dec.c \
gstducatividdec.c \
- gstducatibufferpool.c \
- gstducatibuffer.c \
- gstducatidrmbuffer.c \
+ gstducatibufferpriv.c \
gstducati.c \
$(noinst_HEADERS)
# compiler and linker flags used to compile this plugin, set in configure.ac
-libgstducati_la_CFLAGS = $(GST_CFLAGS) $(MEMMGR_CFLAGS) $(LIBDCE_CFLAGS) -DGST_USE_UNSTABLE_API
-libgstducati_la_LIBADD = $(GST_LIBS) $(MEMMGR_LIBS) $(LIBDCE_LIBS) -lgstvideo-0.10 -lgstbasevideo-0.10
-libgstducati_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(GST_ALL_LDFLAGS) --no-undefined
+libgstducati_la_CFLAGS = \
+ $(GST_CFLAGS) \
+ $(LIBDCE_CFLAGS) \
+ -DGST_USE_UNSTABLE_API
+
+libgstducati_la_LIBADD = \
+ $(GST_LIBS) \
+ $(LIBDCE_LIBS) \
+ -lgstdmabuf-0.10 \
+ -lgstdrm-0.10 \
+ -lgstvideo-0.10 \
+ -lgstbasevideo-0.10
+
+libgstducati_la_LDFLAGS = \
+ $(GST_PLUGIN_LDFLAGS) \
+ $(GST_ALL_LDFLAGS) \
+ --no-undefined
+
libgstducati_la_LIBTOOLFLAGS = --tag=disable-static
+
diff --git a/src/gstducatibuffer.c b/src/gstducatibuffer.c
--- a/src/gstducatibuffer.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * GStreamer
- *
- * Copyright (C) 2012 Texas Instruments
- * Copyright (C) 2012 Collabora Ltd
- *
- * Authors:
- * Alessandro Decina <alessandro.decina@collabora.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "gstducatibuffer.h"
-#include "gstducatibufferpool.h"
-
-G_DEFINE_TYPE (GstDucatiBuffer, gst_ducati_buffer, GST_TYPE_BUFFER);
-G_DEFINE_TYPE (GstDucatiBufferAllocator, gst_ducati_buffer_allocator,
- GST_TYPE_MINI_OBJECT);
-
-GstDucatiBuffer *
-gst_ducati_buffer_new (GstDucatiBufferPool * pool)
-{
- GstDucatiBuffer *self = (GstDucatiBuffer *)
- gst_mini_object_new (GST_TYPE_DUCATI_BUFFER);
- gst_ducati_buffer_set_pool (self, pool);
-
- return self;
-}
-
-void
-gst_ducati_buffer_set_pool (GstDucatiBuffer * self, GstDucatiBufferPool * pool)
-{
-
- GST_LOG_OBJECT (pool->element, "creating buffer %p in pool %p", self, pool);
-
- self->pool = (GstDucatiBufferPool *)
- gst_mini_object_ref (GST_MINI_OBJECT (pool));
- self->remove_from_pool = FALSE;
-
- if (pool->caps)
- gst_buffer_set_caps (GST_BUFFER (self), pool->caps);
-}
-
-static void
-gst_ducati_buffer_finalize (GstDucatiBuffer * self)
-{
- GstDucatiBufferPool *pool = self->pool;
- gboolean resuscitated = FALSE;
-
- GST_LOG_OBJECT (pool->element, "finalizing buffer %p", self);
-
- resuscitated = gst_ducati_buffer_pool_put (pool, self);
- if (resuscitated)
- return;
-
- if (self->orig) {
- gst_buffer_unref (self->orig);
- self->orig = NULL;
- }
-
- GST_BUFFER_DATA (self) = NULL;
- gst_mini_object_unref (GST_MINI_OBJECT (pool));
-
- GST_MINI_OBJECT_CLASS (gst_ducati_buffer_parent_class)->finalize
- (GST_MINI_OBJECT (self));
-}
-
-static void
-gst_ducati_buffer_class_init (GstDucatiBufferClass * klass)
-{
- GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (klass);
-
- mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
- GST_DEBUG_FUNCPTR (gst_ducati_buffer_finalize);
-}
-
-static void
-gst_ducati_buffer_init (GstDucatiBuffer * buffer)
-{
-}
-
-/* Get the original buffer, or whatever is the best output buffer.
- * Consumes the input reference, produces the output reference
- */
-GstBuffer *
-gst_ducati_buffer_get (GstDucatiBuffer * self)
-{
- if (self->orig) {
- // TODO copy to orig buffer.. if needed.
- gst_buffer_unref (self->orig);
- self->orig = NULL;
- }
- return GST_BUFFER (self);
-}
-
-/* GstDucatiBufferAllocator */
-
-GstDucatiBufferAllocator *
-gst_ducati_buffer_allocator_new (void)
-{
- GstDucatiBufferAllocator *self = (GstDucatiBufferAllocator *)
- gst_mini_object_new (GST_TYPE_DUCATI_BUFFER_ALLOCATOR);
-
- return self;
-}
-
-static void
-gst_ducati_buffer_allocator_finalize (GstDucatiBufferAllocator * self)
-{
- GST_MINI_OBJECT_CLASS (gst_ducati_buffer_allocator_parent_class)->finalize
- (GST_MINI_OBJECT (self));
-}
-
-static void
-gst_ducati_buffer_allocator_class_init (GstDucatiBufferAllocatorClass * klass)
-{
- GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (klass);
-
- mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
- GST_DEBUG_FUNCPTR (gst_ducati_buffer_allocator_finalize);
-}
-
-static void
-gst_ducati_buffer_allocator_init (GstDucatiBufferAllocator * buffer)
-{
-}
diff --git a/src/gstducatibuffer.h b/src/gstducatibuffer.h
--- a/src/gstducatibuffer.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * GStreamer
- *
- * Copyright (C) 2012 Texas Instruments
- * Copyright (C) 2012 Collabora Ltd
- *
- * Authors:
- * Alessandro Decina <alessandro.decina@collabora.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef __GSTDUCATIBUFFER_H__
-#define __GSTDUCATIBUFFER_H__
-
-#include "gstducati.h"
-#include <gst/video/video.h>
-
-G_BEGIN_DECLS
-
-#define GST_TYPE_DUCATI_BUFFER (gst_ducati_buffer_get_type())
-#define GST_IS_DUCATI_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DUCATI_BUFFER))
-#define GST_DUCATI_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DUCATI_BUFFER, GstDucatiBuffer))
-
-#define GST_TYPE_DUCATI_BUFFER_ALLOCATOR (gst_ducati_buffer_allocator_get_type())
-#define GST_IS_DUCATI_BUFFER_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DUCATI_BUFFER_ALLOCATOR))
-#define GST_DUCATI_BUFFER_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DUCATI_BUFFER_ALLOCATOR, GstDucatiBufferAllocator))
-#define GST_DUCATI_BUFFER_ALLOCATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_DUCATI_BUFFER_ALLOCATOR, GstDucatiBufferAllocatorClass))
-#define GST_DUCATI_BUFFER_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DUCATI_BUFFER_ALLOCATOR, GstDucatiBufferAllocatorClass))
-
-typedef struct _GstDucatiBufferAllocator GstDucatiBufferAllocator;
-typedef struct _GstDucatiBufferAllocatorClass GstDucatiBufferAllocatorClass;
-typedef struct _GstDucatiBuffer GstDucatiBuffer;
-typedef struct _GstDucatiBufferClass GstDucatiBufferClass;
-
-/* forward declaration */
-struct _GstDucatiBufferPool;
-
-struct _GstDucatiBufferAllocator
-{
- GstMiniObject mini_object;
-};
-
-struct _GstDucatiBufferAllocatorClass
-{
- GstMiniObjectClass klass;
-
- GstBuffer *(*alloc) (GstDucatiBufferAllocator * self,
- struct _GstDucatiBufferPool * pool);
- gboolean (*check_compatible) (GstDucatiBufferAllocator * allocator,
- GstBuffer * buffer);
- void (*setup_codec_output_buffers) (GstDucatiBufferAllocator * allocator,
- GstVideoFormat format, int width, int height, int stride, GstBuffer * buf,
- XDM2_BufDesc * bufs);
-};
-
-struct _GstDucatiBuffer {
- GstBuffer parent;
-
- struct _GstDucatiBufferPool *pool; /* buffer-pool that this buffer belongs to */
- GstBuffer *orig; /* original buffer, if we need to copy output */
- GstDucatiBuffer *next; /* next in freelist, if not in use */
- gboolean remove_from_pool;
-};
-
-struct _GstDucatiBufferClass {
- GstBufferClass klass;
-};
-
-GType gst_ducati_buffer_allocator_get_type (void);
-GstDucatiBufferAllocator *gst_ducati_buffer_allocator_new (void);
-
-GType gst_ducati_buffer_get_type (void);
-GstDucatiBuffer *gst_ducati_buffer_new (struct _GstDucatiBufferPool * pool);
-void gst_ducati_buffer_set_pool (GstDucatiBuffer * self, struct _GstDucatiBufferPool * pool);
-GstBuffer * gst_ducati_buffer_get (GstDucatiBuffer * self);
-
-G_END_DECLS
-
-#endif /* __GSTDUCATIBUFFER_H__ */
diff --git a/src/gstducatibufferpool.c b/src/gstducatibufferpool.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * GStreamer
- * Copyright (c) 2010, Texas Instruments Incorporated
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "gstducatibufferpool.h"
-#include <string.h>
-
-G_DEFINE_TYPE (GstDucatiBufferPool, gst_ducati_buffer_pool,
- GST_TYPE_MINI_OBJECT);
-
-GstDucatiBufferPool *
-gst_ducati_buffer_pool_new (GstElement * element,
- GstDucatiBufferAllocator * allocator, GstCaps * caps, guint size)
-{
- GstDucatiBufferPool *self = (GstDucatiBufferPool *)
- gst_mini_object_new (GST_TYPE_DUCATI_BUFFER_POOL);
- int i;
-
- self->element = gst_object_ref (element);
- self->allocator =
- GST_DUCATI_BUFFER_ALLOCATOR (gst_mini_object_ref (GST_MINI_OBJECT
- (allocator)));
- self->caps = NULL;
- gst_ducati_buffer_pool_set_caps (self, caps);
- self->size = size;
- self->head = NULL;
- self->tail = NULL;
- self->lock = g_mutex_new ();
- self->running = TRUE;
-
-
- for (i = 0; i < 5; i++) {
- GstDucatiBuffer *tmp = gst_ducati_buffer_pool_get (self, NULL, TRUE);
- gst_buffer_unref (GST_BUFFER_CAST (tmp));
- }
-
- return self;
-}
-
-void
-gst_ducati_buffer_pool_set_caps (GstDucatiBufferPool * self, GstCaps * caps)
-{
- gst_caps_replace (&self->caps, caps);
- if (caps) {
- GstStructure *s = gst_caps_get_structure (caps, 0);
-
- self->strided =
- !strcmp (gst_structure_get_name (s), "video/x-raw-yuv-strided");
-
- gst_structure_get_int (s, "width", &self->padded_width);
- gst_structure_get_int (s, "height", &self->padded_height);
- } else {
- self->padded_width = 0;
- self->padded_height = 0;
- self->strided = FALSE;
- }
-}
-
-/** destroy existing bufferpool */
-void
-gst_ducati_buffer_pool_destroy (GstDucatiBufferPool * self)
-{
- g_return_if_fail (self);
-
- GST_DUCATI_BUFFER_POOL_LOCK (self);
- self->running = FALSE;
-
- GST_DEBUG_OBJECT (self->element, "destroy pool");
-
- /* free all buffers on the freelist */
- while (self->head) {
- GstDucatiBuffer *buf = self->head;
- self->head = buf->next;
- buf->next = NULL;
- GST_DEBUG_OBJECT (self, "unreffing %p from freelist", buf);
- GST_DUCATI_BUFFER_POOL_UNLOCK (self);
- gst_buffer_unref (GST_BUFFER (buf));
- GST_DUCATI_BUFFER_POOL_LOCK (self);
- }
- self->tail = NULL;
- GST_DUCATI_BUFFER_POOL_UNLOCK (self);
- gst_mini_object_unref (GST_MINI_OBJECT (self));
-}
-
-#if 0
-static void
-dump_list (GstDucatiBufferPool * pool, GstDucatiBuffer * buf)
-{
- GST_ERROR_OBJECT (pool->element, "LIST");
- while (buf) {
- GST_ERROR_OBJECT (pool->element, "BUF: %p", buf);
- buf = buf->next;
- }
-}
-#endif
-
-/** get buffer from bufferpool, allocate new buffer if needed */
-GstDucatiBuffer *
-gst_ducati_buffer_pool_get (GstDucatiBufferPool * self, GstBuffer * orig,
- gboolean force_alloc)
-{
- GstDucatiBuffer *buf = NULL;
-
- g_return_val_if_fail (self, NULL);
-
- GST_DUCATI_BUFFER_POOL_LOCK (self);
- if (self->running) {
- /* re-use a buffer off the freelist if any are available
- */
- if (!force_alloc && self->head) {
-// dump_list (self, self->head);
- buf = self->head;
- self->head = buf->next;
- if (self->head == NULL)
- self->tail = NULL;
- } else {
- GstDucatiBufferAllocatorClass *alloc_class;
-
- alloc_class = GST_DUCATI_BUFFER_ALLOCATOR_GET_CLASS (self->allocator);
- buf = GST_DUCATI_BUFFER (alloc_class->alloc (self->allocator, self));
- }
- buf->orig = orig;
- if (self->caps)
- gst_buffer_set_caps (GST_BUFFER (buf), self->caps);
- }
- GST_DUCATI_BUFFER_POOL_UNLOCK (self);
-
- if (buf && orig) {
- GST_BUFFER_TIMESTAMP (buf) = GST_BUFFER_TIMESTAMP (orig);
- GST_BUFFER_DURATION (buf) = GST_BUFFER_DURATION (orig);
- }
-
- GST_LOG_OBJECT (self->element, "returning buf %p", buf);
-
- return buf;
-}
-
-gboolean
-gst_ducati_buffer_pool_put (GstDucatiBufferPool * self, GstDucatiBuffer * buf)
-{
- gboolean reuse = FALSE;
-
- if (buf->remove_from_pool)
- return FALSE;
-
- GST_DUCATI_BUFFER_POOL_LOCK (self);
- if (self->running) {
- reuse = TRUE;
-
- GST_LOG_OBJECT (self->element, "reviving buffer %p", buf);
- gst_buffer_ref (GST_BUFFER (buf));
-
- buf->next = NULL;
- if (self->tail)
- self->tail->next = buf;
- self->tail = buf;
- if (self->head == NULL)
- self->head = self->tail;
- buf->remove_from_pool = FALSE;
- } else {
- GST_INFO_OBJECT (self->element, "the pool is shutting down");
- buf->remove_from_pool = TRUE;
- }
- GST_DUCATI_BUFFER_POOL_UNLOCK (self);
-
- return reuse;
-}
-
-static void
-gst_ducati_buffer_pool_finalize (GstDucatiBufferPool * self)
-{
- g_mutex_free (self->lock);
- if (self->caps)
- gst_caps_unref (self->caps);
- gst_object_unref (self->element);
- gst_mini_object_unref (GST_MINI_OBJECT (self->allocator));
- GST_MINI_OBJECT_CLASS (gst_ducati_buffer_pool_parent_class)->finalize
- (GST_MINI_OBJECT (self));
-}
-
-static void
-gst_ducati_buffer_pool_class_init (GstDucatiBufferPoolClass * klass)
-{
- GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (klass);
-
- mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
- GST_DEBUG_FUNCPTR (gst_ducati_buffer_pool_finalize);
-}
-
-static void
-gst_ducati_buffer_pool_init (GstDucatiBufferPool * self)
-{
-}
diff --git a/src/gstducatibufferpool.h b/src/gstducatibufferpool.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * GStreamer
- * Copyright (c) 2010, Texas Instruments Incorporated
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef __GSTDUCATIBUFFERPOOL_H__
-#define __GSTDUCATIBUFFERPOOL_H__
-
-#include "gstducatibuffer.h"
-
-G_BEGIN_DECLS
-
-#define GST_TYPE_DUCATI_BUFFER_POOL (gst_ducati_buffer_pool_get_type())
-#define GST_IS_DUCATI_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DUCATI_BUFFER_POOL))
-#define GST_DUCATI_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DUCATI_BUFFER_POOL, GstDucatiBufferPool))
-
-#define GST_DUCATI_BUFFER_POOL_LOCK(self) g_mutex_lock ((self)->lock)
-#define GST_DUCATI_BUFFER_POOL_UNLOCK(self) g_mutex_unlock ((self)->lock)
-
-typedef struct _GstDucatiBufferPool GstDucatiBufferPool;
-typedef struct _GstDucatiBufferPoolClass GstDucatiBufferPoolClass;
-
-struct _GstDucatiBufferPool
-{
- GstMiniObject parent;
-
- GstDucatiBufferAllocator *allocator;
-
- /* output (padded) size including any codec padding: */
- gint padded_width, padded_height;
-
- gboolean strided; /* 2d buffers? */
- GstCaps *caps;
- GMutex *lock;
- gboolean running; /* with lock */
- GstElement *element; /* the element that owns us.. */
- GstDucatiBuffer *head; /* list of available buffers */
- GstDucatiBuffer *tail;
- guint size;
-};
-
-struct _GstDucatiBufferPoolClass
-{
- GstMiniObjectClass klass;
-};
-
-GType gst_ducati_buffer_pool_get_type (void);
-GstDucatiBufferPool * gst_ducati_buffer_pool_new (GstElement * element,
- GstDucatiBufferAllocator * allocator, GstCaps * caps, guint size);
-void gst_ducati_buffer_pool_destroy (GstDucatiBufferPool * pool);
-void gst_ducati_buffer_pool_set_caps (GstDucatiBufferPool * self, GstCaps * caps);
-GstDucatiBuffer * gst_ducati_buffer_pool_get (GstDucatiBufferPool * self,
- GstBuffer * orig, gboolean force_alloc);
-gboolean gst_ducati_buffer_pool_put (GstDucatiBufferPool * self, GstDucatiBuffer * buf);
-
-G_END_DECLS
-
-#endif /* __GSTDUCATIBUFFERPOOL_H__ */
diff --git a/src/gstducatibufferpriv.c b/src/gstducatibufferpriv.c
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * GStreamer
+ *
+ * Copyright (C) 2012 Texas Instruments
+ * Copyright (C) 2012 Collabora Ltd
+ *
+ * Authors:
+ * Alessandro Decina <alessandro.decina@collabora.co.uk>
+ * Rob Clark <rob.clark@linaro.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdint.h>
+#include <gst/gst.h>
+
+#include <omap_drm.h>
+#include <omap_drmif.h>
+#include <xf86drmMode.h>
+
+#include "gstducatibufferpriv.h"
+
+#define GST_DUCATI_BUFFER_PRIV_QUARK gst_ducati_buffer_priv_quark_get_type()
+static GST_BOILERPLATE_QUARK (GstDucatiBufferPriv, gst_ducati_buffer_priv_quark);
+
+#define DUCATI_BUFFER_PRIV_QUARK ducati_buffer_priv_quark_get_type()
+static GST_BOILERPLATE_QUARK (DucatiBufferPriv, ducati_buffer_priv_quark);
+
+void
+gst_ducati_buffer_priv_set (GstBuffer * buf, GstDucatiBufferPriv * priv)
+{
+ gst_buffer_set_qdata (buf, GST_DUCATI_BUFFER_PRIV_QUARK,
+ gst_structure_id_new (GST_DUCATI_BUFFER_PRIV_QUARK,
+ DUCATI_BUFFER_PRIV_QUARK, GST_TYPE_DUCATI_BUFFER_PRIV, priv, NULL));
+}
+
+GstDucatiBufferPriv *
+gst_ducati_buffer_priv_get (GstBuffer * buf)
+{
+ const GstStructure *s;
+ const GValue *val;
+
+ s = gst_buffer_get_qdata (buf, GST_DUCATI_BUFFER_PRIV_QUARK);
+ if (s == NULL)
+ return NULL;
+
+ val = gst_structure_id_get_value (s, DUCATI_BUFFER_PRIV_QUARK);
+ if (val == NULL)
+ return NULL;
+
+ return GST_DUCATI_BUFFER_PRIV (gst_value_get_mini_object (val));
+}
+
+GstDucatiBufferPriv *
+gst_ducati_buffer_priv_new (void)
+{
+ return (GstDucatiBufferPriv *) gst_mini_object_new (GST_TYPE_DUCATI_BUFFER_PRIV);
+}
+
+static void
+gst_ducati_buffer_priv_finalize (GstMiniObject * mini_obj)
+{
+ GstDucatiBufferPriv *priv = (GstDucatiBufferPriv *) mini_obj;
+
+ omap_bo_del (priv->bo);
+
+ /* not chaining up to GstMiniObject's finalize for now, we know it's empty */
+}
+
+GST_BOILERPLATE_MINI_OBJECT(GstDucatiBufferPriv, gst_ducati_buffer_priv);
+
+static void
+gst_ducati_buffer_priv_class_init (GstDucatiBufferPrivClass * klass)
+{
+ GST_MINI_OBJECT_CLASS (klass)->finalize = gst_ducati_buffer_priv_finalize;
+}
diff --git a/src/gstducatibufferpriv.h b/src/gstducatibufferpriv.h
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * GStreamer
+ *
+ * Copyright (C) 2012 Texas Instruments
+ * Copyright (C) 2012 Collabora Ltd
+ *
+ * Authors:
+ * Alessandro Decina <alessandro.decina@collabora.co.uk>
+ * Rob Clark <rob.clark@linaro.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __GSTDUCATIBUFFERPRIV_H__
+#define __GSTDUCATIBUFFERPRIV_H__
+
+#include <stdint.h>
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+#include <gst/dmabuf/dmabuf.h>
+
+/*
+ * per-buffer private data for gst-ducati
+ */
+
+#define GST_TYPE_DUCATI_BUFFER_PRIV \
+ (gst_ducati_buffer_priv_get_type ())
+#define GST_DUCATI_BUFFER_PRIV(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DUCATI_BUFFER_PRIV, GstDucatiBufferPriv))
+#define GST_IS_DUCATI_BUFFER_PRIV(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DUCATI_BUFFER_PRIV))
+
+typedef struct _GstDucatiBufferPriv GstDucatiBufferPriv;
+typedef struct _GstDucatiBufferPrivClass GstDucatiBufferPrivClass;
+
+
+struct _GstDucatiBufferPriv
+{
+ GstMiniObject parent;
+
+ struct omap_bo *bo;
+ gint uv_offset, size;
+};
+
+struct _GstDucatiBufferPrivClass
+{
+ GstMiniObjectClass parent_class;
+};
+
+
+GType gst_ducati_buffer_priv_get_type (void);
+
+void gst_ducati_buffer_priv_set (GstBuffer * buf, GstDucatiBufferPriv * priv);
+GstDucatiBufferPriv * gst_ducati_buffer_priv_get (GstBuffer * buf);
+GstDucatiBufferPriv * gst_ducati_buffer_priv_new (void);
+
+
+G_END_DECLS
+
+
+#endif /* __GSTDUCATIBUFFERPRIV_H__ */
diff --git a/src/gstducatidrmbuffer.c b/src/gstducatidrmbuffer.c
--- a/src/gstducatidrmbuffer.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * GStreamer
- *
- * Copyright (C) 2012 Texas Instruments
- * Copyright (C) 2012 Collabora Ltd
- *
- * Authors:
- * Alessandro Decina <alessandro.decina@collabora.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "gstducatidrmbuffer.h"
-#include "gstducatibufferpool.h"
-#include <omap_drm.h>
-#include <omap_drmif.h>
-
-G_DEFINE_TYPE (GstDucatiDRMBuffer, gst_ducati_drm_buffer,
- GST_TYPE_DUCATI_BUFFER);
-G_DEFINE_TYPE (GstDucatiDRMBufferAllocator, gst_ducati_drm_buffer_allocator,
- GST_TYPE_DUCATI_BUFFER_ALLOCATOR);
-
-static GstDucatiDRMBuffer *
-gst_ducati_drm_buffer_new (GstDucatiBufferPool * pool,
- struct omap_device *device)
-{
- GstDucatiDRMBuffer *self = (GstDucatiDRMBuffer *)
- gst_mini_object_new (GST_TYPE_DUCATI_DRM_BUFFER);
-
- self->device = device;
- gst_ducati_buffer_set_pool (GST_DUCATI_BUFFER (self), pool);
- gst_ducati_drm_buffer_setup_bos (self);
-
- return self;
-}
-
-void
-gst_ducati_drm_buffer_setup_bos (GstDucatiDRMBuffer * self)
-{
- GstDucatiBufferPool *pool = GST_DUCATI_BUFFER (self)->pool;
-
- if (pool->strided)
- g_assert (FALSE);
-
- self->bo[0] = omap_bo_new (self->device, pool->size, OMAP_BO_WC);
- self->bo[1] = 0;
- self->bo[2] = 0;
- self->bo[3] = 0;
-
- self->handles[0] = omap_bo_handle (self->bo[0]);
- self->handles[1] = self->handles[0];
- self->handles[2] = 0;
- self->handles[3] = 0;
-
- self->pitches[0] = pool->padded_width;
- self->pitches[1] = pool->padded_width;
- self->pitches[2] = 0;
- self->pitches[3] = 0;
-
- self->offsets[0] = 0;
- self->offsets[1] = self->pitches[0] * pool->padded_height;
- self->offsets[2] = 0;
- self->offsets[3] = 0;
-
- GST_BUFFER_DATA (self) = omap_bo_map (self->bo[0]);
- GST_BUFFER_SIZE (self) = pool->size;
-}
-
-static void
-gst_ducati_drm_buffer_finalize (GstDucatiDRMBuffer * self)
-{
- GstDucatiBuffer *ducati_buf = (GstDucatiBuffer *) self;
- GstDucatiBufferPool *pool = ducati_buf->pool;
- gboolean resuscitated = FALSE;
- int i;
-
- GST_LOG_OBJECT (pool->element, "finalizing buffer %p", self);
-
- resuscitated = gst_ducati_buffer_pool_put (pool, ducati_buf);
- if (resuscitated)
- return;
-
- GST_LOG_OBJECT (pool->element,
- "buffer %p (data %p, len %u) not recovered, freeing",
- self, GST_BUFFER_DATA (self), GST_BUFFER_SIZE (self));
-
- for (i = 0; i < G_N_ELEMENTS (self->bo); i++) {
- if (self->bo[i]) {
- omap_bo_del (self->bo[i]);
- self->bo[i] = 0;
- }
- }
-
- /* only chain up if the buffer isn't being reused */
- GST_MINI_OBJECT_CLASS (gst_ducati_drm_buffer_parent_class)->finalize
- (GST_MINI_OBJECT (self));
-}
-
-static void
-gst_ducati_drm_buffer_class_init (GstDucatiDRMBufferClass * klass)
-{
- GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (klass);
-
- mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
- GST_DEBUG_FUNCPTR (gst_ducati_drm_buffer_finalize);
-}
-
-static void
-gst_ducati_drm_buffer_init (GstDucatiDRMBuffer * buffer)
-{
-}
-
-GstDucatiDRMBufferAllocator *
-gst_ducati_drm_buffer_allocator_new (struct omap_device *device)
-{
- GstDucatiDRMBufferAllocator *self = (GstDucatiDRMBufferAllocator *)
- gst_mini_object_new (GST_TYPE_DUCATI_DRM_BUFFER_ALLOCATOR);
- self->device = device;
-
- return self;
-}
-
-static void
-gst_ducati_drm_buffer_allocator_finalize (GstDucatiDRMBufferAllocator * self)
-{
- GST_MINI_OBJECT_CLASS (gst_ducati_drm_buffer_allocator_parent_class)->finalize
- (GST_MINI_OBJECT (self));
-}
-
-static GstBuffer *
-allocator_alloc (GstDucatiBufferAllocator * allocator,
- GstDucatiBufferPool * pool)
-{
- GstDucatiDRMBufferAllocator *self =
- GST_DUCATI_DRM_BUFFER_ALLOCATOR (allocator);
- GstDucatiDRMBuffer *buf = gst_ducati_drm_buffer_new (pool, self->device);
- return GST_BUFFER_CAST (buf);
-}
-
-static gboolean
-allocator_check_compatible (GstDucatiBufferAllocator * allocator,
- GstBuffer * buffer)
-{
- static GType kms_type = -1;
- if (kms_type == -1)
- kms_type = g_type_from_name ("GstDucatiKMSBuffer");
-
- return GST_IS_DUCATI_DRM_BUFFER (buffer) ||
- (kms_type != -1 && G_TYPE_CHECK_INSTANCE_TYPE (buffer, kms_type));
-}
-
-static void
-allocator_setup_codec_output_buffers (GstDucatiBufferAllocator * allocator,
- GstVideoFormat format, int width, int height, int stride,
- GstBuffer * buffer, XDM2_BufDesc * bufs)
-{
- GstDucatiDRMBuffer *drmbuf = (GstDucatiDRMBuffer *) buffer;
- int uv_offset, size;
-
- uv_offset = gst_video_format_get_component_offset (format, 1, stride, height);
- size = gst_video_format_get_size (format, stride, height);
-
- bufs->numBufs = 2;
- bufs->descs[0].memType = XDM_MEMTYPE_BO;
- bufs->descs[0].buf = (XDAS_Int8 *) omap_bo_handle (drmbuf->bo[0]);
- bufs->descs[0].bufSize.bytes = uv_offset;
- bufs->descs[1].memType = XDM_MEMTYPE_BO_OFFSET;
- bufs->descs[1].buf = (XDAS_Int8 *) uv_offset;
- bufs->descs[1].bufSize.bytes = size - uv_offset;
-}
-
-static void
-gst_ducati_drm_buffer_allocator_class_init (GstDucatiDRMBufferAllocatorClass *
- klass)
-{
- GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (klass);
- GstDucatiBufferAllocatorClass *buffer_allocator_class =
- GST_DUCATI_BUFFER_ALLOCATOR_CLASS (klass);
-
- mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
- GST_DEBUG_FUNCPTR (gst_ducati_drm_buffer_allocator_finalize);
-
- buffer_allocator_class->alloc = allocator_alloc;
- buffer_allocator_class->check_compatible = allocator_check_compatible;
- buffer_allocator_class->setup_codec_output_buffers =
- allocator_setup_codec_output_buffers;
-}
-
-static void
-gst_ducati_drm_buffer_allocator_init (GstDucatiDRMBufferAllocator * allocator)
-{
-}
diff --git a/src/gstducatidrmbuffer.h b/src/gstducatidrmbuffer.h
--- a/src/gstducatidrmbuffer.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * GStreamer
- *
- * Copyright (C) 2012 Texas Instruments
- * Copyright (C) 2012 Collabora Ltd
- *
- * Authors:
- * Alessandro Decina <alessandro.decina@collabora.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef __GSTDUCATIBUFFERDRM_H__
-#define __GSTDUCATIBUFFERDRM_H__
-
-#include <stdint.h>
-
-#include "gstducatibuffer.h"
-
-G_BEGIN_DECLS
-
-#define GST_TYPE_DUCATI_DRM_BUFFER (gst_ducati_drm_buffer_get_type())
-#define GST_IS_DUCATI_DRM_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DUCATI_DRM_BUFFER))
-#define GST_DUCATI_DRM_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DUCATI_DRM_BUFFER, GstDucatiDRMBuffer))
-
-#define GST_TYPE_DUCATI_DRM_BUFFER_ALLOCATOR (gst_ducati_drm_buffer_allocator_get_type())
-#define GST_IS_DUCATI_DRM_BUFFER_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DUCATI_DRM_BUFFER_ALLOCATOR))
-#define GST_DUCATI_DRM_BUFFER_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_DUCATI_DRM_BUFFER_ALLOCATOR, GstDucatiDRMBufferAllocator))
-
-typedef struct _GstDucatiDRMBufferAllocator GstDucatiDRMBufferAllocator;
-typedef struct _GstDucatiDRMBufferAllocatorClass GstDucatiDRMBufferAllocatorClass;
-typedef struct _GstDucatiDRMBuffer GstDucatiDRMBuffer;
-typedef struct _GstDucatiDRMBufferClass GstDucatiDRMBufferClass;
-typedef struct _GstDucatiDRMBufferAllocator GstDucatiDRMBufferAllocator;
-typedef struct _GstDucatiDRMBufferAllocatorClass GstDucatiDRMBufferAllocatorClass;
-
-struct _GstDucatiDRMBuffer
-{
- GstDucatiBuffer parent;
- struct omap_bo *bo[4];
- uint32_t handles[4];
- uint32_t pitches[4];
- uint32_t offsets[4];
- struct omap_device *device;
-};
-
-struct _GstDucatiDRMBufferClass
-{
- GstDucatiBufferClass parent_class;
-};
-
-struct _GstDucatiDRMBufferAllocator
-{
- GstDucatiBufferAllocator parent;
- struct omap_device *device;
-};
-
-struct _GstDucatiDRMBufferAllocatorClass
-{
- GstDucatiBufferAllocatorClass parent_class;
-};
-
-GType gst_ducati_drm_buffer_get_type (void);
-void gst_ducati_drm_buffer_setup_bos (GstDucatiDRMBuffer *self);
-
-GType gst_ducati_drm_buffer_allocator_get_type (void);
-GstDucatiDRMBufferAllocator * gst_ducati_drm_buffer_allocator_new (struct omap_device *device);
-G_END_DECLS
-
-#endif /* __GSTDUCATIBUFFERDRM_H__ */
diff --git a/src/gstducatividdec.c b/src/gstducatividdec.c
index 4c961b06049a70d7e88d923995c17b89b1aa379b..22484269f666cdfe1cf81e9045591a31e40e45d2 100644 (file)
--- a/src/gstducatividdec.c
+++ b/src/gstducatividdec.c
#endif
#include "gstducatividdec.h"
-#include "gstducatidrmbuffer.h"
+#include "gstducatibufferpriv.h"
GST_BOILERPLATE (GstDucatiVidDec, gst_ducati_viddec, GstElement,
GST_TYPE_ELEMENT);
self->outArgs = NULL;
}
- if (self->allocator) {
- gst_mini_object_unref (GST_MINI_OBJECT (self->allocator));
- self->allocator = NULL;
- }
-
if (self->device) {
dce_deinit (self->device);
self->device = NULL;
GST_ERROR_OBJECT (self, "dce_init() failed");
return FALSE;
}
-
- self->allocator =
- GST_DUCATI_BUFFER_ALLOCATOR (gst_ducati_drm_buffer_allocator_new
- (self->device));
}
GST_DEBUG_OBJECT (self, "opening engine");
codec_delete (GstDucatiVidDec * self)
{
if (self->pool) {
- gst_ducati_buffer_pool_destroy (self->pool);
+ gst_drm_buffer_pool_destroy (self->pool);
self->pool = NULL;
}
self->padded_width, self->padded_height);
GST_DEBUG_OBJECT (self, "creating bufferpool");
- self->pool = gst_ducati_buffer_pool_new (GST_ELEMENT (self),
- self->allocator, GST_PAD_CAPS (self->srcpad), size);
+ self->pool = gst_drm_buffer_pool_new (GST_ELEMENT (self),
+ dce_get_fd (), GST_PAD_CAPS (self->srcpad), size);
}
- return GST_BUFFER (gst_ducati_buffer_pool_get (self->pool, buf, FALSE));
+ return GST_BUFFER (gst_drm_buffer_pool_get (self->pool, FALSE));
+}
+
+static GstDucatiBufferPriv *
+get_buffer_priv (GstDucatiVidDec * self, GstBuffer * buf)
+{
+ GstDucatiBufferPriv *priv = gst_ducati_buffer_priv_get (buf);
+ if (!priv) {
+ GstVideoFormat format = GST_VIDEO_FORMAT_NV12;
+ GstDmaBuf *dmabuf = gst_buffer_get_dma_buf (buf);
+
+ /* if it isn't a dmabuf buffer that we can import, then there
+ * is nothing we can do with it:
+ */
+ if (!dmabuf) {
+ GST_DEBUG_OBJECT (self, "not importing non dmabuf buffer");
+ return NULL;
+ }
+
+ priv = gst_ducati_buffer_priv_new ();
+
+ priv->bo = omap_bo_from_dmabuf (self->device,
+ gst_dma_buf_get_fd (dmabuf));
+
+ priv->uv_offset = gst_video_format_get_component_offset (format,
+ 1, self->stride, self->padded_height);
+ priv->size = gst_video_format_get_size (format,
+ self->stride, self->padded_height);
+
+ gst_ducati_buffer_priv_set (buf, priv);
+ }
+ return priv;
}
static XDAS_Int32
codec_prepare_outbuf (GstDucatiVidDec * self, GstBuffer ** buf,
gboolean force_internal)
{
- GstDucatiBufferAllocatorClass *alloc_class;
+ GstDucatiBufferPriv *priv = NULL;
+
+ if (!force_internal)
+ priv = get_buffer_priv (self, *buf);
- if (force_internal) {
+ if (!priv) {
GstBuffer *orig = *buf;
GST_DEBUG_OBJECT (self, "internal bufferpool forced");
return codec_prepare_outbuf (self, buf, FALSE);
}
- alloc_class = GST_DUCATI_BUFFER_ALLOCATOR_GET_CLASS (self->allocator);
- if (!alloc_class->check_compatible (self->allocator, *buf)) {
- GST_DEBUG_OBJECT (self, "non-ducati buffer, fallback to bufferpool");
- *buf = codec_buffer_pool_get (self, *buf);
- return codec_prepare_outbuf (self, buf, FALSE);
- }
-
- alloc_class->setup_codec_output_buffers (self->allocator,
- GST_VIDEO_FORMAT_NV12, self->padded_width, self->padded_height,
- self->stride, *buf, self->outBufs);
+ self->outBufs->numBufs = 2;
+ self->outBufs->descs[0].memType = XDM_MEMTYPE_BO;
+ self->outBufs->descs[0].buf = (XDAS_Int8 *) omap_bo_handle (priv->bo);
+ self->outBufs->descs[0].bufSize.bytes = priv->uv_offset;
+ self->outBufs->descs[1].memType = XDM_MEMTYPE_BO_OFFSET;
+ self->outBufs->descs[1].buf = (XDAS_Int8 *) priv->uv_offset;
+ self->outBufs->descs[1].bufSize.bytes = priv->size - priv->uv_offset;
return (XDAS_Int32) * buf; // XXX use lookup table
}
GST_INFO_OBJECT (self, "changing interlace field in caps");
gst_caps_set_simple (caps, "interlaced", G_TYPE_BOOLEAN, interlaced,
NULL);
- gst_ducati_buffer_pool_set_caps (self->pool, caps);
+ gst_drm_buffer_pool_set_caps (self->pool, caps);
if (!gst_pad_set_caps (self->srcpad, caps)) {
GST_ERROR_OBJECT (self,
"downstream didn't want to change interlace mode");
}
if (G_UNLIKELY (self->first_out_buffer) && send) {
- GstDucatiBufferPool *pool;
+ GstDRMBufferPool *pool;
self->first_out_buffer = FALSE;
/* Destroy the pool so the buffers we used so far are eventually released.
*/
pool = self->pool;
self->pool = NULL;
- gst_ducati_buffer_pool_destroy (pool);
+ gst_drm_buffer_pool_destroy (pool);
}
if (send) {
GstClockTime ts;
- if (GST_IS_DUCATI_BUFFER (outbuf)) {
- outbuf = gst_ducati_buffer_get (GST_DUCATI_BUFFER (outbuf));
- }
-
ts = GST_BUFFER_TIMESTAMP (outbuf);
GST_DEBUG_OBJECT (self, "got buffer: %d %p (%" GST_TIME_FORMAT ")",
diff --git a/src/gstducatividdec.h b/src/gstducatividdec.h
index 527e1e19d3cfbea59e2969d085e044f52b1f59f2..7bc2363a08c1039ab02cf404e45aac4d8c2c73aa 100644 (file)
--- a/src/gstducatividdec.h
+++ b/src/gstducatividdec.h
#include <omap_drmif.h>
#include "gstducati.h"
-#include "gstducatibufferpool.h"
+#include "gstducatibufferpriv.h"
+#include <gst/drm/gstdrmbufferpool.h>
#include <gst/video/video.h>
G_BEGIN_DECLS
GstPad *sinkpad, *srcpad;
- GstDucatiBufferAllocator *allocator;
- GstDucatiBufferPool *pool;
+ GstDRMBufferPool *pool;
/* minimum output size required by the codec: */
gint outsize;