[gst-devel] bets place for PA_STREAM_FIX_* flags
Alexey Fisher
bug-track at fisher-privat.net
Mon Aug 16 12:47:58 CEST 2010
Hallo all,
i working currently on cheese to make it use less resources. One thing
what is in todo list is to make pulse use less CPU if i make record with
cheese or other app. Current cheese will capture default stream and
encode it. The problem is, gstreamers pulsesrc do not use same format
provided by microphone, so pulse need to resample it and it use more
cpu.
Simple example: i have webcam which provide "s16le 1ch 16000Hz" pulsesrc
will take "float32le 1ch 44100Hz". In this case pulse will convert it.
At end point we have bigger file with 44100Hz even if we used source
with 16000Hz.
Solution is to use flags when creating the stream: PA_STREAM_FIX_FORMAT,
PA_STREAM_FIX_RATE and PA_STREAM_FIX_CHANNELS.
My question is: what is the proper place for this flags? Hard coded in
gst-plugins-good0.10? Or some haw by app what use pulsesrc?
Other ideas?
here is patch what i used to hard code this flags, it work fine for me:
--- gst-plugins-good0.10-0.10.24.3.orig/ext/pulse/pulsesrc.c
+++ gst-plugins-good0.10-0.10.24.3/ext/pulse/pulsesrc.c
@@ -963,6 +963,8 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc
#ifdef HAVE_PULSE_0_9_11
PA_STREAM_ADJUST_LATENCY |
#endif
+ PA_STREAM_FIX_FORMAT | PA_STREAM_FIX_RATE |
+ PA_STREAM_FIX_CHANNELS |
PA_STREAM_START_CORKED) < 0) {
GST_ELEMENT_ERROR (pulsesrc, RESOURCE, FAILED,
("Failed to connect stream: %s",
Regards,
Alexey
More information about the gstreamer-devel
mailing list