Lines Matching refs:src
164 gst_tone_generate_src_init (GstToneGenerateSrc * src) in gst_tone_generate_src_init() argument
166 src->volume = DEFAULT_VOLUME; in gst_tone_generate_src_init()
167 src->freq = DEFAULT_FREQ; in gst_tone_generate_src_init()
168 src->on_time = DEFAULT_ON_TIME; in gst_tone_generate_src_init()
169 src->off_time = DEFAULT_OFF_TIME; in gst_tone_generate_src_init()
170 src->volume2 = DEFAULT_VOLUME; in gst_tone_generate_src_init()
171 src->freq2 = DEFAULT_FREQ; in gst_tone_generate_src_init()
172 src->on_time2 = DEFAULT_ON_TIME; in gst_tone_generate_src_init()
173 src->off_time2 = DEFAULT_OFF_TIME; in gst_tone_generate_src_init()
174 src->repeat = DEFAULT_REPEAT; in gst_tone_generate_src_init()
176 gst_base_src_set_format (GST_BASE_SRC (src), GST_FORMAT_TIME); in gst_tone_generate_src_init()
178 src->samples_per_buffer = DEFAULT_SAMPLES_PER_BUFFER; in gst_tone_generate_src_init()
179 gst_base_src_set_blocksize (GST_BASE_SRC (src), 2 * src->samples_per_buffer); in gst_tone_generate_src_init()
185 GstToneGenerateSrc *src = GST_TONE_GENERATE_SRC (object); in gst_tone_generate_src_finalize() local
187 if (src->tone_desc) { in gst_tone_generate_src_finalize()
188 tone_gen_descriptor_free (src->tone_desc); in gst_tone_generate_src_finalize()
189 src->tone_desc = NULL; in gst_tone_generate_src_finalize()
192 if (src->tone_state) { in gst_tone_generate_src_finalize()
193 tone_gen_free (src->tone_state); in gst_tone_generate_src_finalize()
194 src->tone_state = NULL; in gst_tone_generate_src_finalize()
203 GstToneGenerateSrc *src = GST_TONE_GENERATE_SRC (basesrc); in gst_tone_generate_src_start() local
205 GST_OBJECT_LOCK (src); in gst_tone_generate_src_start()
206 src->properties_changed = FALSE; in gst_tone_generate_src_start()
207 GST_OBJECT_UNLOCK (src); in gst_tone_generate_src_start()
209 src->next_sample = 0; in gst_tone_generate_src_start()
210 src->next_time = 0; in gst_tone_generate_src_start()
218 GstToneGenerateSrc *src = GST_TONE_GENERATE_SRC (basesrc); in gst_tone_generate_src_stop() local
220 GST_OBJECT_LOCK (src); in gst_tone_generate_src_stop()
221 if (src->tone_desc) { in gst_tone_generate_src_stop()
222 tone_gen_descriptor_free (src->tone_desc); in gst_tone_generate_src_stop()
223 src->tone_desc = NULL; in gst_tone_generate_src_stop()
226 if (src->tone_state) { in gst_tone_generate_src_stop()
227 tone_gen_free (src->tone_state); in gst_tone_generate_src_stop()
228 src->tone_state = NULL; in gst_tone_generate_src_stop()
230 src->properties_changed = FALSE; in gst_tone_generate_src_stop()
231 GST_OBJECT_UNLOCK (src); in gst_tone_generate_src_stop()
239 GstToneGenerateSrc *src; in gst_tone_generate_src_fill() local
246 src = GST_TONE_GENERATE_SRC (basesrc); in gst_tone_generate_src_fill()
252 next_sample = src->next_sample + samples; in gst_tone_generate_src_fill()
256 GST_LOG_OBJECT (src, "samplerate %d", samplerate); in gst_tone_generate_src_fill()
257 GST_LOG_OBJECT (src, "next_sample %" G_GINT64_FORMAT ", ts %" GST_TIME_FORMAT, in gst_tone_generate_src_fill()
260 GST_BUFFER_OFFSET (buffer) = src->next_sample; in gst_tone_generate_src_fill()
262 GST_BUFFER_TIMESTAMP (buffer) = src->next_time; in gst_tone_generate_src_fill()
263 GST_BUFFER_DURATION (buffer) = next_time - src->next_time; in gst_tone_generate_src_fill()
265 gst_object_sync_values (GST_OBJECT (src), GST_BUFFER_TIMESTAMP (buffer)); in gst_tone_generate_src_fill()
267 src->next_time = next_time; in gst_tone_generate_src_fill()
268 src->next_sample = next_sample; in gst_tone_generate_src_fill()
270 GST_LOG_OBJECT (src, "generating %u samples at ts %" GST_TIME_FORMAT, in gst_tone_generate_src_fill()
275 GST_OBJECT_LOCK (src); in gst_tone_generate_src_fill()
276 if (!src->tone_state || src->properties_changed) { in gst_tone_generate_src_fill()
277 src->tone_desc = tone_gen_descriptor_init (src->tone_desc, in gst_tone_generate_src_fill()
278 src->freq, in gst_tone_generate_src_fill()
279 src->volume, in gst_tone_generate_src_fill()
280 src->freq2, in gst_tone_generate_src_fill()
281 src->volume2, in gst_tone_generate_src_fill()
282 src->on_time, in gst_tone_generate_src_fill()
283 src->off_time, src->on_time2, src->off_time2, src->repeat); in gst_tone_generate_src_fill()
285 src->tone_state = tone_gen_init (src->tone_state, src->tone_desc); in gst_tone_generate_src_fill()
286 src->properties_changed = FALSE; in gst_tone_generate_src_fill()
289 tone_gen (src->tone_state, (int16_t *) map.data, samples); in gst_tone_generate_src_fill()
290 GST_OBJECT_UNLOCK (src); in gst_tone_generate_src_fill()
301 GstToneGenerateSrc *src = GST_TONE_GENERATE_SRC (object); in gst_tone_generate_src_set_property() local
305 src->samples_per_buffer = g_value_get_int (value); in gst_tone_generate_src_set_property()
306 gst_base_src_set_blocksize (GST_BASE_SRC_CAST (src), in gst_tone_generate_src_set_property()
307 2 * src->samples_per_buffer); in gst_tone_generate_src_set_property()
310 GST_OBJECT_LOCK (src); in gst_tone_generate_src_set_property()
311 src->freq = g_value_get_int (value); in gst_tone_generate_src_set_property()
312 src->properties_changed = TRUE; in gst_tone_generate_src_set_property()
313 GST_OBJECT_UNLOCK (src); in gst_tone_generate_src_set_property()
316 GST_OBJECT_LOCK (src); in gst_tone_generate_src_set_property()
317 src->volume = g_value_get_int (value); in gst_tone_generate_src_set_property()
318 src->properties_changed = TRUE; in gst_tone_generate_src_set_property()
319 GST_OBJECT_UNLOCK (src); in gst_tone_generate_src_set_property()
322 GST_OBJECT_LOCK (src); in gst_tone_generate_src_set_property()
323 src->freq2 = g_value_get_int (value); in gst_tone_generate_src_set_property()
324 src->properties_changed = TRUE; in gst_tone_generate_src_set_property()
325 GST_OBJECT_UNLOCK (src); in gst_tone_generate_src_set_property()
328 GST_OBJECT_LOCK (src); in gst_tone_generate_src_set_property()
329 src->volume2 = g_value_get_int (value); in gst_tone_generate_src_set_property()
330 src->properties_changed = TRUE; in gst_tone_generate_src_set_property()
331 GST_OBJECT_UNLOCK (src); in gst_tone_generate_src_set_property()
334 GST_OBJECT_LOCK (src); in gst_tone_generate_src_set_property()
335 src->on_time = g_value_get_int (value); in gst_tone_generate_src_set_property()
336 src->properties_changed = TRUE; in gst_tone_generate_src_set_property()
337 GST_OBJECT_UNLOCK (src); in gst_tone_generate_src_set_property()
340 GST_OBJECT_LOCK (src); in gst_tone_generate_src_set_property()
341 src->on_time2 = g_value_get_int (value); in gst_tone_generate_src_set_property()
342 src->properties_changed = TRUE; in gst_tone_generate_src_set_property()
343 GST_OBJECT_UNLOCK (src); in gst_tone_generate_src_set_property()
346 GST_OBJECT_LOCK (src); in gst_tone_generate_src_set_property()
347 src->off_time = g_value_get_int (value); in gst_tone_generate_src_set_property()
348 src->properties_changed = TRUE; in gst_tone_generate_src_set_property()
349 GST_OBJECT_UNLOCK (src); in gst_tone_generate_src_set_property()
352 GST_OBJECT_LOCK (src); in gst_tone_generate_src_set_property()
353 src->off_time2 = g_value_get_int (value); in gst_tone_generate_src_set_property()
354 src->properties_changed = TRUE; in gst_tone_generate_src_set_property()
355 GST_OBJECT_UNLOCK (src); in gst_tone_generate_src_set_property()
358 GST_OBJECT_LOCK (src); in gst_tone_generate_src_set_property()
359 src->repeat = g_value_get_boolean (value); in gst_tone_generate_src_set_property()
360 src->properties_changed = TRUE; in gst_tone_generate_src_set_property()
361 GST_OBJECT_UNLOCK (src); in gst_tone_generate_src_set_property()
373 GstToneGenerateSrc *src = GST_TONE_GENERATE_SRC (object); in gst_tone_generate_src_get_property() local
377 g_value_set_int (value, src->samples_per_buffer); in gst_tone_generate_src_get_property()
380 g_value_set_int (value, src->freq); in gst_tone_generate_src_get_property()
383 g_value_set_int (value, src->volume); in gst_tone_generate_src_get_property()
386 g_value_set_int (value, src->freq2); in gst_tone_generate_src_get_property()
389 g_value_set_int (value, src->volume2); in gst_tone_generate_src_get_property()
392 g_value_set_int (value, src->on_time); in gst_tone_generate_src_get_property()
395 g_value_set_int (value, src->off_time); in gst_tone_generate_src_get_property()
398 g_value_set_int (value, src->on_time2); in gst_tone_generate_src_get_property()
401 g_value_set_int (value, src->off_time2); in gst_tone_generate_src_get_property()
404 g_value_set_boolean (value, src->repeat); in gst_tone_generate_src_get_property()