undefined symbol: vanc_meta_get_info

John P Poet jppoet at gmail.com
Mon Oct 10 22:46:02 UTC 2016


I am writing a new meta lib, and have been battling trying to solve:

*```*
$ gst-inspect-1.0 decklinkvideosrc

(gst-plugin-scanner:10063): GStreamer-WARNING **: Failed to load plugin
'/opt/gst/lib/gstreamer-1.0/libgstdecklink.so':
/opt/gst/lib/gstreamer-1.0/libgstdecklink.so:
undefined symbol: vanc_meta_get_info
*```*

What is interesting about this, is that the exact same library/header/c
file defines:
*```*
VANCMeta * gst_buffer_add_vanc_meta (GstBuffer * buffer,
                                     gint did, gint dbn_sdid,
                                     uint16_t * data, gsize size,
                                     uint16_t checksum);
*```*

And that function links/runs prefectly when used in decklinkvideosrc.  It
is only when adding a call to
*```*
const  GstMetaInfo *vanc_meta_get_info (void);
*```*

That I get that undefined symbol error.  I have been beating my head
against this for a couple of days, so I hope a fresh pair of eyes will spot
what I am doing wrong.

The relevant parts are:

gstvancmeta.h
```
#ifndef _GST_VANC_META_H_
#define _GST_VANC_META_H_

#ifdef __cplusplus
extern "C"
{
#endif

#include <gst/gst.h>
#include <stdint.h>

...

/* implementation */
const  GstMetaInfo *vanc_meta_get_info (void);
#define GST_VANC_META_INFO (vanc_meta_get_info ())

VANCMeta * gst_buffer_add_vanc_meta (GstBuffer * buffer,
                                     gint did, gint dbn_sdid,
                                     uint16_t * data, gsize size,
                                     uint16_t checksum);

...
*```*

gstvancmeta.c
*```*
#include "gstvancmeta.h"
...

const GstMetaInfo
  *vanc_meta_get_info (void)
{
  static const GstMetaInfo *meta_info = NULL;

  if (g_once_init_enter (&meta_info)) {
    const GstMetaInfo *mi = gst_meta_register (VANC_META_API_TYPE,
                                               "VANCMeta",
                                               sizeof (VANCMeta),
                                               vanc_meta_init,
                                               vanc_meta_free,
                                               vanc_meta_transform);
    g_once_init_leave (&meta_info, mi);
  }
  return meta_info;
}

VANCMeta *
  gst_buffer_add_vanc_meta (GstBuffer * buffer,
                            gint did, gint dbn_sdid,
                            uint16_t * data, gsize size,
                            uint16_t checksum)
{
  VANCMeta *vmeta;

  g_return_val_if_fail (GST_IS_BUFFER (buffer), NULL);

  vmeta = (VANCMeta *) gst_buffer_add_meta (buffer,
                                           GST_VANC_META_INFO, NULL);
...
  return vmeta;
}
*```*

And then I call them from code in gstdecklinkvideosrc.cpp, for example:
*```*
static void packetizeComponentAncillary(GstDecklinkVideoSrc *self,
                                        std::vector<uint16_t> &data,
                                        GstBuffer * buffer)
{
   const GstMetaInfo *vanc_info = vanc_meta_get_info ();
 ...
    if (usableVANC(did, dbn_sdid)) {
      gst_buffer_add_vanc_meta (buffer, did, dbn_sdid, &data[idx + 6],
                               data_count, chksum_e);
      GST_WARNING_OBJECT (self, "VANC meta added");
    }
  }
}
*```*

I only add the call to vanc_meta_get_info () there just to see if it would
link, since it does not in gst-libav.  It does not either place.  In
gstdecklink it is linking the .la file, and in gst-libav it is linking the
.so file.

I will attach the full patch in case it helps.

Thank you,

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161010/ba7314da/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gst-plugins-bad-vanc.patch
Type: text/x-patch
Size: 27673 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20161010/ba7314da/attachment-0001.bin>


More information about the gstreamer-devel mailing list