[gst-devel] Adding new tee src%d to a running pipeline...

Praveen Pandey Praveen.Pandey at aricent.com
Wed Jul 28 08:43:40 CEST 2010


Try doing "GST_STATE_PLAYING"  after you have linked everything.

BR,
Praveen
________________________________________
From: Nathanael D. Noblet [nathanael at gnat.ca]
Sent: Wednesday, July 28, 2010 12:01 PM
To: Discussion of the development of GStreamer
Subject: [gst-devel] Adding new tee src%d to a running pipeline...

Hello everyone I'm having some issues getting a new src pad from a tee
on a running pipeline. It's nearly working but I can't get it past that
last step...

So here's the deal, I have a simple queue that goes to an xvimagesink.
When I click a gtk button it calls a function that is setup to create
queue/filesrc pipe and request another src pad from the tee element
already in the running pipeline. Hook it all up to the running pipe and
let it save to a file as it is viewed...  The file is created, but size
0, and my xvsink continues to play on... From some debugging print
statements I've added it looks like the pipeline comes into my button
callback in the PLAYING state, but then says it is the PAUSED state as I
start adding things to it, which seems odd as it is still playing...

Here is the relevant code:

GstElement *bin = gst_bin_new ("recording_bin");

g_print("BIN: %d PIPELINE %d\n",GST_STATE(bin),GST_STATE(pipeline));

GstPad *srcpad = NULL;
GstPad *sinkpad = NULL;

filesink  = gst_element_factory_make ("filesink",  "filesink");
filequeue = gst_element_factory_make ("queue2",    "filequeue");

g_object_set (G_OBJECT (filesink), "location", current_dir, NULL);

gst_bin_add_many(GST_BIN(bin),filequeue,filesink,NULL);
gst_element_link(filequeue,filesink);

sinkpad = gst_element_get_static_pad(filequeue,"sink");
gst_element_add_pad(bin,gst_ghost_pad_new("sink",sinkpad));
gst_object_unref(GST_OBJECT(sinkpad));

GstStateChangeReturn ret = gst_element_set_state(bin, GST_STATE_PAUSED);
g_print("STATE CHANGED TO PAUSED: %d\n",ret);

gst_bin_add(GST_BIN(pipeline), bin);

GstElement *tee = gst_bin_get_by_name (GST_BIN(pipeline),"tee");

sinkpad = gst_element_get_pad(filequeue,"sink");
srcpad  = gst_element_get_request_pad(tee,"src2");
gst_pad_set_blocked(srcpad,TRUE);
gst_pad_set_active(srcpad,TRUE);
ret = gst_element_set_state(bin, GST_STATE_PLAYING);
g_print("STATE CHANGED TO PLAYING: %d BIN: %d PIPELINE
%d\n",ret,GST_STATE(bin),GST_STATE(pipeline));

gst_pad_link(srcpad,sinkpad);
gst_pad_set_active(srcpad,TRUE);
gst_pad_set_blocked(srcpad,FALSE);

g_print("STATE CHANGED TO PLAYING: %d BIN: %d PIPELINE
%d\n",ret,GST_STATE(bin),GST_STATE(pipeline));


Can anyone help me out with this?

Thanks,
--
Nathanael d. Noblet

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus."




More information about the gstreamer-devel mailing list