How to add GstMeta to buffers in a pool?

Spruyt, Randy Randy.Spruyt at christiedigital.com
Wed Jun 10 10:37:09 PDT 2015


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?

The Meta API is a straight copy of the example code here: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-allocation-meta.html

void test()
{

       GstBuffer* buf = NULL;
       mfxFrameSurface1 someSurface;
       IntelQuickSyncMeta* metaData = NULL;
       GstBufferPool* pool = NULL;
       GstStructure* config = NULL;
       GstCaps* caps = NULL;

       pool = gst_buffer_pool_new();
       config = gst_buffer_pool_get_config( pool );
       caps = gst_caps_from_string("video/x-raw");
       gst_buffer_pool_config_set_params( config, caps, 100, 1, 1 );
       if( gst_buffer_pool_set_config( pool, config ) )
       {
              if( gst_buffer_pool_set_active( pool, TRUE ) )
              {
                     while( gst_buffer_pool_acquire_buffer( pool, &buf, NULL ) != GST_FLOW_EOS )
                     {
                           // first loop this is NULL which is fine, 2nd loop this should not be null, but it is
                           metaData = gst_buffer_get_intel_quicksync_meta( buf );
                           if( !metaData )
                           {
                                  // add some meta data,
                                  metaData = gst_buffer_add_intel_quicksync_meta( buf, &someSurface );
                                  metaData = gst_buffer_get_intel_quicksync_meta( buf );
                                  if( !metaData )
                                  {
                                         assert( 0 );
                                  }
                           }
                           gst_buffer_unref( buf );
                     }
              }
       }
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150610/e8816fc3/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: intelQuickSyncMeta.c
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150610/e8816fc3/attachment-0001.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: intelQuickSyncMeta.h
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150610/e8816fc3/attachment-0001.h>


More information about the gstreamer-devel mailing list