<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>Putting Video Frames Into a Buffer for Appsrc</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>I am writing a program using GStreamer and the DeckLink API, which will read in video frames and then render them to the screen.&nbsp; The first step of this process is to caputre the video frames.&nbsp; 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.&nbsp; 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.<BR>
<BR>
I am pretty inexperience with moving raw video data in between bufffers. Does anyone know what methods are good for completing this task?&nbsp; Below is a sample of my code to make it a little more clear as to what I am doing exactly.&nbsp; Thank you in advance.<BR>
<BR>
/* This method is called for each video frame that arrives */<BR>
HRESULT STDMETHODCALLTYPE VideoDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame *pArrivedFrame, IDeckLinkAudioInputPacket *pArrivedAudio)<BR>
{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fprintf(stdout, &quot;Video frame arrived.\n&quot;);<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* This method gets the raw video frame bytes and stores them in a void* temp_data */<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pArrivedFrame-&gt;GetBytes((void**) &amp;temp_data);<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Here is where I need to take temp_data, and somehow move it into the data portion of a GstBuffer video_buffer */<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* After I have the data in video_buffer, I will push it to the appsrc element */<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_app_src_push_buffer(GST_APP_SRC(appsrc), &amp;video_buffer);<BR>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return S_OK;<BR>
}</FONT>
</P>

</BODY>
</HTML>