From b03660850e781f27f24f9eaf8de713d4870ee0c2 Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Wed, 20 Sep 2017 17:23:33 +0900 Subject: [PATCH] Replaced mm_types.h with header of libmm-common Change-Id: I45b45827109735f15f96bab871ab33c6ca566855 --- configure.ac | 3 +++ packaging/gst-plugins-video-dec.spec | 1 + src/Makefile.am | 1 + src/gstnxvideodec.c | 19 ++++++++++--------- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index d65969e..64d21b3 100644 --- a/configure.ac +++ b/configure.ac @@ -68,6 +68,9 @@ PKG_CHECK_MODULES(GST, [ ]) ]) +PKG_CHECK_MODULES(MM_COMMON, mm-common) +AC_SUBST(MM_COMMON_CFLAGS) + dnl check if compiler understands -Wall (if yes, add -Wall to GST_CFLAGS) AC_MSG_CHECKING([to see if compiler understands -Wall]) save_CFLAGS="$CFLAGS" diff --git a/packaging/gst-plugins-video-dec.spec b/packaging/gst-plugins-video-dec.spec index 1094bee..020e044 100644 --- a/packaging/gst-plugins-video-dec.spec +++ b/packaging/gst-plugins-video-dec.spec @@ -13,6 +13,7 @@ BuildRequires: glibc-devel BuildRequires: gst-plugins-base-devel BuildRequires: nx-gst-meta-devel BuildRequires: nx-video-api-devel +BuildRequires: pkgconfig(mm-common) Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig diff --git a/src/Makefile.am b/src/Makefile.am index c617ebb..6e49c9d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -16,6 +16,7 @@ libgstnxvideodec_la_SOURCES = gstnxvideodec.c decoder.c # compiler and linker flags used to compile this plugin, set in configure.ac libgstnxvideodec_la_CFLAGS = \ $(GST_CFLAGS) \ + $(MM_COMMON_CFLAGS) \ -I$(includedir) libgstnxvideodec_la_LIBADD = \ diff --git a/src/gstnxvideodec.c b/src/gstnxvideodec.c index 4f862dd..252dafa 100644 --- a/src/gstnxvideodec.c +++ b/src/gstnxvideodec.c @@ -921,8 +921,7 @@ nxvideodec_mmvideobuf_copy (NX_V4L2DEC_OUT * pDecOut) memset ((void *) pMMVideoBuf, 0, sizeof (MMVideoBuffer)); if (1 == pDecOut->hImg.planes) { - pMMVideoBuf->type = MM_VIDEO_BUFFER_TYPE_GEM; - pMMVideoBuf->format = MM_PIXEL_FORMAT_I420; + pMMVideoBuf->type = MM_VIDEO_BUFFER_TYPE_TBM_BO; pMMVideoBuf->plane_num = 3; pMMVideoBuf->width[0] = pDecOut->hImg.width; pMMVideoBuf->height[0] = pDecOut->hImg.height; @@ -936,10 +935,11 @@ nxvideodec_mmvideobuf_copy (NX_V4L2DEC_OUT * pDecOut) pMMVideoBuf->size[0] = pDecOut->hImg.size[0]; pMMVideoBuf->data[0] = pDecOut->hImg.pBuffer[0]; pMMVideoBuf->handle_num = 1; - pMMVideoBuf->handle.gem[0] = pDecOut->hImg.flink[0]; - pMMVideoBuf->buffer_index = pDecOut->dispIdx; + /* TODO need to convert from gem name to bo + pMMVideoBuf->handle.bo[0] = pDecOut->hImg.flink[0]; + */ } else if (3 == pDecOut->hImg.planes) { - pMMVideoBuf->type = MM_VIDEO_BUFFER_TYPE_GEM; + pMMVideoBuf->type = MM_VIDEO_BUFFER_TYPE_TBM_BO; pMMVideoBuf->format = MM_PIXEL_FORMAT_I420; pMMVideoBuf->plane_num = 3; pMMVideoBuf->width[0] = pDecOut->hImg.width; @@ -954,10 +954,11 @@ nxvideodec_mmvideobuf_copy (NX_V4L2DEC_OUT * pDecOut) pMMVideoBuf->data[1] = pDecOut->hImg.pBuffer[1]; pMMVideoBuf->data[2] = pDecOut->hImg.pBuffer[2]; pMMVideoBuf->handle_num = 3; - pMMVideoBuf->handle.gem[0] = pDecOut->hImg.flink[0]; - pMMVideoBuf->handle.gem[1] = pDecOut->hImg.flink[1]; - pMMVideoBuf->handle.gem[2] = pDecOut->hImg.flink[2]; - pMMVideoBuf->buffer_index = pDecOut->dispIdx; + /* TODO need to convert from gem name to bo + pMMVideoBuf->handle.bo[0] = pDecOut->hImg.flink[0]; + pMMVideoBuf->handle.bo[1] = pDecOut->hImg.flink[1]; + pMMVideoBuf->handle.bo[2] = pDecOut->hImg.flink[2]; + */ } pMeta = gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY, -- 2.34.1