Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id A5B43E0109B; Thu, 22 Dec 2016 02:27:03 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [104.47.33.61 listed in list.dnswl.org] * -0.0 SPF_HELO_PASS SPF: HELO matches SPF record * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0061.outbound.protection.outlook.com [104.47.33.61]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 4B92BE00A1E for ; Thu, 22 Dec 2016 02:26:59 -0800 (PST) Received: from DM5PR03CA0020.namprd03.prod.outlook.com (10.175.104.30) by MWHPR03MB2479.namprd03.prod.outlook.com (10.169.200.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14; Thu, 22 Dec 2016 10:26:57 +0000 Received: from BN1BFFO11FD032.protection.gbl (2a01:111:f400:7c10::1:198) by DM5PR03CA0020.outlook.office365.com (2603:10b6:3:118::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.11 via Frontend Transport; Thu, 22 Dec 2016 10:26:57 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; nxp.com; dmarc=fail action=none header.from=nxp.com; nxp.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD032.mail.protection.outlook.com (10.58.144.95) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Thu, 22 Dec 2016 10:26:57 +0000 Received: from shlinux22.ap.freescale.net (shlinux22.ap.freescale.net [10.192.242.129]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uBMAQofY032227; Thu, 22 Dec 2016 03:26:55 -0700 From: Yuqing Zhu To: Date: Thu, 22 Dec 2016 18:26:38 +0800 Message-ID: <1482402402-23406-3-git-send-email-carol.zhu@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1482402402-23406-1-git-send-email-carol.zhu@nxp.com> References: <1482402402-23406-1-git-send-email-carol.zhu@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131268760173974368; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39410400002)(39840400002)(39860400002)(39380400002)(39850400002)(39400400002)(39450400003)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(8936002)(86362001)(110136003)(68736007)(2950100002)(47776003)(77096006)(6666003)(356003)(85426001)(305945005)(6916009)(5660300001)(106466001)(8656002)(33646002)(2906002)(105606002)(4326007)(92566002)(50986999)(230783001)(36756003)(2351001)(626004)(104016004)(50226002)(48376002)(81156014)(81166006)(38730400001)(8676002)(50466002)(76176999)(189998001)(5003940100001)(97736004)(7059030)(2004002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2479; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD032; 1:A8VMMGOae0ICJR9t+sCtvaTVRtwPVyyhAJBFeIFtfcAd70YK8mZniRayYKCj9H374lVb+xkZDiQS0QFFoZ/EwSexlRewWUqn7JaTM/gowpNkECgPzFWoShvVYh62gBzhKZpATwiZP7Gx/6Wn7+L2Ge3dKCWROfQiUADPt+3UpCx2uXySVEYqfwv6hcrlx5i8E3vquCOk+2CzdDLT/1EvyUg1l0EvhvUahHEhi4v3+yFkBP0hNz7kbQzH8HoJFW660hDs2DZHrPUx/cs2iwjSQEZ5yg0qEme9bm4XRlBdnULGLf2kgIupz9ECz7dLUu23ILMofz+8K3y1s9IgjOE8TL6/0k27ZIHdNQ/VAzxeuDWFjG33PZjBN8lgFlxhkDRC+fj9OUcz2NcVmjh5nut1oUsSK2kze6BsT7TyhuQZMr9drWHvHzZkmJ4MJJ6iZdF7er2s80Bg+jBQMP0tUFYYLGA8btQGWyfig/CAcmgFrwe9QVuSFTw05cvrLKlzI4dRJLGbaHtXy+qQZFuN6bUC74TQgJGhjKdcqXLodIjTZEBHyVS//kvjnd3S4qEmpHZwWV4VlSojXAO1UBI4kE50R8njyZWHnKFZP+KA5EgMEzjwsTVQA8Xnn/ci0fNb1OQQasoihQxu01aW/qXFelZ8Kb/m3c17ZcYDRmyjBnANKpx/h0H4q6xf825V0okGa2r3LbDfAuQex1IGMlDoA4QzK3ml+YnjjRnszb6v+mbk1iY= MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: dc779d6e-416a-49da-26f7-08d42a550ea8 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:MWHPR03MB2479; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2479; 3:9E7gTSZ93L5rSfxcGF6+GH/GIJ/Zqb6yKMSCjghBjvXJibcPuM8b9VBZwtHtiq3Fvv5ayGvH0Cn+D6sF00wQ11vZ7hrPCP0Uq/P8jUpuKoRTAwjSnGNLBTx8ry8E7vNamReJ1BjGTPi02txDYFJLHcasF3Ue0LzKh0dXd9ATg+UkT4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7 X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2479; 31:eU+yqE/hh8Xtjs6HEoUh5CwfcyF2dYwiRyzHMmgrFNLa1n18YOucnrTu62UGdPrGCcS1Q8IdMa7mwkVPfStK7Y8rClGVpSNk/4pq+703VWN0xdI/SEdQSBCWEcQ7SBmubE8jxXqK+oeqGLVeZv7wpeGhKyu2g2XNCjzA87PsYVLPwWPYNwDUT4fJ5MiYUGeo0tffSk3VnEPpAg5aaykKmlpYwMH4nUI7SuMbXqRpln7qqPx9j1XlOYuKG/578Vaa10ylNXPKSw3p/KJ2s/TAnA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(5005006)(13018025)(13015025)(13023025)(13017025)(13024025)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123561025)(20161123565025)(20161123563025)(20161123556025)(20161123559025); SRVR:MWHPR03MB2479; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2479; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2479; 4:1aH47al4hmPVbYf6LuE/W6tvjex0n9JvyBhFsW1tDCQIK3YrPWKXA+G9k+uzRVD6+0GWbD2hk88lgNGI1EVBD0UARCrx0+NsOcsQZJ3jitrq3LbBlt9/hS66riPiAvjGp8J1XI61FiBYlqltfCaOI458/xMNpiSlPK47o1Zs+CVS376E45zyzjLlSIFJRgRpuupu2hXWHhnFkPrEV6y7JYmntCM/Ag8Q+Tb0vABVsV9HBzE3vxO0KZ2layaQbOaS3uM4emB2NiNl3V7Ca1CprA25A+BtVd/MRmtUodu+/uLf29fFFU4TwJ24uKjN162BD2MPyWD0zAAbrjTEn72o8hXy53eNNi2YatGx/tB1KBqeEb37RBBh1AKFLZmS6Pb3RpSimvAl+PDbbETq1yphQBYXJMxqZc42F7qHVBCYoh83MqM3KGRLbLgxKZZw/JS3hoUS8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eJcCBEVHTu/eJhBbhnaBShhJhpstpKpdxJ2N/tHsg9urYh6LgGyg4Y4W54H5/o9plhiuNkhVk91h2NL3jw9U0jUnVsITKhGbMpjX2NYLGYVEIUD5mJqnA7KI0zqEEVrqI2ImPo3TvI4dfuNhtT4hS0T889dCT9E7g== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2016 10:26:57.0854 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2479 Cc: Yuqing Zhu Subject: [PATCH 2/6] gstreamer1.0-plugins-bad: Add directviv to glimagesink to improve playback performance X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2016 10:27:03 -0000 Content-Type: text/plain 1.Add a physical buffer uploader in glupload plugin and using viv direct texture to bind physical continious buffer with texture to avoid memory copy from videobuffer to texture to gain good performance. 2.Reduce glimagesink load latency by override glimagesink ALLOCATION query to avoid memory copy. 3.Add configure check for directviv feature. Signed-off-by: Yuqing Zhu --- ...iv-to-glimagesink-to-improve-playback-per.patch | 535 +++++++++++++++++++++ .../gstreamer1.0-plugins-bad_1.10.%.bbappend | 1 + 2 files changed, 536 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-Add-directviv-to-glimagesink-to-improve-playback-per.patch diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-Add-directviv-to-glimagesink-to-improve-playback-per.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-Add-directviv-to-glimagesink-to-improve-playback-per.patch new file mode 100644 index 0000000..162bcbe --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-Add-directviv-to-glimagesink-to-improve-playback-per.patch @@ -0,0 +1,535 @@ +From 989d63bdf9397ba3630a3d6b9fc934b78ef62823 Mon Sep 17 00:00:00 2001 +From: Haihua Hu +Date: Tue, 13 Oct 2015 09:33:54 +0800 +Subject: [PATCH 12/26] Add directviv to glimagesink to improve playback + performance +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +1.Add a physical buffer uploader in glupload plugin and using viv direct + texture to bind physical continious buffer with texture to avoid memory + copy from videobuffer to texture to gain good performance. +2.Reduce glimagesink load latency by override glimagesink ALLOCATION query to + avoid memory copy. +3.Add configure check for directviv feature + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Haihua Hu +--- + configure.ac | 12 +++ + ext/gl/gstglimagesink.c | 5 ++ + gst-libs/gst/gl/Makefile.am | 8 ++ + gst-libs/gst/gl/gstglapi.h | 1 + + gst-libs/gst/gl/gstglupload.c | 151 +++++++++++++++++++++++++++++++- + gst-libs/gst/gl/gstglvivdirecttexture.c | 149 +++++++++++++++++++++++++++++++ + gst-libs/gst/gl/gstglvivdirecttexture.h | 38 ++++++++ + 7 files changed, 361 insertions(+), 3 deletions(-) + create mode 100644 gst-libs/gst/gl/gstglvivdirecttexture.c + create mode 100644 gst-libs/gst/gl/gstglvivdirecttexture.h + +diff --git a/configure.ac b/configure.ac +index 991e7d0..3dc2b75 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -701,6 +701,7 @@ HAVE_GLES2=no + HAVE_GLES3_H=no + HAVE_WAYLAND_EGL=no + HAVE_FB_EGL=no ++HAVE_DIRECTVIV=no + + HAVE_EGL_RPI=no + +@@ -740,6 +741,7 @@ case $host in + + dnl check fb backend for imx soc + AC_CHECK_LIB(EGL, fbGetDisplay, HAVE_FB_EGL=yes, HAVE_FB_EGL=no) ++ AC_CHECK_LIB(GLESv2, glTexDirectVIV, HAVE_DIRECTVIV=yes, HAVE_DIRECTVIV=no) + + dnl FIXME: Mali EGL depends on GLESv1 or GLESv2 + AC_CHECK_HEADER([EGL/fbdev_window.h], +@@ -850,6 +852,12 @@ if test "x$HAVE_GLES2" = "xno"; then + fi + fi + ++dnl specific for imx soc ++GST_GL_HAVE_DIRECTVIV=0 ++if test "x$HAVE_DIRECTVIV" = "xyes"; then ++ GST_GL_HAVE_DIRECTVIV=1 ++fi ++ + dnl X, GLX and OpenGL + if test "x$HAVE_X" = "xno"; then + if test "x$NEED_GLX" = "xyes"; then +@@ -1308,6 +1316,7 @@ GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES + + GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES + #define GST_GL_HAVE_DMABUF $GST_GL_HAVE_DMABUF ++#define GST_GL_HAVE_DIRECTVIV $GST_GL_HAVE_DIRECTVIV + " + + dnl Check for no platforms/window systems +@@ -1343,6 +1352,8 @@ if test "x$GL_APIS" = "x" -o "x$GL_PLATFORMS" = "x" -o "x$GL_WINDOWS" = "x"; the + HAVE_WINDOW_COCOA=no + HAVE_WINDOW_EAGL=no + HAVE_WINDOW_FB=no ++ ++ HAVE_DIRECTVIV=no + fi + + AC_SUBST(GL_LIBS) +@@ -1359,6 +1370,7 @@ AM_CONDITIONAL(HAVE_WINDOW_WAYLAND, test "x$HAVE_WINDOW_WAYLAND" = "xyes") + AM_CONDITIONAL(HAVE_WINDOW_ANDROID, test "x$HAVE_WINDOW_ANDROID" = "xyes") + AM_CONDITIONAL(HAVE_WINDOW_EAGL, test "x$HAVE_WINDOW_EAGL" = "xyes") + AM_CONDITIONAL(HAVE_WINDOW_FB, test "x$HAVE_WINDOW_FB" = "xyes") ++AM_CONDITIONAL(HAVE_DIRECTVIV, test "x$HAVE_DIRECTVIV" = "xyes") + + AM_CONDITIONAL(USE_OPENGL, test "x$USE_OPENGL" = "xyes") + AM_CONDITIONAL(USE_GLES2, test "x$USE_GLES2" = "xyes") +diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c +index 385e3e4..5da1012 100644 +--- a/ext/gl/gstglimagesink.c ++++ b/ext/gl/gstglimagesink.c +@@ -1139,6 +1139,11 @@ gst_glimage_sink_query (GstBaseSink * bsink, GstQuery * query) + res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query); + break; + } ++ case GST_QUERY_ALLOCATION: ++ { ++ gst_glimage_sink_propose_allocation(bsink, query); ++ break; ++ } + default: + res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query); + break; +diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am +index 01498e0..a6b9755 100644 +--- a/gst-libs/gst/gl/Makefile.am ++++ b/gst-libs/gst/gl/Makefile.am +@@ -36,6 +36,10 @@ libgstgl_@GST_API_VERSION@_la_SOURCES = \ + gstglquery.c \ + gstglcontrolbindingproxy.c + ++if HAVE_DIRECTVIV ++libgstgl_@GST_API_VERSION@_la_SOURCES += gstglvivdirecttexture.c ++endif ++ + libgstgl_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst/gl + libgstgl_@GST_API_VERSION@include_HEADERS = \ + gstglwindow.h \ +@@ -70,6 +74,10 @@ libgstgl_@GST_API_VERSION@include_HEADERS = \ + gstgl_enums.h \ + gl.h + ++if HAVE_DIRECTVIV ++libgstgl_@GST_API_VERSION@include_HEADERS += gstglvivdirecttexture.h ++endif ++ + noinst_HEADERS = \ + gstglsl_private.h \ + utils/opengl_versions.h \ +diff --git a/gst-libs/gst/gl/gstglapi.h b/gst-libs/gst/gl/gstglapi.h +index 3088920..2e9c561 100644 +--- a/gst-libs/gst/gl/gstglapi.h ++++ b/gst-libs/gst/gl/gstglapi.h +@@ -42,6 +42,7 @@ + # if GST_GL_HAVE_GLES3 + # include + # include ++# include + # else + # include + # include +diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c +index bfa5f22..2e52c3e 100644 +--- a/gst-libs/gst/gl/gstglupload.c ++++ b/gst-libs/gst/gl/gstglupload.c +@@ -27,6 +27,9 @@ + #include "gl.h" + #include "gstglupload.h" + ++#if GST_GL_HAVE_DIRECTVIV ++#include ++#endif + #if GST_GL_HAVE_PLATFORM_EGL + #include "egl/gstglmemoryegl.h" + #endif +@@ -51,7 +54,7 @@ + #define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0)) + #define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0)) + +-GST_DEBUG_CATEGORY_STATIC (gst_gl_upload_debug); ++GST_DEBUG_CATEGORY (gst_gl_upload_debug); + #define GST_CAT_DEFAULT gst_gl_upload_debug + + #define DEBUG_INIT \ +@@ -969,6 +972,144 @@ static const UploadMethod _upload_meta_upload = { + &_upload_meta_upload_free + }; + ++#if GST_GL_HAVE_DIRECTVIV ++struct PhyBufferUpload ++{ ++ GstGLUpload *upload; ++ GstGLVideoAllocationParams *params; ++}; ++ ++static gpointer ++_physical_buffer_upload_new(GstGLUpload *upload) ++{ ++ struct PhyBufferUpload *phybuffer = g_new0 (struct PhyBufferUpload, 1); ++ ++ phybuffer->upload = upload; ++ ++ return phybuffer; ++} ++ ++static GstCaps * ++_physical_buffer_upload_transform_caps(gpointer impl, GstGLContext *context, ++ GstPadDirection direction, GstCaps *caps) ++{ ++ GstCapsFeatures *passthrough = ++ gst_caps_features_from_string ++ (GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION); ++ GstCaps *ret; ++ ++ if (direction == GST_PAD_SINK) { ++ GstCaps *tmp; ++ ++ ret = ++ _set_caps_features_with_passthrough (caps, ++ GST_CAPS_FEATURE_MEMORY_GL_MEMORY, passthrough); ++ ++ gst_caps_set_simple (ret, "format", G_TYPE_STRING, "RGBA", NULL); ++ tmp = _caps_intersect_texture_target (ret, 1 << GST_GL_TEXTURE_TARGET_2D); ++ gst_caps_unref (ret); ++ ret = tmp; ++ } else { ++ ret = gst_caps_from_string (GST_VIDEO_CAPS_MAKE_WITH_FEATURES ++ (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY,GST_GL_DIRECTVIV_FORMAT)); ++ } ++ ++ gst_caps_features_free (passthrough); ++ return ret; ++} ++ ++static gboolean ++_physical_buffer_upload_accept(gpointer impl, GstBuffer *buffer, ++ GstCaps *in_caps, GstCaps *out_caps) ++{ ++ struct PhyBufferUpload *upload = impl; ++ GstCapsFeatures *features; ++ ++ features = gst_caps_get_features (out_caps, 0); ++ if (!gst_caps_features_contains (features, GST_CAPS_FEATURE_MEMORY_GL_MEMORY)) ++ return FALSE; ++ ++ if (upload->params) ++ gst_gl_allocation_params_free ((GstGLAllocationParams *) upload->params); ++ if (!(upload->params = ++ gst_gl_video_allocation_params_new (upload->upload->context, NULL, ++ &upload->upload->priv->out_info, -1, NULL, ++ GST_GL_TEXTURE_TARGET_2D, GST_VIDEO_GL_TEXTURE_TYPE_RGBA))) ++ return FALSE; ++ ++ return gst_is_physical_buffer(buffer); ++} ++ ++static void ++_physical_buffer_upload_propose_allocation(gpointer impl, GstQuery *decide_query, ++ GstQuery *query) ++{ ++ gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0); ++} ++ ++static GstGLUploadReturn ++_physical_buffer_upload_perform(gpointer impl, GstBuffer *buffer, GstBuffer **outbuf) ++{ ++ struct PhyBufferUpload *phyBuffer = impl; ++ GstGLMemoryAllocator *allocator; ++ GstVideoInfo *info; ++ gint n_mem; ++ ++ info = &phyBuffer->upload->priv->out_info; ++ n_mem = GST_VIDEO_INFO_N_PLANES (info); ++ GST_LOG_OBJECT (phyBuffer->upload, "Attempting viv direct upload, out format %s", ++ gst_video_format_to_string (GST_VIDEO_INFO_FORMAT (info))); ++ ++ allocator = ++ GST_GL_MEMORY_ALLOCATOR (gst_allocator_find ++ (GST_GL_MEMORY_PBO_ALLOCATOR_NAME)); ++ ++ /* FIXME: buffer pool */ ++ *outbuf = gst_buffer_new (); ++ gst_gl_memory_setup_buffer (allocator, *outbuf, phyBuffer->params, NULL, ++ NULL, 0); ++ gst_object_unref (allocator); ++ ++ GstGLMemory *out_gl_mem = ++ (GstGLMemory *) gst_buffer_peek_memory (*outbuf, 0); ++ ++ gst_gl_viv_direct_bind_gstbuffer(phyBuffer->upload->context, out_gl_mem->tex_id, ++ &phyBuffer->upload->priv->in_info, buffer); ++ ++ gst_buffer_add_video_meta_full (*outbuf, 0, ++ GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info), ++ GST_VIDEO_INFO_HEIGHT (info), n_mem, info->offset, info->stride); ++ ++ return GST_GL_UPLOAD_DONE; ++} ++ ++static void ++_physical_buffer_upload_free(gpointer impl) ++{ ++ struct PhyBufferUpload *phyBuffer = impl; ++ ++ if (phyBuffer->params) ++ gst_gl_allocation_params_free ((GstGLAllocationParams *) phyBuffer->params); ++ ++ g_free(phyBuffer); ++} ++ ++static GstStaticCaps _physical_buffer_upload_caps = ++GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (GST_GL_DIRECTVIV_FORMAT)); ++ ++static const UploadMethod _physical_buffer_upload = { ++ "Physical buffer", ++ 0, ++ &_physical_buffer_upload_caps, ++ &_physical_buffer_upload_new, ++ &_physical_buffer_upload_transform_caps, ++ &_physical_buffer_upload_accept, ++ &_physical_buffer_upload_propose_allocation, ++ &_physical_buffer_upload_perform, ++ &_physical_buffer_upload_free ++}; ++#endif /* GST_GL_HAVE_DIRECTVIV */ ++ + struct RawUploadFrame + { + gint ref_count; +@@ -1191,7 +1332,11 @@ static const UploadMethod *upload_methods[] = { &_gl_memory_upload, + #if GST_GL_HAVE_DMABUF + &_dma_buf_upload, + #endif +- &_upload_meta_upload, &_raw_data_upload ++ &_upload_meta_upload, ++#if GST_GL_HAVE_DIRECTVIV ++ &_physical_buffer_upload, ++#endif ++ &_raw_data_upload + }; + + static GMutex upload_global_lock; +@@ -1325,7 +1470,7 @@ gst_gl_upload_transform_caps (GstGLUpload * upload, GstGLContext * context, + } + + if (filter) { +- result = gst_caps_intersect_full (filter, tmp, GST_CAPS_INTERSECT_FIRST); ++ result = gst_caps_intersect_full (tmp, filter, GST_CAPS_INTERSECT_FIRST); + gst_caps_unref (tmp); + } else { + result = tmp; +diff --git a/gst-libs/gst/gl/gstglvivdirecttexture.c b/gst-libs/gst/gl/gstglvivdirecttexture.c +new file mode 100644 +index 0000000..4c9dc69 +--- /dev/null ++++ b/gst-libs/gst/gl/gstglvivdirecttexture.c +@@ -0,0 +1,149 @@ ++/* ++ * GStreamer ++ * Copyright (c) 2015, Freescale Semiconductor, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * 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 ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "gl.h" ++#include "gstglvivdirecttexture.h" ++#include ++ ++GST_DEBUG_CATEGORY_EXTERN (gst_gl_upload_debug); ++#define GST_CAT_DEFAULT gst_gl_upload_debug ++ ++typedef struct { ++ GstVideoFormat gst_fmt; ++ guint viv_fmt; ++} VIV_FMT_MAP; ++ ++static VIV_FMT_MAP viv_fmt_map_table[] = { ++ {GST_VIDEO_FORMAT_I420, GL_VIV_I420}, ++ {GST_VIDEO_FORMAT_YV12, GL_VIV_YV12}, ++ {GST_VIDEO_FORMAT_NV12, GL_VIV_NV12}, ++ {GST_VIDEO_FORMAT_NV21, GL_VIV_NV21}, ++ {GST_VIDEO_FORMAT_YUY2, GL_VIV_YUY2}, ++ {GST_VIDEO_FORMAT_UYVY, GL_VIV_UYVY}, ++ {GST_VIDEO_FORMAT_RGBA, GL_RGBA}, ++ {GST_VIDEO_FORMAT_RGBx, GL_RGBA}, ++ {GST_VIDEO_FORMAT_BGRA, GL_BGRA_EXT}, ++ {GST_VIDEO_FORMAT_RGB16, GL_RGB565_OES} ++}; ++ ++typedef struct { ++ guint tex_id; ++ guint w; ++ guint h; ++ guint fmt; ++ void *vaddr; ++ guint paddr; ++ gboolean ret; ++} GstVivDirectTexture; ++ ++gboolean ++gst_is_physical_buffer (GstBuffer *buffer) ++{ ++ return gst_buffer_is_phymem (buffer); ++} ++ ++static void ++_do_viv_direct_tex_bind_mem (GstGLContext * context, GstVivDirectTexture * viv_tex) ++{ ++ GST_DEBUG ("viv direct upload, tex_id %d, fmt: %d, res: (%dx%d)", viv_tex->tex_id, viv_tex->fmt, viv_tex->w, viv_tex->h); ++ GST_DEBUG ("Physical memory buffer, vaddr: %p, paddr: %p", viv_tex->vaddr, viv_tex->paddr); ++ ++ glBindTexture (GL_TEXTURE_2D, viv_tex->tex_id); ++ glTexDirectVIVMap (GL_TEXTURE_2D, viv_tex->w, viv_tex->h, viv_tex->fmt, &viv_tex->vaddr, &viv_tex->paddr); ++ glTexDirectInvalidateVIV (GL_TEXTURE_2D); ++ viv_tex->ret = TRUE; ++ ++ return; ++} ++ ++gst_gl_is_directviv_supported_format (GstVideoFormat fmt) ++{ ++ gint i; ++ gboolean ret = FALSE; ++ ++ for (i=0; istride[0]; ++ height = vmeta->offset[1] / width; ++ } ++ else { ++ width = GST_VIDEO_INFO_WIDTH (info); ++ height = GST_VIDEO_INFO_HEIGHT (info); ++ } ++ ++ return gst_gl_viv_direct_bind_data (context, tex_id, fmt, width, height, memblk->vaddr, memblk->paddr); ++} ++ +diff --git a/gst-libs/gst/gl/gstglvivdirecttexture.h b/gst-libs/gst/gl/gstglvivdirecttexture.h +new file mode 100644 +index 0000000..9a2d123 +--- /dev/null ++++ b/gst-libs/gst/gl/gstglvivdirecttexture.h +@@ -0,0 +1,38 @@ ++/* ++ * GStreamer ++ * Copyright (c) 2015, Freescale Semiconductor, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * 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 ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#ifndef __GST_GL_VIVDIRECT_H__ ++#define __GST_GL_VIVDIRECT_H__ ++ ++#include ++#include ++ ++#define GST_GL_DIRECTVIV_FORMAT "{RGBA, I420, YV12, NV12, NV21, YUY2, UYVY, BGRA, RGB16}" ++G_BEGIN_DECLS ++ ++gboolean gst_is_physical_buffer (GstBuffer *buffer); ++gboolean gst_gl_is_directviv_supported_format (GstVideoFormat fmt); ++gboolean gst_gl_viv_direct_bind_data (GstGLContext * context, guint tex_id, GstVideoFormat fmt, gint width, gint height, ++ gpointer * vaddr, gpointer *paddr); ++gboolean gst_gl_viv_direct_bind_gstbuffer (GstGLContext * context, guint tex_id, GstVideoInfo * info, GstBuffer * buffer); ++ ++G_END_DECLS ++ ++#endif /* __GST_GL_VIVDIRECT_H__ */ +-- +1.9.1 + diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend index fddeb3f..8812639 100644 --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.10.%.bbappend @@ -10,6 +10,7 @@ PACKAGECONFIG_GL_imxgpu3d = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', ' SRC_URI_append_imxgpu2d = " \ file://0001-glplugin-Change-wayland-default-res-to-1024x768.patch \ file://0002-Support-fb-backend-for-gl-plugins.patch \ + file://0003-Add-directviv-to-glimagesink-to-improve-playback-per.patch \ " -- 1.9.1