<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Thx for the info<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:FR'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:FR'> Wim Taymans [mailto:wim.taymans@gmail.com] <br><b>Sent:</b> mardi 8 octobre 2013 15:39<br><b>To:</b> Discussion of the development of and with GStreamer<br><b>Cc:</b> gstreamer-devel@lists.freedesktop.org<br><b>Subject:</b> Re: Question about GstBuffer and GstMapInfo<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><br><br>On Tue, Oct 8, 2013 at 3:35 PM, Eric Trousset <<a href="mailto:etrousset@awox.com">etrousset@awox.com</a>> wrote:<br><br><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Hi,</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>As I understand the GstMapInfo, I get one using gst_buffer_map on a GstBuffer using the GST_MAP_READWRITE. I can then modify the buffer data thru the MapInfo.data. And then commit the changes using gst_buffer_unmap.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>But, when modifying the mapinfo.size field, it seems this isn’t committed when unmapped. </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>And if we can call gst_buffer_resize() on a buffer that have been mapped, the MapInfo then becomes inconsistent.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>So when modifying both the data content and the size, how one should proceed?</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Let say I need to process the data and that the result has x less bytes …</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Should I :</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Map the buffer</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Process the data</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Unmap</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Call gst_buffer_resize</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Or</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Should I :</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Map the buffer</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Process the data</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Update the size in the map</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Unmap</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>The second seems more logical to me, but the API seem to work in the first way (Am I right)?</span><o:p></o:p></p><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:FR'><o:p> </o:p></span></p></div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:FR'>Yes, you must resize explicitly, changing the mapinfo size does nothing.<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:FR'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:FR'>Wim<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:FR'><br><br><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Eric</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p></div></div></body></html>