gst_element_connect_many(sinesrc, volfilter, osssink, NULL);
/* this breaks with current alsa oss compat lib */
g_object_set(G_OBJECT(osssink),"fragment",0x00180008,NULL);
+ g_object_set(G_OBJECT(osssink),"sync",FALSE,NULL);
- g_object_set(G_OBJECT(sinesrc),"samplesperbuffer",64,NULL);
+ g_object_set(G_OBJECT(sinesrc),"samplesperbuffer",1024,NULL);
/***** set up the GUI *****/
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
dpman = gst_dpman_get_manager (sinesrc);
g_assert(gst_dpman_attach_dparam (dpman, "freq", freq));
- gst_dpman_set_mode(dpman, "synchronous");
+ gst_dpman_set_mode(dpman, "asynchronous");
spec = (GParamSpecFloat*)gst_dpman_get_param_spec (dpman, "freq");
freq_adj = (GtkAdjustment*)gtk_adjustment_new((gfloat)log(spec->default_value),
/* this defines the maximum slope that this *
* param can change. This says that in 50ms *
* the value can change from 0.0 to 1.0 */
- g_object_set(G_OBJECT(volume), "slope_delta_float", 1.0F, NULL);
+ g_object_set(G_OBJECT(volume), "slope_delta_float", 0.1F, NULL);
g_object_set(G_OBJECT(volume), "slope_time", 50000000LL, NULL);
dpman = gst_dpman_get_manager (volfilter);
g_assert(gst_dpman_attach_dparam (dpman, "volume", volume));
- gst_dpman_set_mode(dpman, "synchronous");
+ gst_dpman_set_mode(dpman, "asynchronous");
g_object_set(G_OBJECT(volfilter), "mute", FALSE, NULL);
&(src->volume)
);
- gst_dpman_set_rate_change_pad(src->dpman, src->srcpad);
-
+ gst_dpman_set_rate(src->dpman, src->samplerate);
+
gst_sinesrc_populate_sinetable(src);
gst_sinesrc_update_table_inc(src);
GstBuffer *buf;
gint16 *samples;
- gint i=0, frame_countdown;
+ gint i=0;
g_return_val_if_fail (pad != NULL, NULL);
src = GST_SINESRC(gst_pad_get_parent (pad));
samples = (gint16*)GST_BUFFER_DATA(buf);
GST_BUFFER_DATA(buf) = (gpointer) samples;
-
- frame_countdown = GST_DPMAN_PREPROCESS(src->dpman, src->samples_per_buffer, src->timestamp);
+
+ GST_DPMAN_PREPROCESS(src->dpman, src->samples_per_buffer, src->timestamp);
src->timestamp += (gint64)src->samples_per_buffer * 1000000000LL / (gint64)src->samplerate;
- while(GST_DPMAN_PROCESS_COUNTDOWN(src->dpman, frame_countdown, i)) {
+ while(GST_DPMAN_PROCESS(src->dpman, i)) {
src->table_lookup = (gint)(src->table_pos);
src->table_lookup_next = src->table_lookup + 1;
/* * src->volume * 32767.0; */
/*linear interpolation */
- samples[i++] = ((src->table_interp
+ samples[i] = ((src->table_interp
*(src->table_data[src->table_lookup_next]
-src->table_data[src->table_lookup]
)
)+src->table_data[src->table_lookup]
)* src->volume * 32767.0;
+ i++;
}
break;
case ARG_SAMPLERATE:
src->samplerate = g_value_get_int (value);
+ gst_dpman_set_rate(src->dpman, src->samplerate);
src->newcaps=TRUE;
gst_sinesrc_update_table_inc(src);
break;