<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 12 (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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 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: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;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white">When using a buffer pool, adding MetaData to an acquired buffer seems work fine, but the next time I acquire
the same buffer, the data is gone. I suspect I may be using this incorrectly somehow?<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white">The Meta API is a straight copy of the example code here</span><span style="font-size:
9.5pt;font-family:Consolas;color:black">:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-allocation-meta.html<span style="background:white;mso-highlight:white"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:blue;background:white;mso-highlight:white">void</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;
mso-highlight:white">
test()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white">{<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> GstBuffer* buf = NULL;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> mfxFrameSurface1 someSurface;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> IntelQuickSyncMeta* metaData = NULL;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> GstBufferPool* pool = NULL;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> GstStructure* config = NULL;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> GstCaps* caps = NULL;
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> pool = gst_buffer_pool_new();<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> config = gst_buffer_pool_get_config( pool );<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> caps = gst_caps_from_string(</span><span style="font-size:9.5pt;font-family:Consolas;
color:#A31515;background:white;mso-highlight:white">"video/x-raw"</span><span style="font-size:9.5pt;font-family:Consolas;color:black;background:white;
mso-highlight:white">);<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> gst_buffer_pool_config_set_params( config, caps, 100, 1, 1 );<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;
mso-highlight:white">if</span><span style="font-size:9.5pt;font-family:Consolas;
color:black;background:white;mso-highlight:white">( gst_buffer_pool_set_config( pool, config
) )<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;
mso-highlight:white">if</span><span style="font-size:9.5pt;font-family:Consolas;
color:black;background:white;mso-highlight:white">( gst_buffer_pool_set_active( pool, TRUE
) )<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;
mso-highlight:white">while</span><span style="font-size:9.5pt;font-family:Consolas;
color:black;background:white;mso-highlight:white">( gst_buffer_pool_acquire_buffer( pool,
&buf, NULL ) != GST_FLOW_EOS )<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:yellow;mso-highlight:yellow">
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:yellow;
mso-highlight:yellow">// first loop this is NULL which is fine, 2nd loop this should not be null, but it is</span><span style="font-size:9.5pt;font-family:
Consolas;color:black;background:yellow;mso-highlight:yellow"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> metaData = gst_buffer_get_intel_quicksync_meta( buf );<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;
mso-highlight:white">if</span><span style="font-size:9.5pt;font-family:Consolas;
color:black;background:white;mso-highlight:white">( !metaData )<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:green;background:white;
mso-highlight:white">// add some meta data,</span><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> metaData = gst_buffer_add_intel_quicksync_meta( buf, &someSurface );<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> metaData = gst_buffer_get_intel_quicksync_meta( buf );<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white">
</span><span style="font-size:9.5pt;font-family:Consolas;color:blue;background:white;
mso-highlight:white">if</span><span style="font-size:9.5pt;font-family:Consolas;
color:black;background:white;mso-highlight:white">( !metaData )<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> {<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> assert( 0 );<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> gst_buffer_unref( buf );<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> }
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;
font-family:Consolas;color:black;background:white;mso-highlight:white">}<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>