Lines Matching refs:lv2
50 GstLV2 lv2; member
74 GstLV2Class lv2; member
97 return gst_lv2_get_preset_names (&self->lv2, (GstObject *) self); in gst_lv2_source_get_preset_names()
105 return gst_lv2_load_preset (&self->lv2, (GstObject *) self, name); in gst_lv2_source_load_preset()
113 return gst_lv2_save_preset (&self->lv2, (GstObject *) self, name); in gst_lv2_source_save_preset()
128 return gst_lv2_delete_preset (&self->lv2, (GstObject *) self, name); in gst_lv2_source_delete_preset()
166 GstLV2Source *lv2 = (GstLV2Source *) base; in gst_lv2_source_set_caps() local
174 GST_DEBUG_OBJECT (lv2, "negotiated to caps %" GST_PTR_FORMAT, caps); in gst_lv2_source_set_caps()
176 lv2->info = info; in gst_lv2_source_set_caps()
179 GST_AUDIO_INFO_BPF (&info) * lv2->samples_per_buffer); in gst_lv2_source_set_caps()
181 if (!gst_lv2_setup (&lv2->lv2, GST_AUDIO_INFO_RATE (&info))) in gst_lv2_source_set_caps()
188 GST_ERROR_OBJECT (lv2, "could not create instance"); in gst_lv2_source_set_caps()
196 GstLV2Source *lv2 = (GstLV2Source *) base; in gst_lv2_source_fixate() local
203 GST_DEBUG_OBJECT (lv2, "fixating samplerate to %d", GST_AUDIO_DEF_RATE); in gst_lv2_source_fixate()
211 lv2->lv2.klass->out_group.ports->len); in gst_lv2_source_fixate()
246 GstLV2Source *lv2 = (GstLV2Source *) base; in gst_lv2_source_do_seek() local
251 GST_DEBUG_OBJECT (lv2, "seeking %" GST_SEGMENT_FORMAT, segment); in gst_lv2_source_do_seek()
254 lv2->reverse = (segment->rate < 0.0); in gst_lv2_source_do_seek()
256 samplerate = GST_AUDIO_INFO_RATE (&lv2->info); in gst_lv2_source_do_seek()
257 bpf = GST_AUDIO_INFO_BPF (&lv2->info); in gst_lv2_source_do_seek()
261 lv2->next_byte = next_sample * bpf; in gst_lv2_source_do_seek()
263 lv2->next_time = 0; in gst_lv2_source_do_seek()
265 lv2->next_time = in gst_lv2_source_do_seek()
268 GST_DEBUG_OBJECT (lv2, "seeking next_sample=%" G_GINT64_FORMAT in gst_lv2_source_do_seek()
270 GST_TIME_ARGS (lv2->next_time)); in gst_lv2_source_do_seek()
272 g_assert (lv2->next_time <= time); in gst_lv2_source_do_seek()
274 lv2->next_sample = next_sample; in gst_lv2_source_do_seek()
276 if (!lv2->reverse) { in gst_lv2_source_do_seek()
288 lv2->sample_stop = in gst_lv2_source_do_seek()
290 lv2->check_seek_stop = TRUE; in gst_lv2_source_do_seek()
292 lv2->check_seek_stop = FALSE; in gst_lv2_source_do_seek()
294 lv2->eos_reached = FALSE; in gst_lv2_source_do_seek()
309 GstLV2Source *lv2 = (GstLV2Source *) base; in gst_lv2_source_query() local
320 if (!gst_audio_info_convert (&lv2->info, src_fmt, src_val, dest_fmt, in gst_lv2_source_query()
322 GST_DEBUG_OBJECT (lv2, "query failed"); in gst_lv2_source_query()
335 if (lv2->can_activate_pull) in gst_lv2_source_query()
365 GstLV2Source *lv2 = (GstLV2Source *) base; in gst_lv2_source_fill() local
366 GstLV2SourceClass *klass = (GstLV2SourceClass *) GST_BASE_SRC_GET_CLASS (lv2); in gst_lv2_source_fill()
367 GstLV2Class *lv2_class = &klass->lv2; in gst_lv2_source_fill()
381 if (!lv2->tags_pushed) { in gst_lv2_source_fill()
391 lv2->tags_pushed = TRUE; in gst_lv2_source_fill()
394 if (lv2->eos_reached) { in gst_lv2_source_fill()
395 GST_INFO_OBJECT (lv2, "eos"); in gst_lv2_source_fill()
399 samplerate = GST_AUDIO_INFO_RATE (&lv2->info); in gst_lv2_source_fill()
400 bpf = GST_AUDIO_INFO_BPF (&lv2->info); in gst_lv2_source_fill()
405 samples = lv2->samples_per_buffer; in gst_lv2_source_fill()
411 offset = lv2->next_byte; in gst_lv2_source_fill()
414 if (offset != lv2->next_byte) { in gst_lv2_source_fill()
415 GST_DEBUG_OBJECT (lv2, "seek to new offset %" G_GUINT64_FORMAT, offset); in gst_lv2_source_fill()
417 lv2->next_sample = offset / bpf; in gst_lv2_source_fill()
418 lv2->next_time = in gst_lv2_source_fill()
419 gst_util_uint64_scale_int (lv2->next_sample, GST_SECOND, samplerate); in gst_lv2_source_fill()
420 lv2->next_byte = offset; in gst_lv2_source_fill()
424 if (lv2->check_seek_stop && in gst_lv2_source_fill()
425 (lv2->sample_stop > lv2->next_sample) && in gst_lv2_source_fill()
426 (lv2->sample_stop < lv2->next_sample + samples) in gst_lv2_source_fill()
429 lv2->generate_samples_per_buffer = lv2->sample_stop - lv2->next_sample; in gst_lv2_source_fill()
430 next_sample = lv2->sample_stop; in gst_lv2_source_fill()
431 lv2->eos_reached = TRUE; in gst_lv2_source_fill()
433 GST_INFO_OBJECT (lv2, "eos reached"); in gst_lv2_source_fill()
436 lv2->generate_samples_per_buffer = samples; in gst_lv2_source_fill()
437 next_sample = lv2->next_sample + (lv2->reverse ? (-samples) : samples); in gst_lv2_source_fill()
440 bytes = lv2->generate_samples_per_buffer * bpf; in gst_lv2_source_fill()
442 next_byte = lv2->next_byte + (lv2->reverse ? (-bytes) : bytes); in gst_lv2_source_fill()
445 GST_LOG_OBJECT (lv2, "samplerate %d", samplerate); in gst_lv2_source_fill()
446 GST_LOG_OBJECT (lv2, in gst_lv2_source_fill()
452 GST_BUFFER_OFFSET (buffer) = lv2->next_sample; in gst_lv2_source_fill()
454 if (!lv2->reverse) { in gst_lv2_source_fill()
455 GST_BUFFER_TIMESTAMP (buffer) = lv2->timestamp_offset + lv2->next_time; in gst_lv2_source_fill()
456 GST_BUFFER_DURATION (buffer) = next_time - lv2->next_time; in gst_lv2_source_fill()
458 GST_BUFFER_TIMESTAMP (buffer) = lv2->timestamp_offset + next_time; in gst_lv2_source_fill()
459 GST_BUFFER_DURATION (buffer) = lv2->next_time - next_time; in gst_lv2_source_fill()
462 gst_object_sync_values (GST_OBJECT (lv2), GST_BUFFER_TIMESTAMP (buffer)); in gst_lv2_source_fill()
464 lv2->next_time = next_time; in gst_lv2_source_fill()
465 lv2->next_sample = next_sample; in gst_lv2_source_fill()
466 lv2->next_byte = next_byte; in gst_lv2_source_fill()
468 GST_LOG_OBJECT (lv2, "generating %u samples at ts %" GST_TIME_FORMAT, in gst_lv2_source_fill()
479 lilv_instance_connect_port (lv2->lv2.instance, lv2_port->index, in gst_lv2_source_fill()
481 GST_LOG_OBJECT (lv2, "connected port %d/%d", j, lv2_group->ports->len); in gst_lv2_source_fill()
485 lilv_instance_connect_port (lv2->lv2.instance, lv2_port->index, in gst_lv2_source_fill()
487 GST_LOG_OBJECT (lv2, "connected port 0"); in gst_lv2_source_fill()
498 val = lv2->lv2.ports.control.in[j]; in gst_lv2_source_fill()
502 lilv_instance_connect_port (lv2->lv2.instance, lv2_port->index, mem); in gst_lv2_source_fill()
506 lilv_instance_run (lv2->lv2.instance, samples); in gst_lv2_source_fill()
524 GstLV2Source *lv2 = (GstLV2Source *) base; in gst_lv2_source_start() local
526 lv2->next_sample = 0; in gst_lv2_source_start()
527 lv2->next_byte = 0; in gst_lv2_source_start()
528 lv2->next_time = 0; in gst_lv2_source_start()
529 lv2->check_seek_stop = FALSE; in gst_lv2_source_start()
530 lv2->eos_reached = FALSE; in gst_lv2_source_start()
531 lv2->tags_pushed = FALSE; in gst_lv2_source_start()
541 GstLV2Source *lv2 = (GstLV2Source *) base; in gst_lv2_source_stop() local
544 return gst_lv2_cleanup (&lv2->lv2, (GstObject *) lv2); in gst_lv2_source_stop()
573 gst_lv2_object_set_property (&self->lv2, object, prop_id, value, pspec); in gst_lv2_source_set_property()
601 gst_lv2_object_get_property (&self->lv2, object, prop_id, value, pspec); in gst_lv2_source_get_property()
611 gst_lv2_finalize (&self->lv2); in gst_lv2_source_finalize()
625 gst_lv2_class_init (&klass->lv2, G_TYPE_FROM_CLASS (klass)); in gst_lv2_source_base_init()
627 gst_lv2_element_class_set_metadata (&klass->lv2, element_class, in gst_lv2_source_base_init()
632 "channels", G_TYPE_INT, klass->lv2.out_group.ports->len, in gst_lv2_source_base_init()
647 gst_lv2_class_finalize (&lv2_class->lv2); in gst_lv2_source_base_finalize()
702 gst_lv2_class_install_properties (&klass->lv2, gobject_class, in gst_lv2_source_class_init()
709 gst_lv2_init (&self->lv2, &klass->lv2); in gst_lv2_source_init()