Author: Philip Rinn Description: Prevent crash when generating keyframes with gstreamermm 0.10.11 --- a/plugins/actions/keyframesmanagement/keyframesgenerator.cc +++ b/plugins/actions/keyframesmanagement/keyframesgenerator.cc @@ -87,12 +87,20 @@ if(structure_name.find("video") == Glib::ustring::npos) return Glib::RefPtr(NULL); - Glib::RefPtr videobin = Glib::RefPtr::cast_dynamic( - Gst::Parse::create_bin( - "ffmpegcolorspace ! fakesink name=vsink", true)); + // ffmpegcolorspace + Glib::RefPtr conv = Gst::ElementFactory::create_element("ffmpegcolorspace", "conv"); + // fakesink + Glib::RefPtr vsink = Gst::FakeSink::create("vsink"); + // videobin + Glib::RefPtr videobin = Gst::Bin::create("videobin"); - Glib::RefPtr vsink = Glib::RefPtr::cast_dynamic( - videobin->get_element("vsink")); + // Add and link + videobin->add(conv)->add(vsink); + conv->link_pads("src", vsink, "sink"); + + // Add sink pad to bin element + Glib::RefPtr pad = conv->get_static_pad("sink"); + videobin->add_pad(Gst::GhostPad::create(pad, "sink")); vsink->set_sync(false); vsink->property_silent() = true;