$OpenBSD: patch-server_asobj_NetStreamGst_cpp,v 1.1 2008/06/28 15:46:33 deanna Exp $ --- server/asobj/NetStreamGst.cpp.orig Tue Jun 3 20:11:29 2008 +++ server/asobj/NetStreamGst.cpp Tue Jun 24 20:10:07 2008 @@ -84,6 +84,7 @@ NetStreamGst::NetStreamGst() // Setup video conversion and sink + GstElement* video_queue = gst_element_factory_make ("queue", "gnash_videoqueue"); // setup the video colorspaceconverter converter GstElement* colorspace = gst_element_factory_make ("ffmpegcolorspace", "gnash_colorspace"); @@ -112,21 +113,27 @@ NetStreamGst::NetStreamGst() // Create the video pipeline and link the elements. The pipeline will // dereference the elements when they are destroyed. - gst_bin_add_many (GST_BIN (_videobin), colorspace, videoscale, videocaps, videosink, NULL); + gst_bin_add_many (GST_BIN (_videobin), video_queue, colorspace, videoscale, + videocaps, videosink, NULL); - if (!colorspace || !videoscale || !videocaps || !videosink) { + if (!video_queue || !colorspace || !videoscale || !videocaps || !videosink) { log_error(_("Couldn't create the Gstreamer video conversion elements. " "Please make sure Gstreamer and gstreamer-plugins-base are " "correctly installed. Video playback will not be possible.")); } - rv = gst_element_link_many(colorspace, videoscale, videocaps, videosink, NULL); + rv = gst_element_link_many(video_queue, colorspace, videoscale, videocaps, videosink, NULL); if (!rv) { log_error(_("Failed to link video conversion elements. Video playback will" " not be possible")); } + GstPad* target_videopad = gst_element_get_static_pad (video_queue, "sink"); + gst_element_add_pad(_videobin, gst_ghost_pad_new ("sink", target_videopad)); + gst_object_unref(GST_OBJECT(target_videopad)); + // Setup audio sink + GstElement* audio_queue = gst_element_factory_make ("queue", "gnash_audioqueue"); GstElement* audioconvert = gst_element_factory_make ("audioconvert", NULL); GstElement* audioresample = gst_element_factory_make ("audioresample", NULL); @@ -143,27 +150,20 @@ NetStreamGst::NetStreamGst() audiosink = gst_element_factory_make ("fakesink", NULL); } - gst_bin_add_many(GST_BIN(_audiobin), audioconvert, audioresample, audiosink, NULL); + gst_bin_add_many(GST_BIN(_audiobin), audio_queue, audioconvert, audioresample, audiosink, NULL); - if (!audioconvert || !audiosink || !audioresample) { + if (!audio_queue || !audioconvert || !audiosink || !audioresample) { log_error("Couldn't create Gstreamer audio elements. Audio playback will " "not be possible"); } - rv = gst_element_link_many(audioconvert, audioresample, audiosink, NULL); + rv = gst_element_link_many(audio_queue, audioconvert, audioresample, audiosink, NULL); if (!rv) { log_error("Couldn't link audio elements. There will be no audio playback."); } - GstPad* target_audiopad = gst_element_get_static_pad (audioconvert, "sink"); - GstPad* target_videopad = gst_element_get_static_pad (colorspace, "sink"); - - gst_element_add_pad(_videobin, gst_ghost_pad_new ("sink", target_videopad)); + GstPad* target_audiopad = gst_element_get_static_pad (audio_queue, "sink"); gst_element_add_pad(_audiobin, gst_ghost_pad_new ("sink", target_audiopad)); - - gst_object_unref(GST_OBJECT(target_videopad)); gst_object_unref(GST_OBJECT(target_audiopad)); - - } NetStreamGst::~NetStreamGst()