how to change element when pipe is running!!!!!!!!!!!!!
DBOYaoao
yiikai1987910 at gmail.com
Tue Sep 11 00:41:14 PDT 2012
hi everyone:
I am a new gst developer,I have a trouble with change elemnt
while pipeline is running.
my project is like this:A->B->C,B can change the
pixel-aspect-ratio,I use d to change b that can change the
pixel-aspect-ratio,but i don't know why can't change it.
my method is this: I use videoscale ! capsfilter ! xvimagsink to
change aspect-ratio
capsfilterB aspect-ratio is 1:1 capsfilterD aspect-ratio is
16:9
first I block the videoscale srcpad,and the movie stop,then I unlink
B with A and c,then connect D with A and C use gst_bin_link_many(),finally I
unblock the videoscale srcpad.but the movie not continue.
However When I set capsfilterD's aspect-ratio as 1:1 , it work.
block code like this:
GstPad *videoscalesrcpad =
gst_element_get_static_pad(videoscale,"src");
gst_pad_set_blocked_async(videoscalesrcpad,TRUE,padBlockcb,videoscalesrcpad);
while(!gst_pad_is_blocking(videoscalesrcpad))
{
g_print("wait for the srcpad blocking\n");
}
gst_element_set_state(capsfilter_1,GST_STATE_NULL);
g_print(".....................src pad blocked..........\n");
GstPad *caps1sinkpad = gst_element_get_static_pad(capsfilter_1,"sink");
if(!gst_pad_is_linked(caps1sinkpad))
{
g_print("caps sink not link\n");
}
if(!gst_pad_unlink(videoscalesrcpad,caps1sinkpad))
{
g_print("unlinlk failed \n");
return ;
}
GstPad *outsinkpad = gst_element_get_static_pad(outsink,"sink");
GstPad *caps1srcpad = gst_element_get_static_pad(capsfilter_1,"src");
gst_pad_unlink(caps1srcpad,outsinkpad);
unblock code like this:
GstCaps *filtercaps = NULL;
filtercaps =
gst_caps_from_string("video/x-raw-yuv,pixel-aspect-ratio=\(fraction\)1/1");
g_object_set(G_OBJECT(capsfilter_2),"caps",filtercaps,NULL);
gst_caps_unref(filtercaps);
gst_bin_add(videobin,capsfilter_2);
gst_element_link_many(videoscale,capsfilter_2,outsink,NULL);
gst_element_set_state(capsfilter_2,GST_STATE_PLAYING);
#endif
GstPad *videoscalesrcpad =
gst_element_get_static_pad(videoscale,"src");
gst_pad_set_blocked_async(videoscalesrcpad,FALSE,padBlockcb,NULL);
Thanks for anybody help!!!!!!
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/how-to-change-element-when-pipe-is-running-tp4656253.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list