Bug 64548 - Pipeline states
Summary: Pipeline states
Status: NEW
Alias: None
Product: GStreamer SDK
Classification: Unclassified
Component: Android SDK distribution (show other bugs)
Version: 2012.11
Hardware: All All
: medium normal
Assignee: bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-13 15:07 UTC by Radu
Modified: 2013-05-13 15:07 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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? 

Thanks,
Radu


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.