title: Gstreamer: xvimagesink internal error: can't allocate images
body: <p>I have the following simple gstreamer pipeline:<br></p>
  
  <pre><code>+--------+    +--------------+
  | appsrc | -&gt; |  vximagesink |
  +--------+    +--------------+
  </code></pre>
  
  <p>In appsrc's "need data" callback I have the following lines:</p>
  
  <pre><code>Glib::RefPtr&lt;Gst::Memory&gt; memory =
      Gst::Memory::create(static_cast&lt;Gst::MemoryFlags&gt;(0), ptr, size, 0, size);
  
  Glib::RefPtr&lt;Gst::Buffer&gt; buffer = Gst::Buffer::create();
  buffer-&gt;insert_memory(-1, std::move(memory));
  
  buffer-&gt;set_pts(timestamp);
  buffer-&gt;set_duration(gst_util_uint64_scale_int(1, GST_SECOND, 30));
  
  srcapp-&gt;push_buffer(buffer);
  </code></pre>
  
  <p>Where 'ptr' is pre-allocated, and holds valid data.</p>
  
  <p>According to the documentation, in this code, the allocated data will be wrapped inside a memory object, in turn is wrapped by the buffer object. But something here doesn't work, because the vximagesink sends an error event that says <strong>"Internal error: can't allocate images"</strong> (This happens when no pool is available for xvimagesink, but no pool is needed in this example).</p>
  
  <p>The pipeline is built simply (I'm not showing the properties settings):</p>
  
  <pre><code>pipeline-&gt;add(appsrc)-&gt;add(sink);
  appsrc-&gt;link(sink);
  </code></pre>
  
  <p>What am I doing wrong?</p>