+ /* Send any samples that haven't been sent yet. */
+ send_buffer(in);
+
+ if (inc->started) {
+ packet.type = SR_DF_END;
+ sr_session_send(in->sdi, &packet);
+ }
+
+ return ret;
+}
+
+static void cleanup(struct sr_input *in)
+{
+ struct context *inc;
+
+ inc = in->priv;
+ g_slist_free_full(inc->channels, free_channel);
+ g_free(inc->buffer);
+ inc->buffer = NULL;
+ g_free(inc->current_levels);
+ inc->current_levels = NULL;
+}
+
+static struct sr_option options[] = {
+ { "numchannels", "Number of channels", "Number of channels", NULL, NULL },
+ { "skip", "Skip", "Skip until timestamp", NULL, NULL },
+ { "downsample", "Downsample", "Divide samplerate by factor", NULL, NULL },
+ { "compress", "Compress", "Compress idle periods longer than this value", NULL, NULL },
+ ALL_ZERO
+};
+
+static const struct sr_option *get_options(void)
+{
+ if (!options[0].def) {
+ options[0].def = g_variant_ref_sink(g_variant_new_int32(0));
+ options[1].def = g_variant_ref_sink(g_variant_new_int32(-1));
+ options[2].def = g_variant_ref_sink(g_variant_new_int32(1));
+ options[3].def = g_variant_ref_sink(g_variant_new_int32(0));
+ }
+
+ return options;