Putting Video Frames Into a Buffer for Appsrc

Josh Doe josh at joshdoe.com
Thu Jun 16 09:45:55 PDT 2011


Any particular reason you're not using the decklink source element in
gst-plugins-bad?
http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/sys/decklink

I'd be interested to know, because I'm about to work with a Blackmagic
Design DeckLink Studio 2 card and was planning to use this element.

Thanks,
-Josh

On Thu, Jun 16, 2011 at 11:58 AM, William Metcalf <WMetcalf at niftytv.com> wrote:
> 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;
> }
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>


More information about the gstreamer-devel mailing list