+static int end(struct sr_input *in)
+{
+ struct sr_datafeed_packet packet;
+ struct context *inc;
+ int ret;
+
+ if (in->sdi_ready)
+ ret = process_buffer(in);
+ else
+ ret = SR_OK;
+
+ inc = in->priv;
+ 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);
+}
+
+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 struct sr_option *get_options(void)
+{
+ if (!options[0].def) {
+ options[0].def = g_variant_ref_sink(g_variant_new_int32(DEFAULT_NUM_CHANNELS));
+ 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;