Compilation error - undefined reference to `gst_app_sink_pull_sample'

pchaurasia pchaurasia at
Fri May 26 13:01:28 UTC 2017

Thanks Mandar. You tip worked.

I am on to my next problem. 

I am looking to pull a video frame out of 'appsink'. I am using following
code. I am not able, to get the right size of frame out of map_info. I
registered CaptureGstBuffer a call callback with appsink.

Could someone please spot my mistake ? 

int sampleno = 0;
GstFlowReturn CaptureGstBuffer(GstAppSink *sink, gpointer user_data)

  //prog_data* pd = (prog_data*)user_data;

  GstSample* sample = gst_app_sink_pull_sample(sink);

  if(sample == NULL) {
    return GST_FLOW_ERROR;

  GstBuffer* buffer = gst_sample_get_buffer(sample);

  //GstMemory* memory = gst_buffer_get_all_memory(buffer);
  GstMapInfo map_info;

  if (!gst_buffer_map ((buffer), &map_info, GST_MAP_READ)) {
    gst_buffer_unmap ((buffer), &map_info);
    return GST_FLOW_ERROR;

  //render using
  frame = cv::Mat(1080, 1920, CV_8UC3, (char *),

   if (!frame.empty())

  gst_buffer_unmap ((buffer), &map_info);
  //gst_memory_unmap(memory, &map_info);

  fprintf(stderr,"Got sample no  %d\n",sampleno++);
  return GST_FLOW_OK;

View this message in context:
Sent from the GStreamer-devel mailing list archive at

More information about the gstreamer-devel mailing list