static int process_buffer(struct sr_input *in)
{
struct sr_datafeed_packet packet;
- struct sr_datafeed_meta meta;
struct sr_datafeed_logic logic;
- struct sr_config *src;
struct context *inc;
gsize chunk_size, i;
int chunk;
std_session_send_df_header(in->sdi);
if (inc->samplerate) {
- packet.type = SR_DF_META;
- packet.payload = &meta;
- src = sr_config_new(SR_CONF_SAMPLERATE, g_variant_new_uint64(inc->samplerate));
- meta.config = g_slist_append(NULL, src);
- sr_session_send(in->sdi, &packet);
- g_slist_free(meta.config);
- sr_config_free(src);
+ (void)sr_session_send_meta(in->sdi, SR_CONF_SAMPLERATE,
+ g_variant_new_uint64(inc->samplerate));
}
inc->started = TRUE;
static int process_buffer(struct sr_input *in)
{
struct sr_datafeed_packet packet;
- struct sr_datafeed_meta meta;
struct sr_datafeed_logic logic;
- struct sr_config *src;
struct context *inc;
gsize chunk_size, i;
gsize chunk;
std_session_send_df_header(in->sdi);
if (inc->samplerate) {
- packet.type = SR_DF_META;
- packet.payload = &meta;
- src = sr_config_new(SR_CONF_SAMPLERATE, g_variant_new_uint64(inc->samplerate));
- meta.config = g_slist_append(NULL, src);
- sr_session_send(in->sdi, &packet);
- g_slist_free(meta.config);
- sr_config_free(src);
+ (void)sr_session_send_meta(in->sdi, SR_CONF_SAMPLERATE,
+ g_variant_new_uint64(inc->samplerate));
}
inc->samples_remain = CHRONOVU_LA8_DATASIZE;
static int flush_samplerate(const struct sr_input *in)
{
struct context *inc;
- struct sr_datafeed_packet packet;
- struct sr_datafeed_meta meta;
- struct sr_config *src;
inc = in->priv;
if (!inc->calc_samplerate && inc->samplerate)
inc->calc_samplerate = inc->samplerate;
if (inc->calc_samplerate && !inc->samplerate_sent) {
- packet.type = SR_DF_META;
- packet.payload = &meta;
- src = sr_config_new(SR_CONF_SAMPLERATE, g_variant_new_uint64(inc->calc_samplerate));
- meta.config = g_slist_append(NULL, src);
- sr_session_send(in->sdi, &packet);
- g_slist_free(meta.config);
- sr_config_free(src);
+ (void)sr_session_send_meta(in->sdi, SR_CONF_SAMPLERATE,
+ g_variant_new_uint64(inc->calc_samplerate));
inc->samplerate_sent = TRUE;
}
{
struct context *inc;
struct sr_datafeed_packet packet;
- struct sr_datafeed_meta meta;
- struct sr_config *src;
struct sr_datafeed_logic logic;
int rc;
}
if (inc->sample_rate && !inc->rate_sent) {
- packet.type = SR_DF_META;
- packet.payload = &meta;
- src = sr_config_new(SR_CONF_SAMPLERATE,
+ rc = sr_session_send_meta(in->sdi, SR_CONF_SAMPLERATE,
g_variant_new_uint64(inc->sample_rate));
- meta.config = g_slist_append(NULL, src);
- rc = sr_session_send(in->sdi, &packet);
- g_slist_free(meta.config);
- sr_config_free(src);
if (rc)
return rc;
inc->rate_sent = TRUE;
static int process_buffer(struct sr_input *in)
{
struct context *inc;
- struct sr_datafeed_meta meta;
- struct sr_datafeed_packet packet;
- struct sr_config *src;
unsigned int offset, chunk_size;
inc = in->priv;
std_session_send_df_header(in->sdi);
if (inc->samplerate) {
- packet.type = SR_DF_META;
- packet.payload = &meta;
- src = sr_config_new(SR_CONF_SAMPLERATE, g_variant_new_uint64(inc->samplerate));
- meta.config = g_slist_append(NULL, src);
- sr_session_send(in->sdi, &packet);
- g_slist_free(meta.config);
- sr_config_free(src);
+ (void)sr_session_send_meta(in->sdi, SR_CONF_SAMPLERATE,
+ g_variant_new_uint64(inc->samplerate));
}
inc->started = TRUE;
static void send_metadata(struct sr_input *in)
{
- struct sr_datafeed_packet packet;
- struct sr_datafeed_meta meta;
- struct sr_config *src;
struct context *inc;
inc = in->priv;
-
- packet.type = SR_DF_META;
- packet.payload = &meta;
- src = sr_config_new(SR_CONF_SAMPLERATE, g_variant_new_uint64(inc->samplerate));
- meta.config = g_slist_append(NULL, src);
- sr_session_send(in->sdi, &packet);
- g_slist_free(meta.config);
- sr_config_free(src);
-
+ (void)sr_session_send_meta(in->sdi, SR_CONF_SAMPLERATE,
+ g_variant_new_uint64(inc->samplerate));
inc->meta_sent = TRUE;
}
static int process_buffer(struct sr_input *in)
{
struct context *inc;
- struct sr_datafeed_packet packet;
- struct sr_datafeed_meta meta;
- struct sr_config *src;
int offset, chunk_samples, total_samples, processed, max_chunk_samples;
int num_samples, i;
inc = in->priv;
if (!inc->started) {
std_session_send_df_header(in->sdi);
-
- packet.type = SR_DF_META;
- packet.payload = &meta;
- src = sr_config_new(SR_CONF_SAMPLERATE, g_variant_new_uint64(inc->samplerate));
- meta.config = g_slist_append(NULL, src);
- sr_session_send(in->sdi, &packet);
- g_slist_free(meta.config);
- sr_config_free(src);
-
+ (void)sr_session_send_meta(in->sdi, SR_CONF_SAMPLERATE,
+ g_variant_new_uint64(inc->samplerate));
inc->started = TRUE;
}