Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id DCA15E00B8B; Mon, 18 Jan 2016 01:50:53 -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 * [157.56.111.115 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] X-Greylist: delayed 853 seconds by postgrey-1.32 at yocto-www; Mon, 18 Jan 2016 01:50:50 PST Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0115.outbound.protection.outlook.com [157.56.111.115]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 0039EE00AB9 for ; Mon, 18 Jan 2016 01:50:50 -0800 (PST) Received: from BN3PR0301CA0055.namprd03.prod.outlook.com (10.160.152.151) by CY1PR0301MB1177.namprd03.prod.outlook.com (10.160.165.20) with Microsoft SMTP Server (TLS) id 15.1.365.19; Mon, 18 Jan 2016 09:36:34 +0000 Received: from BN1BFFO11OLC001.protection.gbl (2a01:111:f400:7c10::1:198) by BN3PR0301CA0055.outlook.office365.com (2a01:111:e400:401e::23) with Microsoft SMTP Server (TLS) id 15.1.365.19 via Frontend Transport; Mon, 18 Jan 2016 09:36:33 +0000 Authentication-Results: spf=permerror (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; Received-SPF: PermError (protection.outlook.com: domain of freescale.com used an invalid SPF mechanism) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11OLC001.mail.protection.outlook.com (10.58.145.12) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Mon, 18 Jan 2016 09:36:32 +0000 Received: from carol-OptiPlex-3020.ap.freescale.net (carol-OptiPlex-3020.ap.freescale.net [10.192.241.17]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u0I9aRIV016199; Mon, 18 Jan 2016 02:36:30 -0700 From: Yuqing Zhu To: Date: Mon, 18 Jan 2016 17:34:00 +0800 Message-ID: <1453109642-25548-2-git-send-email-b54851@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453109642-25548-1-git-send-email-b54851@freescale.com> References: <1453109642-25548-1-git-send-email-b54851@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11OLC001; 1:F0O/zlDpxRqe34LLr6MYySz3TYXoDOygevfgmpp8B/YMqTxeNWSd7APBmlaVWxiZOxJ4awdR9kQTH/Y2VV07uwfvoRkr4N+RVfk/CbQKPfY8elW+rLdyGolra+MCsEEmz8ZsqVIGDBVF2/LYXMd2sJGlTPbkNlXblYmrPXSCDm3psSLVXQV7ZDxazj3rTnuX/GGWgVo8Pq0wuqwcWJX4E/6Qwx2Li/EpNAlmKDDFcyH3pY0IiVxfFM5foUFwnpC1HGwTtshl2Z5+/LbYHUtFasrgSTVKeduJTD55J7j0EFajY+tJjzJGnm5I0MOleXpJ8rQf7U36MmBlEwPUVEkJ7oEBrHQL19gNKLCZl9BN/GzstNwR/bINd8Wic4IwkZXK534V8bKlus5SyvYfhSLOZjgrEr6wxODAoPDGxH2Yfcw= X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(448002)(199003)(189002)(110136002)(2351001)(450100001)(6806005)(5008740100001)(92566002)(5001960100002)(50226001)(5003940100001)(81156007)(97736004)(104016004)(1220700001)(4001430100002)(50466002)(77096005)(1096002)(229853001)(5890100001)(4326007)(230783001)(48376002)(2950100001)(2906002)(76176999)(33646002)(85326001)(107886002)(50986999)(189998001)(86362001)(19580395003)(106466001)(47776003)(19580405001)(87936001)(586003)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB1177; H:tx30smr01.am.freescale.net; FPR:; SPF:PermError; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 45292598-2553-476c-65c6-08d31feada2e X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1177; 2:y3Ar+xKnqgjhWesSg4ULz1qDxYUlrA6xpONz7FTygv6CSc/nK6gqhi9JVX8f/adrSo88OJ0KTg8wDxweovYzdgDWxriAiIkb0/iGcvq2u6n08w+Gr+VVRVatSLjdoQvdXpuM1XzbJvHHVAw/HkQT37VdoszqF4kWxbxjXZJ1gA92SHARMRP/0mDHw3UcZXWO; 3:cEOYlPH002nKLyDGHTE3Irg+qXvbk5tbiSAu53/NkZVu8KcHDxh62ckUW6+QBUDq/MAz2VlaFo+4qnwGXvckHTeYIIabQfKCImvqwzrXPOY/nZ5dFN19nIoJdDmG0F/hnY2gf68TcgWEiscTE8/QeLQjkFO9xxUYGbhZXwxIsrunA85htaXK+ySGn+FlFWyIh13XVbT5+DOcxTiqedgG5Y0KXSLX0oij+0DvV7EEK+c=; 25:wqDnuYQSUhL4/XUEcRWOzv/Rqh5nTalLTLOPKne1IkPdBd7oZjWTB/Q8YmpZq5qecgU6eYNXywPxvpFyG2V54IZna8lbs4KiliiZWK/pPwrGWjqvCHsoaSeGLwHnfhgb5KodAW1J2Gerj2BkAGDpGDFBzctx8KRN4wo8UXb5SQD6gDBJmL/i0+tn6mkkbMwnke88KbB+rECdhlo9jp3IOH6qoRYVmM5W0zeZCiPp5YKcx9PWqv/q0MT57dE7ezkG X-Exchange-Antispam-Report-Test: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB1177; UriScan:(101931422205132); X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1177; 20:r6zhtCJRTGJIDgEJO/PuQYibA3xMlKmJurJ7hRF8OZttG82ZMy1ODKWfXU2qQffuZ3/Fxc1GhujQV5eR8UrVy2odFcCQ0QIggwD4FzXcG+6tJkGT182X9hfinJOZ3CzW5VExjDMKeGLlZvEeood+iWxPHnGcHrYnCOetewdojaFSvpqhvR5+GnIMTy9j3MOcFwL8fBmsOX7pgboHJbxn+vWMcTdf4MR5Swhn+fNsSePe9LyHZzskjFj1Eum+r+9jL4UqOW2KDok63GJ/4lxqyZmXqGsGCbqdNbf/KucV3UIJerNKyhdk3/PN6Gl8TWkXP5ood2lqpD9O5zhv20R1pg7pKSCdGy1T21FSnGc9WXKDrrIIhyrNrDA+mIJeFm12q0GxBPTu/Mx8h5z6x96YoQgJg1LByMR1y6pw/w4l6rtKhgt4LypYUEU1WAq5U03p; 4:8+CJj08jn63y8kPqTWSmqg0OIihNjUglKUaUiW2RAkh5G0+ZV0sZvoI2IYEPLaYUFX29pNZuEHrZ0SKAhQohwFP4PbLzR3WVDcLgmXzPiXkePSD8CiNjYUKmkuvm/84wGvZzo+5EgH0KBaXeBdsCTOjNg8w+v/xHnOqQEL2q0vbUQDiCr8I+0G8j7G415nnm7Ig14Crv0+zXx/Yg0nKNEu4984Tyf54bI4NtGPg+JB6jlANWO6CZGYnR+0BfiheB0KkmENCF9HTMY/Hxpk5JLmlFdIuJc5EP7v+ctY29oOlAefCR99UzErMJqxR2rYjJ55la8Bi/cw3B6kjll/xqzi97pRnA6BAC2d2BEHrDxM9qdK5cDirN8crDl+bMX1iHWTDKPi+nAGA2qyrMaq8MsFeFhXi30qphA5U9jY9ygvaisr8cCoCJz3dvJw2pZhBW9LNEjhpLVsvM+WL0rlOcLL+IaKS5+NBodm7ULMLU9qc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(13018025)(520078)(13015025)(8121501046)(13017025)(10201501046)(3002001); SRVR:CY1PR0301MB1177; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB1177; X-Forefront-PRVS: 08252193F3 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1177; 23:wB3IE2SDi291Db/FiVyLu9unSlyZ4cGl1DyaVaI?= =?us-ascii?Q?Fus3YBOwnCZi3ck9cW5iG1pOaat0g19MguATKnnsUXnaIenw5iBrWHTwU5kT?= =?us-ascii?Q?k+PK5hblKFuKPhOEGnqDaYoz/c0/v2vheXFjuSL58DnTY99tACbgRh4OmREa?= =?us-ascii?Q?hoq5VuzBFA2DjVp8ckl6+SivfW9orBem15sdfsqKGnNxcxc/3sNmvCsWJBuq?= =?us-ascii?Q?IoV791NuTMCFUg8uc9PW8S47Ifg3jXe/JhWB1HAIV/ror8uLtyj5jkERkJLT?= =?us-ascii?Q?Z4yXKUGXnMnaGMhKe+HXJQ/RvWhilalMCT1jExTiDzvs2UVcAr2EMbySOLsL?= =?us-ascii?Q?Pxy/bBVuAf1AWNHxX0I1cidQPzEeNiTh/jhXtNYqrMLUSijcP02cwUknTvWf?= =?us-ascii?Q?+J9eQY0pA40r+nIor+xF5mvBaPvGyEUy/BqMHNZQ3TDLxlDrtv1ynydFXH7/?= =?us-ascii?Q?V4gAoinrM9eVkMMP3EU/gn/uOyvfCr+sklzHZmPFGfIILdqSXNYXVq566c/A?= =?us-ascii?Q?pMj1CEyMb9FWZNLsIrudeDAaIoYXy/kulvTsnVm46QqplPf7y3k7XB8Em/YB?= =?us-ascii?Q?gwC8hdJzZxpYvJgsyoFi0DaK5Fe6UT8IGSN93HswQXdWGhYNTWwtaZnK7I/Z?= =?us-ascii?Q?lUvDsjJawygKqyzknDAz/dNh7jhNyv0mn8BGRL3MMMzcsgQVkZtAWiziqwt1?= =?us-ascii?Q?yIPGqwjnzQy7XOP4CSpIP0Ed+vJsPgsOC6rmHI8Bxo1gI7ZeAYX08hhaJPI3?= =?us-ascii?Q?NLs8llXE4Tv7KCj6D2+klUd1BdtFMimAEyYLzilsumQdYHSFN5r+XV+q1vtB?= =?us-ascii?Q?GwNKBmHpGUEgpaWQmk2lHwRc4z6fAwYCXHHb2p4W/4zk5F1vIZ/+85XZ4c7K?= =?us-ascii?Q?6Ek4czJxOSE9Fpf4KsdRjKOaVlpKmOc1+EoSJl10X+kdUIKMKpOyL37pWTq3?= =?us-ascii?Q?maRAICwYe7BPzp+7pKMEpX0Leqzu7D3q8rdHWqY5Lf3zWEFIO+IdhX13bmWL?= =?us-ascii?Q?Gl/2UPoLkBzg6GRKTI/QOwdGKqxK61DufEPYTSRUkShWeriPul632LVLiVT1?= =?us-ascii?Q?KkMV6kfFSFlqQNSksTVTclFle+/6ufskipHdA9EgY++Dj6WXsJINuKP63rO7?= =?us-ascii?Q?TUdNE2/9+KcQc/awbPv2ms2l4J7SN1DYs?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1177; 5:hTXLoDS8pW0l2jDXGs6ubxZwFGnE+X3ctP6DRvKlwJ5xMRX6Sb1q50QE3BsIdZl5xH68bQwMADMvs66GJJBs65JI54EG1qfQJ2YdVpg86O0Y4UatQdK82GoZ30os9kiRt4ecypYNoce4ozcyqj5euw==; 24:ktb2ma7EMk+TwuweYMiDBiEaNvUDaQNb5JZ6toDvkB+y9KzKrE8p6Cg9gHp9IXJIrWxKKpBPncDcbzIQiyoXcsy73HxTpPabWbFmlgGEZ/w= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2016 09:36:32.4230 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1177 Subject: [meta-fsl-arm][PATCH 1/3] gstreamer1.0-plugins-base: Make memory copy when video buffer's memory is read only 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: Mon, 18 Jan 2016 09:50:53 -0000 Content-Type: text/plain Since gst_buffer_make_writable just lookup the refcount to determine if a buffer is writable, and it will use _gst_buffer_copy() which don't perform a deep memory copy even if the flag of a memory is set to GST_MEMORY_FLAG_READONLY. So, we detect the memory flag and use gst_buffer_copy_region with GST_BUFFER_COPY_DEEP parameter to perform deep memory copy. if the allocator of a memory don't support mem_copy interface, the it will return NULL, if this case, we can use gst_buffer_make_writable() to get a shared memory buffer or the orignal buffer if the buffer's refcount is 1. Signed-off-by: Yuqing Zhu --- ...rlay-make-memory-copy-when-video-buffer-s.patch | 80 ++++++++++++++++++++++ .../gstreamer/gstreamer1.0-plugins-base_%.bbappend | 7 +- 2 files changed, 85 insertions(+), 2 deletions(-) create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch new file mode 100755 index 0000000..eaff00f --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch @@ -0,0 +1,80 @@ +From 0092d07195aa5d950bc10dfb05bd9547f67028a3 Mon Sep 17 00:00:00 2001 +From: Mingke Wang +Date: Fri, 16 Oct 2015 19:31:32 +0800 +Subject: [PATCH 1/9] basetextoverlay: make memory copy when video buffer's + memory is ready only + +1. since gst_buffer_make_writable just lookup the refcount to determine if + a buffer is writable, and it will use _gst_buffer_copy() which don't + perform a deep memory copy even if the flag of a memory is set to + GST_MEMORY_FLAG_READONLY. So, we detect the memory flag and use + gst_buffer_copy_region with GST_BUFFER_COPY_DEEP parameter to perform + deep memory copy. if the allocator of a memory don't support mem_copy + interface, the it will return NULL, if this case, we can use + gst_buffer_make_writable() to get a shared memory buffer or the orignal + buffer if the buffer's refcount is 1. + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Mingke Wang +--- + ext/pango/gstbasetextoverlay.c | 32 ++++++++++++++++++++++++++++++-- + 1 file changed, 30 insertions(+), 2 deletions(-) + mode change 100644 => 100755 ext/pango/gstbasetextoverlay.c + +diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c +old mode 100644 +new mode 100755 +index bde4303..3e98aa1 +--- a/ext/pango/gstbasetextoverlay.c ++++ b/ext/pango/gstbasetextoverlay.c +@@ -2085,16 +2085,44 @@ gst_base_text_overlay_push_frame (GstBaseTextOverlay * overlay, + if (gst_pad_check_reconfigure (overlay->srcpad)) + gst_base_text_overlay_negotiate (overlay, NULL); + +- video_frame = gst_buffer_make_writable (video_frame); +- + if (overlay->attach_compo_to_buffer) { + GST_DEBUG_OBJECT (overlay, "Attaching text overlay image to video buffer"); ++ video_frame = gst_buffer_make_writable (video_frame); + gst_buffer_add_video_overlay_composition_meta (video_frame, + overlay->composition); + /* FIXME: emulate shaded background box if want_shading=true */ + goto done; + } + ++ gint idx = 0; ++ gboolean mem_rdonly = FALSE; ++ GstMemory *mem; ++ guint n = gst_buffer_n_memory(video_frame); ++ while ((idx < n) && (mem = gst_buffer_get_memory(video_frame, idx++))) { ++ if (GST_MEMORY_IS_READONLY(mem)) { ++ gst_memory_unref (mem); ++ mem_rdonly = TRUE; ++ break; ++ } ++ gst_memory_unref (mem); ++ } ++ ++ if (mem_rdonly) { ++ GstBuffer *new_buf = gst_buffer_copy_region (video_frame, ++ GST_BUFFER_COPY_ALL | GST_BUFFER_COPY_DEEP, 0, -1); ++ ++ if (!new_buf) { ++ GST_WARNING_OBJECT(overlay, ++ "buffer memory read only, but copy memory failed"); ++ goto done; ++ } else { ++ gst_buffer_unref (video_frame); ++ video_frame = new_buf; ++ } ++ } else { ++ video_frame = gst_buffer_make_writable (video_frame); ++ } ++ + if (!gst_video_frame_map (&frame, &overlay->info, video_frame, + GST_MAP_READWRITE)) + goto invalid_frame; +-- +1.9.1 + diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend index ff4d77b..3e72175 100644 --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend @@ -1,7 +1,10 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" -SRC_URI_append_mx6 = " file://gstplaybin-remove-flag-deinterlace.patch" -SRC_URI_append_mx7 = " file://gstplaybin-remove-flag-deinterlace.patch" +IMX_PATCHES = " file://gstplaybin-remove-flag-deinterlace.patch \ + file://0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \ +" +SRC_URI_append_mx6 = "${IMX_PATCHES}" +SRC_URI_append_mx7 = "${IMX_PATCHES}" PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}" PACKAGE_ARCH_mx7 = "${MACHINE_SOCARCH}" -- 1.9.1