Help! Could not get microphone data on android platform with GStreamer

xzym yangmengzrr at gmail.com
Thu Jan 16 04:00:34 PST 2014


Hi experts:
    
    I need do a apk program for get microphone on android platform, I prefer
to use gstreamer to implement.
 
    I write below coding on JNI level to build pipeline 
  
  {......	
   gchar *audio_caps =
           
g_strdup_printf("audio/x-raw-int,channels=%d,rate=%d,signed=(boolean)true,"
                            "width=16,depth=16,endianness=1234", 2, 44100);

   gchar *pipeline =
            g_strdup_printf("autoaudiosrc name=\"audiosrc\" ! queue !
audioconvert ! audioresample ! "
                            "appsink caps=\"%s\" name=\"appsink\"",
audio_caps);

  p->record.pipe = gst_parse_launch(pipeline, &error);
  bus = gst_pipeline_get_bus(GST_PIPELINE(p->record.pipe));
  gst_bus_add_watch(bus, record_bus_cb, data);

  gst_object_unref(GST_OBJECT(bus));
  gst_app_sink_set_emit_signals(GST_APP_SINK(p->record.sink), TRUE);
  spice_g_signal_connect_object(p->record.sink, "new-buffer",
                                      G_CALLBACK(record_new_buffer),
gstaudio, 0);

   g_clear_error(&error);
   g_free(audio_caps);
   g_free(pipeline);
  
    if (p->record.pipe)
    {
        gst_element_set_state(p->record.pipe, GST_STATE_PLAYING);
    }
  
  when it runs, some error occur, I am a newcomer for gstreamer,  Someone
can point out which error is I did.

audio record pipeline: autoaudiosrc name="audiosrc" ! queue ! audioconvert !
audioresample ! audiorate !appsink
caps="audio/x-raw-int,channels=2,rate=44100,signed=(boolean)true,width=16,depth=16,endianness=1234"
name="appsink"
stat change from NULL to READY,and pending is 0
bus warning = Resource not found.
stat change from READY to PAUSED,and pending is 0
YM at RECORD BUS CB type is 8192
steamer type= 0
steamer src= /GstPipeline:pipeline0/GstQueue:queue0.GstPad:src
steamer owner= /GstPipeline:pipeline0/GstQueue:queue0
YM at RECORD BUS CB type is 8192
steamer type= 0
steamer src=
/GstPipeline:pipeline0/GstAutoAudioSrc:audiosrc/GstFakeSrc:fake-audio-src.GstPad:src
steamer owner=
/GstPipeline:pipeline0/GstAutoAudioSrc:audiosrc/GstFakeSrc:fake-audio-src
YM at RECORD BUS CB type is 8192
steamer type= 1
steamer src= /GstPipeline:pipeline0/GstQueue:queue0.GstPad:src
steamer owner= /GstPipeline:pipeline0/GstQueue:queue0
YM at RECORD BUS CB type is 8192
steamer type= 1
steamer src=
/GstPipeline:pipeline0/GstAutoAudioSrc:audiosrc/GstFakeSrc:fake-audio-src.GstPad:src
steamer owner=
/GstPipeline:pipeline0/GstAutoAudioSrc:audiosrc/GstFakeSrc:fake-audio-src
YM at RECORD BUS CB type is 2
Error received from element audioconvert0,bus error = not negotiated
Debugging information: gstbasetransform.c(2555):
gst_base_transform_handle_buffer ():
/GstPipeline:pipeline0/GstAudioConvert:audioconvert0:
not negotiated
YM at RECORD BUS CB type is 2
Error received from element fake-audio-src,bus error = Internal data flow
error.
Debugging information: gstbasesrc.c(2633): gst_base_src_loop ():
/GstPipeline:pipeline0/GstAutoAudioSrc:audiosrc/GstFakeSrc:fake-audio-src:




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Help-Could-not-get-microphone-data-on-android-platform-with-GStreamer-tp4664710.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list