Hi,guys,I am trying to compile the deepstream_app sample codes,it occurs the errors:
-
- /usr/bin/ld: deepstream_app.o: in function `gie_processing_done_buf_prob’:
- deepstream_app.c:(.text+0x172c): undefined reference to `NvBufSurfaceMap’
- /usr/bin/ld: deepstream_app.c:(.text+0x173c): undefined reference to `NvBufSurfaceSyncForCpu’
- collect2: error: ld returned 1 exit status
- make: *** [Makefile:77:deepstream-apptest] error 1
-
I am sure I have declare the #include "nvbufsurface.h"
in the healder file :deepstream_app.h
Besides,the folder is:
And the code snippet:
static GstPadProbeReturn
gie_processing_done_buf_prob (GstPad * pad, GstPadProbeInfo * info,
gpointer u_data)
{
GstBuffer *buf = (GstBuffer *) info->data;
NvDsInstanceBin *bin = (NvDsInstanceBin *) u_data;
guint index = bin->index;
AppCtx *appCtx = bin->appCtx;
//extra
NvDsBatchMeta *batch_meta = gst_buffer_get_nvds_batch_meta(buf);
// Get original raw data
GstMapInfo in_map_info;
if (!gst_buffer_map (buf, &in_map_info, GST_MAP_READ)) {
g_print ("Error: Failed to map gst buffer\n");
gst_buffer_unmap (buf, &in_map_info);
return GST_PAD_PROBE_OK;
}
NvBufSurface *surface = (NvBufSurface *)in_map_info.data;
for (NvDsMetaList * l_frame = batch_meta->frame_meta_list; l_frame != NULL;
l_frame = l_frame->next) {
NvDsFrameMeta *frame_meta = l_frame->data;
//TODO for cuda device memory we need to use cudamemcpy
NvBufSurfaceMap (surface, -1, -1, NVBUF_MAP_READ);
/* Cache the mapped data for CPU access */
NvBufSurfaceSyncForCpu (surface, 0, 0); //will do nothing for unified memory type on dGPU
guint height = surface->surfaceList[frame_meta->batch_id].height;
guint width = surface->surfaceList[frame_meta->batch_id].width;
...