static void gstbt_audio_synth_set_context (GstElement * element, GstContext * context) { GstBtAudioSynth *self = GSTBT_AUDIO_SYNTH (element); guint bpm, tpb, stpb; if (gstbt_audio_tempo_context_get_tempo (context, &bpm, &tpb, &stpb)) { if (self->beats_per_minute != bpm || self->ticks_per_beat != tpb || self->subticks_per_beat != stpb) { self->beats_per_minute = bpm; self->ticks_per_beat = tpb; self->subticks_per_beat = stpb; GST_INFO_OBJECT (self, "audio tempo context: bmp=%u, tpb=%u, stpb=%u", bpm, tpb, stpb); gstbt_audio_synth_calculate_buffer_frames (self); } } #if GST_CHECK_VERSION (1,8,0) GST_ELEMENT_CLASS (gstbt_audio_synth_parent_class)->set_context (element, context); #else if (GST_ELEMENT_CLASS (gstbt_audio_synth_parent_class)->set_context) { GST_ELEMENT_CLASS (gstbt_audio_synth_parent_class)->set_context (element, context); } #endif }
static void gstbt_bml_src_set_context (GstElement * element, GstContext * context) { guint bpm, tpb, stpb; if (gstbt_audio_tempo_context_get_tempo (context, &bpm, &tpb, &stpb)) { GstBML *bml = GST_BML (GST_BML_TRANSFORM (element)); bml (gstbml_tempo_change_tempo (G_OBJECT (element), bml, bpm, tpb, stpb)); } #if GST_CHECK_VERSION (1,8,0) GST_ELEMENT_CLASS (parent_class)->set_context (element, context); #else if (GST_ELEMENT_CLASS (parent_class)->set_context) { GST_ELEMENT_CLASS (parent_class)->set_context (element, context); } #endif }