Compilation error - undefined reference to `gst_app_sink_pull_sample'
pchaurasia
pchaurasia at gameloreinc.com
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);
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;
}
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Compilation-error-undefined-reference-to-gst-app-sink-pull-sample-tp4683067p4683127.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list