appsrc and caps
gledan
gl at abankos.com
Thu Apr 10 07:11:44 PDT 2014
Hi Tim, thanks for your reply
As you can see in the source code of my first mail, I use the
gst_parse_launch function with the following pipeline :
appsrc name=mysource ! ffmpegcolorspace ! videoscale method=1 ! xvimagesink
I also tried to add a videoparse element with format=RGB between the appsrc
and ffmpegcolorspace, but the result was a segmentation fault.
Typically, I push the buffer on this way (thanks to the need-data signal) :
TVFU_VFIMAGE vfImage;
/*allocate the camera buffer*/
errCode =
VFU_Image_Alloc(hCam,usbWidth,usbHeight,VFU_VFIMAGEFORMAT_RGB888,&vfImage);
if(errCode>=0){
/*getting frame from cam*/
errCode=VFU_Image_Get(hCam,VFU_VFIMAGEFORMAT_RGB888,&vfImage);
if(errCode<0){std::cout<<"error getting an image : "<< errCode
<<std::endl;
return FALSE;}
}
else std::cout<<"error allocating the VFU buffer :
"<<errCode<<std::endl;
g_print ("allocating gst memory\n");
buffer = gst_buffer_new_and_alloc (vfImage.ImageBufferSize);
GST_BUFFER_DATA(buffer) = vfImage.ImageData;
GST_BUFFER_SIZE(buffer) = vfImage.ImageBufferSize;
/* Push the buffer into the appsrc */
g_signal_emit_by_name (data->source, "push-buffer", buffer, &ret);
/* Free buffers */
gst_buffer_unref (buffer);
VFU_Image_Free(hCam,&vfImage);
if (ret != GST_FLOW_OK) {
g_print ("ERROR : pushing data\n");
return FALSE;
}
g_timer_start(data->timer);
return TRUE;
Regards,
Greg
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/appsrc-and-caps-tp4666409p4666412.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list