<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=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@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:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
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;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1086652450;
mso-list-type:hybrid;
mso-list-template-ids:1868581164 2141621536 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-text:%1-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1
{mso-list-id:1516921667;
mso-list-type:hybrid;
mso-list-template-ids:-2102859718 2141621536 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
{mso-level-text:%1-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></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=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi<o:p></o:p></p><p class=MsoNormal>On gstreamer 1.4.5, running on CentOs 7.2, having problem with reading meta data attached to buffers. The following scenario is the where the problem is observed:<o:p></o:p></p><p class=MsoNormal>State 1:<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>Meta data is conditionally attached to outgoing buffers, i.e., only if there is valid meta, it would get attached, e.g.:<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>…<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>if(userdata){<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> gst_buffer_add_userdata_meta (frame->output_buffer,& userdata_meta);<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>…<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>Intended recipient of meta properly ignores gst_buffer_get call:<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>…<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>GstUserdataMeta *userdata_meta=gst_buffer_get_userdata_meta (input_frame->input_buffer);<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> if(userdata_meta && userdata_meta->userdatameta){<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> // This is not executed<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> }<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal>State 2:<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>Meta attachment condition becomes true, proper meta data are attached<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>Recipient properly extracts meta:<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>GstUserdataMeta *userdata_meta=gst_buffer_get_userdata_meta (input_frame->input_buffer);<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> if(userdata_meta && userdata_meta->userdatameta){<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> // This is executed<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'> }<o:p></o:p></p><p class=MsoNormal>State 3:<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>Meta data attachment condition becomes false, no meta is attached<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'>Recipient still extracts meta!<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><p class=MsoNormal>It is noted that due to buffering, it is expected that there would be a lag from the time that meta attachment condition become false to the time that recipient is expected to ignor gst_buffer_get calls. Here is what I am getting:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On State 2, the recipient sees: GST_INFO_OBJECT(xx,"%p %p\n”, userdata_meta, userdata_meta->userdatameta);<o:p></o:p></p><p class=MsoNormal>…<o:p></o:p></p><p class=MsoNormal>0:00:52.027950698 27204 0x16e6f20 INFO xx xx.cpp:1547:gst_xx_encode_frame:<xx> 0x7f8bde757e20 0x7f8c0826ab90 <o:p></o:p></p><p class=MsoNormal>0:00:52.047961117 27204 0x16e6f20 INFO xx xx.cpp:1547:gst_xx_encode_frame:<xx> 0x7f8bde864ae0 0x7f8c082683f0 <o:p></o:p></p><p class=MsoNormal>0:00:52.068356845 27204 0x16e6f20 INFO xx xx.cpp:1547:gst_xx_encode_frame:<xx> 0x7f8bdf2e8120 0x7f8c082685b0 <o:p></o:p></p><p class=MsoNormal>0:00:52.087984535 27204 0x16e6f20 INFO xx xx.cpp:1547:gst_xx_encode_frame:<xx> 0x7f8bdf2eeea0 0x7f8c08268db0 <o:p></o:p></p><p class=MsoNormal>0:00:52.107973286 27204 0x16e6f20 INFO xx xx.cpp:1547:gst_xx_encode_frame:<xx> 0x7f8bde76d1e0 0x7f8c080b2620 <o:p></o:p></p><p class=MsoNormal>…<o:p></o:p></p><p class=MsoNormal>(Note that meta field address changes per call, as the meta server is allocating new memory for each meta data)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On State 3, the recipient sees: GST_INFO_OBJECT(xx,"%p %p\n”, userdata_meta, userdata_meta->userdatameta);<o:p></o:p></p><p class=MsoNormal>…<o:p></o:p></p><p class=MsoNormal>0:00:53.528208158 27204 0x16e6f20 INFO xx xx.cpp:1547:gst_xx_encode_frame:<xx> 0x7f8bde8abe20 0x7f8c0bf11a40 <o:p></o:p></p><p class=MsoNormal>0:00:53.547948573 27204 0x16e6f20 INFO xx xx.cpp:1547:gst_xx_encode_frame:<xx> 0x7f8bde845ae0 0x7f8c0bf11a40 <o:p></o:p></p><p class=MsoNormal>0:00:53.567948574 27204 0x16e6f20 INFO xx xx.cpp:1547:gst_xx_encode_frame:<xx> 0x7f8bde74f1e0 0x7f8c0bf11a40 <o:p></o:p></p><p class=MsoNormal>0:00:53.587983423 27204 0x16e6f20 INFO xx xx.cpp:1547:gst_xx_encode_frame:<xx> 0x7f8bde785ae0 0x7f8c0bf11a40 <o:p></o:p></p><p class=MsoNormal>0:00:53.607985743 27204 0x16e6f20 INFO xx xx.cpp:1547:gst_xx_encode_frame:<xx> 0x7f8bde7681e0 0x7f8c0bf11a40 <o:p></o:p></p><p class=MsoNormal>…<o:p></o:p></p><p class=MsoNormal>Note that recipient keeps reading the same stale memory location.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Any thoughts?<o:p></o:p></p><p class=MsoNormal>Cheers,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>