diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-02-23 09:11:53 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-02-23 09:13:33 +0100 |
commit | 4b5f764dafe5a3a19082b5c66b7ed249098e3620 (patch) | |
tree | 1177012d3fa17f5699f54486e32377ec3b884f59 /sys | |
parent | 6325b062049c9dacbad605146559b70a464c9d6d (diff) | |
download | gstreamer-plugins-bad-4b5f764dafe5a3a19082b5c66b7ed249098e3620.tar.gz |
mfcdec: Use new GST_MEMORY_FLAG_CONTIGUOUS instead of requiring a specific memory type
Diffstat (limited to 'sys')
-rw-r--r-- | sys/mfc/gstmfcdec.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/sys/mfc/gstmfcdec.c b/sys/mfc/gstmfcdec.c index fe2c97a74..8911ce1c0 100644 --- a/sys/mfc/gstmfcdec.c +++ b/sys/mfc/gstmfcdec.c @@ -519,16 +519,30 @@ gst_mfc_dec_fill_outbuf (GstMFCDec * self, GstBuffer * outbuf, const guint8 *mfc_outbuf_comps[3] = { NULL, }; gint i, j, h, w, src_stride, dst_stride; guint8 *dst_, *src_; - GstMemory *mem; GstVideoFrame vframe; Fimc *fimc = self->fimc; gboolean zerocopy, has_cropping; memset (&vframe, 0, sizeof (vframe)); - zerocopy = (gst_buffer_n_memory (outbuf) == 1 - && (mem = gst_buffer_peek_memory (outbuf, 0)) - && strcmp (mem->allocator->mem_type, "GstEGLImage") == 0); + zerocopy = TRUE; + /* FIXME: Not 100% correct, we need the memory of each + * plane to be contiguous at least */ + if (GST_VIDEO_INFO_N_PLANES (&state->info) > gst_buffer_n_memory (outbuf)) { + zerocopy = FALSE; + } else { + gint n = gst_buffer_n_memory (outbuf); + + for (i = 0; i < n; i++) { + GstMemory *mem = gst_buffer_peek_memory (outbuf, i); + + if (!GST_MEMORY_IS_PHYSICALLY_CONTIGUOUS (mem)) { + zerocopy = FALSE; + break; + } + } + } + has_cropping = self->has_cropping && (self->width != self->crop_width || self->height != self->crop_height); |