Putting Video Frames Into a Buffer for Appsrc

William Metcalf WMetcalf at niftytv.com
Thu Jun 16 08:58:22 PDT 2011


I am writing a program using GStreamer and the DeckLink API, which will read in video frames and then render them to the screen.  The first step of this process is to caputre the video frames.  Using callback methods in the DeckLink API, I have successfully been able to capture the raw video frames and put them into a void* buffer.  Now I am trying to take this void* buffer and move its contents into a GstBuffer so that I can push it to an appsrc element.

I am pretty inexperience with moving raw video data in between bufffers. Does anyone know what methods are good for completing this task?  Below is a sample of my code to make it a little more clear as to what I am doing exactly.  Thank you in advance.

/* This method is called for each video frame that arrives */
HRESULT STDMETHODCALLTYPE VideoDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame *pArrivedFrame, IDeckLinkAudioInputPacket *pArrivedAudio)
{		
	fprintf(stdout, "Video frame arrived.\n");

        /* This method gets the raw video frame bytes and stores them in a void* temp_data */
	pArrivedFrame->GetBytes((void**) &temp_data);

        /* Here is where I need to take temp_data, and somehow move it into the data portion of a GstBuffer video_buffer */ 

        /* After I have the data in video_buffer, I will push it to the appsrc element */
	gst_app_src_push_buffer(GST_APP_SRC(appsrc), &video_buffer);

	return S_OK;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20110616/89777225/attachment.htm>


More information about the gstreamer-devel mailing list