After changing "location" of filesrc element pipeline breaks

Sujata Gaddemane gsujata at gmail.com
Thu Oct 1 03:51:46 PDT 2015


Hi,

I am new to gstreamer. Need help in resolving this issue.

I am writing an app which reads ts streams one after the other and renders
both video and audio.
Hence I need to change the ts streaming file after receiving EOS from the
first ts file in filesrc element.
My pipeline looks as below:

filesrc location=B4USO123073012.ts ! tsdemux  name=d ! queue ! h264parse !
avdec_h264 ! xvimagesink  d. ! queue ! faad ! autoaudiosink (ofcourse I am
not using gst-launch, instead writing C program to implement the pipeline).


The first file runs fine, after receiving EOS I follwo following steps:
1. Set pipeline state to NULL
2. Remove filesrc element
3. Create new filesrc element
4. Set the location in filesrc to new file
5. add the new filesrc element to pipeline.
6. link filesrc to tsdemux
7. change pipeline state to PLAYING

After this I receive error message "No program activated before EOS" and
app terminates.
Here is a snippet of my code where location is changed on arrival of EOS.

case GST_MESSAGE_EOS:
                        g_print ("End-Of-Stream reached.\n");
                        gst_element_set_state (data->pipeline,
GST_STATE_NULL);
                        gst_bin_remove(data->pipeline, data->source);
                        data->source = gst_element_factory_make ("filesrc",
"file-source");
                        g_object_set (G_OBJECT (data->source), "location",
"B4USO123073012.ts", NULL);
                        gst_bin_add(data->pipeline, data->source);
                        gst_element_link(data->source, data->demuxer);
                        gst_element_set_state (data->pipeline,
GST_STATE_PLAYING);
                        break;



-- 

Regards,
Sujata
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20151001/889fc712/attachment-0001.html>


More information about the gstreamer-devel mailing list