diff options
author | Alessandro Decina <alessandro.decina@collabora.co.uk> | 2011-09-29 22:47:35 +0200 |
---|---|---|
committer | Alessandro Decina <alessandro.decina@collabora.co.uk> | 2011-09-29 22:47:35 +0200 |
commit | 2fd42800eced5dbacb3e60bcfc4e139adbf19d0a (patch) | |
tree | e8e7639f399a80065440c8ca14441414f874f995 | |
parent | 02e37cf3c1aaf9d6f75a9dd971334795c4660c15 (diff) |
viddec: more fixes to support 1d buffers
Don't detect TILEDPAGE memory as RAW. Set outbuf descs sizes in bytes when the
underlying memory is RAW or TILEDPAGE.
-rw-r--r-- | src/gstducati.c | 19 | ||||
-rw-r--r-- | src/gstducatividdec.c | 8 |
2 files changed, 17 insertions, 10 deletions
diff --git a/src/gstducati.c b/src/gstducati.c index 19ce3cd..2bdc904 100644 --- a/src/gstducati.c +++ b/src/gstducati.c @@ -87,15 +87,18 @@ gst_ducati_alloc_2d (gint width, gint height, guint * sz) XDAS_Int16 gst_ducati_get_mem_type (SSPtr paddr) { + XDAS_Int16 type = XDM_MEMTYPE_RAW; + if ((0x60000000 <= paddr) && (paddr < 0x68000000)) - return XDM_MEMTYPE_TILED8; - if ((0x68000000 <= paddr) && (paddr < 0x70000000)) - return XDM_MEMTYPE_TILED16; - if ((0x70000000 <= paddr) && (paddr < 0x78000000)) - return XDM_MEMTYPE_TILED32; - if ((0x78000000 <= paddr) && (paddr < 0x80000000)) - return XDM_MEMTYPE_RAW; - return -1; + type = XDM_MEMTYPE_TILED8; + else if ((0x68000000 <= paddr) && (paddr < 0x70000000)) + type = XDM_MEMTYPE_TILED16; + else if ((0x70000000 <= paddr) && (paddr < 0x78000000)) + type = XDM_MEMTYPE_TILED32; + else if ((0x78000000 <= paddr) && (paddr < 0x80000000)) + type = XDM_MEMTYPE_TILEDPAGE; + + return type; } /* PACKAGE: this is usually set by autotools depending on some _INIT macro diff --git a/src/gstducatividdec.c b/src/gstducatividdec.c index 46adc67..39607f1 100644 --- a/src/gstducatividdec.c +++ b/src/gstducatividdec.c @@ -204,7 +204,7 @@ codec_prepare_outbuf (GstDucatiVidDec * self, GstBuffer * buf) y_type = gst_ducati_get_mem_type (y_paddr); uv_type = gst_ducati_get_mem_type (uv_paddr); - if (y_type < 0) { + if (y_type == XDM_MEMTYPE_RAW || uv_type == XDM_MEMTYPE_RAW) { GST_DEBUG_OBJECT (self, "non TILER buffer, fallback to bufferpool"); return codec_prepare_outbuf (self, codec_bufferpool_get (self, buf)); } @@ -213,9 +213,13 @@ codec_prepare_outbuf (GstDucatiVidDec * self, GstBuffer * buf) /* initialize output buffer type */ self->outBufs->numBufs = 2; self->outBufs->descs[0].memType = y_type; + self->outBufs->descs[1].memType = uv_type; + if (y_type == XDM_MEMTYPE_RAW || y_type == XDM_MEMTYPE_TILEDPAGE) { + self->outBufs->descs[0].bufSize.bytes = self->stride * self->padded_height; + self->outBufs->descs[1].bufSize.bytes = self->stride * self->padded_height / 2; + } self->outBufs->descs[0].bufSize.tileMem.width = self->padded_width; self->outBufs->descs[0].bufSize.tileMem.height = self->padded_height; - self->outBufs->descs[1].memType = uv_type; /* note that UV interleaved width is same a Y: */ self->outBufs->descs[1].bufSize.tileMem.width = self->padded_width; self->outBufs->descs[1].bufSize.tileMem.height = self->padded_height / 2; |