Probem with output-selector
rasnaut
rasnaut at gmail.com
Tue Aug 7 07:19:51 PDT 2012
Hah... So, I tested many pipline combination and what I have seen. When I
simple used code like output-selector-test.c:
gePipline = gst_pipeline_new("pipeline");
g_assert(gePipline);
geVideoSrc = gst_element_factory_make("v4l2src", "src");
g_assert(geVideoSrc);
geVideoRate = gst_element_factory_make("videorate", "vrate1");
g_assert(geVideoRate);
geVideoScale = gst_element_factory_make("videoscale", "vscale1");
g_assert(geVideoScale);
geIdentity = gst_element_factory_make("identity", "ident");
g_assert(geIdentity);
geOutputSelector = gst_element_factory_make("output-selector",
"out_selector");
g_assert(geOutputSelector);
geConvert0 = gst_element_factory_make("videoconvert","v0");
g_assert(geConvert0);
geConvert1= gst_element_factory_make("videoconvert","v1");
g_assert(geConvert1);
geConvert2= gst_element_factory_make("videoconvert","v2");
g_assert(geConvert2);
geVideoOut2 = gst_element_factory_make("autovideosink", "video out2");
g_assert(geVideoOut2);
geVideoOut1 = gst_element_factory_make("fakesink", "video out1");
g_assert(geVideoOut1);
gst_bin_add_many(GST_BIN(gePipline), geVideoSrc,
geVideoRate,geVideoScale,geIdentity, geConvert0, geOutputSelector,
geConvert1,geVideoOut1, geConvert2,geVideoOut2, NULL);
....
gst_element_link_filtered(geVideoSrc, geVideoRate, gcVideoCaps);
gst_element_link( geVideoRate, geVideoScale);
gst_element_link_filtered(geVideoScale, geIdentity, gcVideoScaleCaps);
gst_element_link(geIdentity, geConvert0);
gst_element_link( geConvert0, geOutputSelector);
// link output 1
gpSinkPad = gst_element_get_static_pad(geConvert1, "sink");
gpOsel_Src1 = gst_element_get_request_pad (geOutputSelector, "src_%u");
if (gst_pad_link (gpOsel_Src1, gpSinkPad) != GST_PAD_LINK_OK)
{ g_print ("linking output 1 converter failed\n"); }
gst_object_unref (gpSinkPad);
if (!gst_element_link (geConvert1, geVideoOut1)) {
g_print ("linking output 1 failed\n");
}
// link output 2
gpSinkPad= gst_element_get_static_pad (geConvert2, "sink");
gpOsel_Src2 = gst_element_get_request_pad (geOutputSelector, "src_%u");
if (gst_pad_link (gpOsel_Src2, gpSinkPad) != GST_PAD_LINK_OK)
{
g_print ("linking output 2 converter failed\n");
}
if (!gst_element_link (geConvert2, geVideoOut2))
{
g_print ("linking output 1 failed\n");
}
gst_object_unref (gpSinkPad);
g_object_set (G_OBJECT (geOutputSelector), "active-pad",gpOsel_Src1,
NULL);
....
gst_element_set_state(GST_ELEMENT(gePipline), GST_STATE_PLAYING);
Pipline cannot start, 'gst_element_set_state' returns '0'
(GST_STATE_CHANGE_FAILURE). When I changed "videoconvert" plugins for
"queue", Pipline started and was working few seconds (I saw it by
"identity"), but after that all stopped again with
"GST_STATE_CHANGE_FAILURE". But all combination worked if I deleted second
sink from "gst_bin_add_many":
gst_bin_add_many(GST_BIN(gePipline), geVideoSrc,
geVideoRate,geVideoScale,geIdentity, geConvert0, geOutputSelector,
geConvert1,geVideoOut1, NULL);
So, maybe, anybody have some thought about all this?
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Probem-with-output-selector-tp4655762p4655875.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list