Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id E17C9E00BAB; Fri, 29 Jan 2016 01:44:52 -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 SPF_HELO_PASS SPF: HELO matches SPF record * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [65.55.169.124 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0124.outbound.protection.outlook.com [65.55.169.124]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 4DD8CE00B9E for ; Fri, 29 Jan 2016 01:44:48 -0800 (PST) Received: from BN3PR0301CA0003.namprd03.prod.outlook.com (10.160.180.141) by CY1PR0301MB1179.namprd03.prod.outlook.com (10.160.165.22) with Microsoft SMTP Server (TLS) id 15.1.396.15; Fri, 29 Jan 2016 09:44:47 +0000 Received: from BL2FFO11FD049.protection.gbl (2a01:111:f400:7c09::183) by BN3PR0301CA0003.outlook.office365.com (2a01:111:e400:4000::13) with Microsoft SMTP Server (TLS) id 15.1.390.13 via Frontend Transport; Fri, 29 Jan 2016 09:44:47 +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 BL2FFO11FD049.mail.protection.outlook.com (10.173.161.211) with Microsoft SMTP Server (TLS) id 15.1.355.15 via Frontend Transport; Fri, 29 Jan 2016 09:44:46 +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 u0T9icv3012176; Fri, 29 Jan 2016 02:44:44 -0700 From: Yuqing Zhu To: Date: Fri, 29 Jan 2016 17:41:56 +0800 Message-ID: <1454060516-30420-3-git-send-email-b54851@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454060516-30420-1-git-send-email-b54851@freescale.com> References: <1454060516-30420-1-git-send-email-b54851@freescale.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD049; 1:eEZ8k4S7uYBwP217p4RhdJTCjqnmpZ4p4F6FimL0ho3rhL/HZrUjS/x2HmS72Ga7zXisZgo4fa6cIA7CsAvRNvXCfn7Q5xNUy0/BbPvCgbjGmUZm8z3SB/RXzuJ22P+oyK9ejrdU3BSSSSp/xK/G9aOsjZHrqLksK2YdxqmtsP9mAkI1zX0dXBgUJoqOmPhx8bGg5fQGgSNrdJkKilVhscif5Mk5aIMjTALvbUNvccIDj7XbU+FdqmUjDKX5gWJoSHKj01+k7Pixxud60ICYAGngP1InMZ/ECYD3+lkDgZDTpDK4L+B6qNvUN1S+OjmOqoguKHFH0KDPtXj0JXpyI5qGQ/cJKGkV7w+lvMF+2Sbn01Q6bKybT/gsu+hl5AFVc09KwaCo7Ogq8NKqd6wnGU1/8O6bc+Ol123w3UwAYFKfUdUDv/q/eOgL+aviJzFp8IrVxucNwgtGNz/fYgrdwKUTi2v3BAD50uqXWqE532o= X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(3190300001)(199003)(189002)(189998001)(50226001)(76176999)(6806005)(1096002)(586003)(50986999)(87936001)(11100500001)(1220700001)(4001430100002)(77096005)(15975445007)(92566002)(47776003)(104016004)(5008740100001)(2950100001)(86362001)(4326007)(50466002)(2870700001)(5001960100002)(110136002)(107886002)(23676002)(19580395003)(19580405001)(33646002)(3470700001)(2906002)(85326001)(229853001)(106466001)(2351001)(230783001)(5890100001)(5820100001)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB1179; H:tx30smr01.am.freescale.net; FPR:; SPF:PermError; MLV:sfv; A:1; MX:1; LANG:en; X-MS-Office365-Filtering-Correlation-Id: c790692a-0e63-48a7-eaa8-08d32890d2f9 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1179; 2:akCmrLsSxc/OlqD8Z2GDtaOZ7B28HoeEvCxoZDksNgqBAvoZrHwtR6X3Pom9IB3dbpD8YEF0OOAv3upRA2Ux6cOP+yN4u2Ff9K0X24nav5MBJvi/XCwdVbxUhR5+zGQ460rX0BxCinn0PrEJ9KpOF832R3mi4kwBLVi79SNEy/D3aqx2pOXUq1o63G0cb9pv; 3:MAiXEGlXjWiC9B4LFXgk+iAWd4+ZD5RnNbhSRnQYTCLMdA/wXst3esr9a3X99jQujv5zaspzITAGaAc3HVTSx/OJjdskups3C6mBNQqM+q6WhMUdnSisdH4+gIWdsgSqUPKumd37UZTqAcpw8YSwE6TJrMJoYvcHkKnLngNE5wAOuKLVDUhZ9kSuPjgUoHISX3/r+aXQKPTUifW9HW+6kt7Yl/hmAj3WDojCm61BkD4=; 25:L74v2BHxogbiMPVjh8I4ruEWRp61GQuXZBcY3vsknwjSWIayDXUW1kOnMRTU+o08bzboBSpoaEREzGkVJSkuCkc5EPK31qrubigeOxa5ZFCa676IVT2tdBIlicz982qbbyjYdkvSKhMq9qJNQQPV7V1mEF7TXDS0GFTa/yGC9k3kG1/9lHV8m2v++TbA6bo8RV8hf1SaXP5b+5g1Jpg9wZ74muO+CRwv+ekVx2whdkLg5JQZkV+fYSM1VzqwX3dF X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1179; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1179; 20:K7YjEv4Ms6GNRjS0pRpX4m5RgYo62k9UPBhDxYMCA4xtDOQFsUjkyyLOIWdj8VXEow+clu1+iMDzjV0Mo0XdCY2DrPiimg2Gqfnv3uebLSGPb3FJKEseXvKkpoVkyjRiKtjyBIChsQo6V0az1dnooBjMIuLukk/HtAruhHHoRdEaOhW1jgbREWHs3Tc8h6ZtE0PrRbgd78YxSaHBUb5tcrm+3mMWU7qRZbzYEUw9uJFPYbXpAXy16AAn3zRYk4FHAoO1u3vSBUAeitUN5Uobqv7xOZJg7GuYlT8wEZrRHZEM3qt/MkI2+qmrSk3N7JaD/wQF/KRrgQTWqifiv+sl6YGnAmj7q4PaaP8ifkOKxpojEngSWC/170y0z2Njr9fwXxkOerAjVB6Pj/Irr2rl4nBY6r1NHpIHvzd8dCb0M2MfgUeYtwJX3AhV0TdS4iMS; 4:190vOb71EML//kzUF4Xcso/XjiINLW+cYIZCFw7SSCYar9wi2oo6/uA1hxHt+Y0676d0c7iEexyoxskesFSPujTwmtpPqauv/GS7+6N/DPdbv3ppYp1H+VkJ9nz0pLOcqbTrSpgS3uGt10IwUNoTS8vJ1moPFtaAUeWVy3NRXI35QY6Sgrao377mC7oPuwmXZWwc5+Tvd+/M5ena/5mdqTmyfIJbtUe8x7XtsK0senb1qx2CXDSYn9EAHsayQ5cN8kuJdAzg/szC7LkPnEqvT1msj75YUKTcZXiwhm/pf9x5eWWftS1K139qYGtnEjpb4k1ewVSh1XFollp7uN5m3BaIZsWMeOdJ/YWCFSV3Up1/yFD7WjTTu/ofG6IL8Kc9SAew34/M6NPC1J+yJFabjO+i6w5aOz4tnmScRRrGZP3SgZiCT+WQDUYPiKPBpKsCVKlGmeBCv2LHE1TGpGo2s9djrCr06Pk8rWzfWG5843/AW0BmNydfuELKjEWxHAtU X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(13024025)(13023025)(8121501046)(13018025)(13015025)(13017025)(10201501046)(3002001); SRVR:CY1PR0301MB1179; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB1179; X-Forefront-PRVS: 083691450C X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjAzMDFNQjExNzk7MjM6MitkMENQRnVBVXJEbjNJb05qczBDMG1R?= =?utf-8?B?WHFsSVdHSzAwUkE4NmhFQ1BrS2dGWlZoQzZGYUw3NDdTamllV2xiTEd6aFJh?= =?utf-8?B?eE85dlcvWklGOG8zUkIrMEhFVS9pNGRDaStjaG5GTStBTDBMZW80TUhvOUdE?= =?utf-8?B?TWVxV3NEbHJ5WEgxcHBIN3VVUE1kMWxJemEzb3VLZGlZYk9yTk05clJNekRu?= =?utf-8?B?dWF1K2xQN3AwTjdSNTE4aGVTUDNyMjA5UGNnS1JqTXZJYjFHaDJGblJYZGZD?= =?utf-8?B?dkJHb2xCVTVvcWpIV2ZkOStTZ3ZVcTN6WmFSYkVPQSt5MjlQWWNBdGFCZ0cy?= =?utf-8?B?cjcwdTdHSEJraEVPUk9QSm8rOXlOSVgxU0ExMnMzZ29ObGhBTmFsSkxaalpr?= =?utf-8?B?NlVLQjk5Z1lQRzFOUkhKSEk4YjJDd1hNVmhyQUgyLzFHWlVsZzJsaVpMb2Yw?= =?utf-8?B?eS9HU1ZpYTYrQ1QxVG5LcjBuUUg3Nm1mb1plQTBpdU92MHZpZmZwTG93bzBO?= =?utf-8?B?SGQ1K0dTRER5QmFHdFphWWdXVmtKY0hjeGkyampxenJDK01keHpwVWNHYTNM?= =?utf-8?B?LzVUTVNIKzF3VXlKVXFQL0hWQW1XOHl2QmpDbmFVa3NHbG9qR3UwYWp3SDlp?= =?utf-8?B?VU5sOXczRTNUNFRkSzB6Q0dZamZqQUpLaW1Oc3BROGxpdG1QRFBYaFNQOEVH?= =?utf-8?B?NEl5am9Pa0ZKRzR1NUxuaTRVWGVnWUMzTEEwOWI1NjVBTlpnN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n+eUWBNr3RrthxiI0kF5s3n/14isH0Mk4zFRs3odSSb1W7KVdQg841NXlDpNyojUmsz8WWzSZV+Hn+i6nB43rJiCNk10arMlYGejKn3do+LR2KVq8xj6LkWrHm2JGWaS+tg==; 24:P+24s2BEadLrZKo/WK8RGWDxnL7XV8gqTW1uErlabttPk896nzmG8tH7zXqJW8ta36Vhpvioz00yST6iyYun1M17BLfNKLmBqOpIdYVqHN4= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2016 09:44:46.7651 (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: CY1PR0301MB1179 Subject: [meta-fsl-arm][PATCH v2 2/2] 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: Fri, 29 Jan 2016 09:44:53 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit The VPU decoder need the output framebuffer as a reference buffer for decoding. The output buffer shouldn’t be changed, if we blend the subtitle on the buffer directly, then the decoded video frame will have artificial jitter around the subtitle. 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, then 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 | 82 ++++++++++++++++++++++ .../gstreamer/gstreamer1.0-plugins-base_%.bbappend | 1 + 2 files changed, 83 insertions(+) create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch new file mode 100755 index 0000000..33628c9 --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch @@ -0,0 +1,82 @@ +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. + +https://bugzilla.gnome.org/show_bug.cgi?id=747495 + +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 f1992c3..4ad87bb 100644 --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend @@ -2,6 +2,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" IMX_PATCHES = " file://gstplaybin-remove-flag-deinterlace.patch \ file://0001-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch \ + file://0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \ " SRC_URI_append_mx6 = "${IMX_PATCHES}" -- 1.9.1