<br><br>On Tue, Oct 8, 2013 at 3:35 PM, Eric Trousset <etrousset@awox.com> wrote:<br>
<blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><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;}
/* 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-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.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]--><div class="WordSection1"><p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></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.<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US">But, when modifying the mapinfo.size field, it seems this isn’t committed when unmapped. <o:p></o:p></span></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.<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US">So when modifying both the data content and the size, how one should proceed?<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US">Let say I need to process the data and that the result has x less bytes …<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US">Should I :<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US">Map the buffer<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US">Process the data<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US">Unmap<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US">Call gst_buffer_resize<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US">Or<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US">Should I :<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US">Map the buffer<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US">Process the data<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US">Update the size in the map<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US">Unmap<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></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></p></div></blockquote><div><br></div>Yes, you must resize explicitly, changing the mapinfo size does nothing.<div><br></div><div>Wim</div><div><br><blockquote type="cite"><div class="WordSection1"><p class="MsoNormal"><span lang="EN-US"><o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US">Eric<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p></div></blockquote></div>