Compilation error - undefined reference to `gst_app_sink_pull_sample'

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Compilation error - undefined reference to `gst_app_sink_pull_sample'

pchaurasia
Hi Folks,

I am trying to pull frames out of a queue being used on my gstreamer pipeline. However I am getting aforesaid linker error. My compilation command line is -

gcc  main4.c -o gst-1 `pkg-config --cflags --libs gstreamer-1.0`

I do not know which gstreamer lib I need to link. Could someone please help ?

Thanks,
Reply | Threaded
Open this post in threaded view
|

Re: Compilation error - undefined reference to `gst_app_sink_pull_sample'

Mandar Joshi
>
> gcc  main4.c -o gst-1 `pkg-config --cflags --libs gstreamer-1.0`
>
> I do not know which gstreamer lib I need to link. Could someone please help
> ?
I think it's  gstreamer-app-1.0
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Compilation error - undefined reference to `gst_app_sink_pull_sample'

pchaurasia
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);
    gst_sample_unref(sample);
    return GST_FLOW_ERROR;
  }

  //render using map_info.data
  frame = cv::Mat(1080, 1920, CV_8UC3, (char *)map_info.data, cv::Mat::AUTO_STEP);
  memcpy(frame.data,map_info.data,map_info.size);

   if (!frame.empty())
     imshow("test-gstreamer-video",frame);
   waitKey(1);
 

  gst_buffer_unmap ((buffer), &map_info);
  //gst_memory_unmap(memory, &map_info);
  //gst_memory_unref(memory);
  gst_sample_unref(sample);

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

Reply | Threaded
Open this post in threaded view
|

Re: Compilation error - undefined reference to `gst_app_sink_pull_sample'

Akmal
CONTENTS DELETED
The author has deleted this message.