Bug 64548

Summary: Pipeline states
Product: GStreamer SDK Reporter: Radu <bunghez_radu>
Component: Android SDK distributionAssignee: bugs
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium    
Version: 2012.11   
Hardware: All   
OS: All   
i915 platform: i915 features:

Description Radu 2013-05-13 15:07:35 UTC
I am working at a player based on gstreamer tutorials. For this I created a pipeline using: 

pipeline	= gst_pipeline_new("audio-player");

//adding also 3 gstreamer elements
appsrc		= gst_element_factory_make("appsrc", "source");
decoder		= gst_element_factory_make("faad", "aac-decoder");
sink		= gst_element_factory_make("autoaudiosink", "audio-output");

//adding and linking the elements to the pipeline
gst_bin_add_many (GST_BIN (pipeline), appsrc, decoder, sink, NULL);
gst_element_link_many(appsrc, decoder,sink, NULL);

//for appsrc was added a callback function need_data_cb
g_signal_connect(appsrc, "need-data", (GCallback)need_data_cb, data);

//state of pipeline is set to playing
gst_element_set_state(pipeline, GST_STATE_PLAYING);

In need_data_cb function I have a buffer that I want to be played: 

g_signal_emit_by_name(appsrc, "push-buffer", buffer, &ret);

My poblem is this: I have the same code in Linux and in Android. In Linux buffer is played well each time it enters the callback function need_data_cb. In Android it plays the buffer just the first time it enters in need_data_cb and after that no sound. Why it happens this when I have same code in both versions. If I add in need_data_cb Android version to change pipeline states to pause and play before adding buffer to appsrc, it plays each time buffer but with some interruptions between each call. 

//the first 2 lines added in Android version to play each time buffer
gst_element_set_state(pipeline, GST_STATE_PAUSED);
gst_element_set_state(pipeline, GST_STATE_PLAYING);
g_signal_emit_by_name(appsrc, "push-buffer", buffer, &ret);

The question is why on Linux works fine without these lines and on Android not?
On Linux I installed gstreamer 0.10 version, and on Android I used the libs from gstreamer sdk tutorials. Is there any difference between them? 


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.