summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fa832f2)
raw | patch | inline | side by side (parent: fa832f2)
author | Rob Clark <rob@ti.com> | |
Mon, 11 Jun 2012 14:55:34 +0000 (09:55 -0500) | ||
committer | Rob Clark <rob@ti.com> | |
Mon, 11 Jun 2012 14:55:34 +0000 (09:55 -0500) |
Instead use dmabuf fd's to share w/ other elements in the pipeline. This
way we don't need to share a common fd for the drm/omapdce device.
This reverts commit c115a41edd4abbc4784e6921e5a9c30a17b63dfa.
way we don't need to share a common fd for the drm/omapdce device.
This reverts commit c115a41edd4abbc4784e6921e5a9c30a17b63dfa.
src/gstducatividdec.c | patch | blob | history |
diff --git a/src/gstducatividdec.c b/src/gstducatividdec.c
index f6f98528766bb144bcdea4d63cf4b7240d37e231..4c961b06049a70d7e88d923995c17b89b1aa379b 100644 (file)
--- a/src/gstducatividdec.c
+++ b/src/gstducatividdec.c
#include "gstducatividdec.h"
#include "gstducatidrmbuffer.h"
-#include <gst/video/videocontext.h>
-typedef GstVideoContextInterface GstVideoContextClass;
-GST_BOILERPLATE_WITH_INTERFACE (GstDucatiVidDec, gst_ducati_viddec, GstElement,
- GST_TYPE_ELEMENT, GstVideoContext, GST_TYPE_VIDEO_CONTEXT,
- gst_ducati_video_context);
+GST_BOILERPLATE (GstDucatiVidDec, gst_ducati_viddec, GstElement,
+ GST_TYPE_ELEMENT);
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
{
gboolean ret;
int ec;
- const gchar *context_types[] = { "drm-fd", NULL };
- /* this will result in calling gst_ducati_viddec_set_video_context, and
- * therefore dce_set_fd, if the app or downstream elements provide a drm fd
- */
- gst_video_context_prepare (GST_VIDEO_CONTEXT (self), context_types);
+ if (G_UNLIKELY (self->engine)) {
+ return TRUE;
+ }
- self->device = dce_init ();
if (self->device == NULL) {
- GST_ERROR_OBJECT (self, "dce_init() failed");
- return FALSE;
- }
+ self->device = dce_init ();
+ if (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));
+ self->allocator =
+ GST_DUCATI_BUFFER_ALLOCATOR (gst_ducati_drm_buffer_allocator_new
+ (self->device));
+ }
GST_DEBUG_OBJECT (self, "opening engine");
self->engine = Engine_open ((String) "ivahd_vidsvr", NULL, &ec);
if (G_UNLIKELY (!self->engine)) {
GST_ERROR_OBJECT (self, "could not create engine");
- gst_mini_object_unref (GST_MINI_OBJECT (self->allocator));
- self->allocator = NULL;
- dce_deinit (self->device);
- self->device = NULL;
-
return FALSE;
}
self->padded_width, self->padded_height);
*forward = FALSE;
break;
- case GST_QUERY_CUSTOM:
- {
- const gchar **types;
- gint i;
- GstStructure *structure;
-
- structure = gst_query_get_structure (query);
- if (strcmp (gst_structure_get_name (structure), "prepare-video-context"))
- break;
-
- types = gst_video_context_query_get_supported_types (query);
- for (i = 0; types[i]; i++) {
- if (strcmp (types[i], "drm-fd"))
- continue;
-
- if (dce_get_fd () != -1) {
- gst_structure_set (structure,
- "video-context-type", G_TYPE_STRING, types[i],
- "video-context", G_TYPE_INT, dce_get_fd (), NULL);
- }
-
- break;
- }
-
- break;
- }
default:
break;
}
@@ -1358,27 +1324,3 @@ gst_ducati_viddec_init (GstDucatiVidDec * self, GstDucatiVidDecClass * klass)
self->device = NULL;
self->input_bo = NULL;
}
-
-static void
-gst_ducati_viddec_set_video_context (GstVideoContext * context,
- const gchar * type, const GValue * value)
-{
- int fd;
-
- fd = g_value_get_int (value);
- dce_set_fd (fd);
-}
-
-static void
-gst_ducati_video_context_interface_init (GstVideoContextInterface * iface)
-{
- iface->set_context = gst_ducati_viddec_set_video_context;
-}
-
-static gboolean
-gst_ducati_video_context_supported (GstDucatiVidDec * dec, GType type)
-{
- if (type == GST_TYPE_VIDEO_CONTEXT)
- return TRUE;
- return FALSE;
-}